1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* Non-reentrant call on an inner and outer closure. */ function foo() { var x = 0; function bar() { var y = 0; function baz() { return ++x + ++y; } return baz; } return bar(); } var a = foo(); var b = foo(); assertEq(a() + a() + b() + b(), 12);