Bug 1921963 part 1 - Use JS::ReportUncatchableException more outside the JS engine...
[gecko.git] / js / src / tests / non262 / Exceptions / catchguard-002-n.js
blobfa574389dbcb6a6f4df24f29f6444d1c5d78ae9e
1 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*-
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 DESCRIPTION = "var in catch clause should have caused an error.";
9 var expect;
10 var actual;
12 test();
14 function test()
16   var EXCEPTION_DATA = "String exception";
17   var e;
19   printStatus ("Catchguard var declaration negative test.");
20    
21   try
22   {   
23     throw EXCEPTION_DATA;  
24   }
25   catch (var e)
26   {  
27     actual = e + '';
28   }
30   reportCompare(expect, actual, DESCRIPTION);