mirror of https://github.com/svaarala/duktape.git
Sami Vaarala
12 years ago
2 changed files with 30 additions and 0 deletions
@ -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…
Reference in new issue