|
1 |
|
2 function outer() { |
|
3 var xyz = 0; |
|
4 function foo() { |
|
5 function bar() { xyz++; } |
|
6 bar(); |
|
7 let x = 3; |
|
8 } |
|
9 foo(); |
|
10 assertEq(xyz, 1); |
|
11 } |
|
12 outer(); |
|
13 |
|
14 function mapfloor(a) { |
|
15 var b = a.map(function(v) { |
|
16 "use strict"; |
|
17 try { |
|
18 eval("delete String;"); |
|
19 } catch (e) { |
|
20 return e instanceof res; |
|
21 } |
|
22 }); |
|
23 var res = ""; |
|
24 } |
|
25 try { |
|
26 mapfloor([1,2]); |
|
27 } catch (e) {} |
|
28 |
|
29 test(); |
|
30 function test() { |
|
31 try { |
|
32 eval('let(z) { with({}) let y = 3; }'); |
|
33 } catch(ex) { |
|
34 (function(x) { return !(x) })(0/0) |
|
35 } |
|
36 } |
|
37 |
|
38 testCatch(15); |
|
39 function testCatch(y) { |
|
40 try { |
|
41 throw 5; |
|
42 } catch(ex) { |
|
43 (function(x) { assertEq(x + y + ex, 25); })(5) |
|
44 } |
|
45 } |