michael@0: michael@0: function outer() { michael@0: var xyz = 0; michael@0: function foo() { michael@0: function bar() { xyz++; } michael@0: bar(); michael@0: let x = 3; michael@0: } michael@0: foo(); michael@0: assertEq(xyz, 1); michael@0: } michael@0: outer(); michael@0: michael@0: function mapfloor(a) { michael@0: var b = a.map(function(v) { michael@0: "use strict"; michael@0: try { michael@0: eval("delete String;"); michael@0: } catch (e) { michael@0: return e instanceof res; michael@0: } michael@0: }); michael@0: var res = ""; michael@0: } michael@0: try { michael@0: mapfloor([1,2]); michael@0: } catch (e) {} michael@0: michael@0: test(); michael@0: function test() { michael@0: try { michael@0: eval('let(z) { with({}) let y = 3; }'); michael@0: } catch(ex) { michael@0: (function(x) { return !(x) })(0/0) michael@0: } michael@0: } michael@0: michael@0: testCatch(15); michael@0: function testCatch(y) { michael@0: try { michael@0: throw 5; michael@0: } catch(ex) { michael@0: (function(x) { assertEq(x + y + ex, 25); })(5) michael@0: } michael@0: }