Browse Source

catch binding test cases, illustrate current bug

pull/1/head
Sami Vaarala 12 years ago
parent
commit
f9739eaf80
  1. 0
      testcases/test-dev-bug-catch-binding-1.js
  2. 30
      testcases/test-dev-bug-catch-binding-2.js

0
testcases/test-dev-bug-catch-binding.js → testcases/test-dev-bug-catch-binding-1.js

30
testcases/test-dev-bug-catch-binding-2.js

@ -0,0 +1,30 @@
/*===
closure throw
closure throw
closure throw
===*/
/* This was broken at an early point. Catch binding variable would be mapped
* to a certain register for the duration of the catch clause. A closure
* created from the catch clause would work incorrectly once the original
* invocation exited the catch clause.
*/
function f() {
var e = 123;
var func;
try {
throw 'throw';
} catch (e) {
func = function() { print('closure', e); }
func();
}
func();
return func;
}
f()();
Loading…
Cancel
Save