You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
720 B

/*===
throw
throw
throw
===*/
/* This was broken at an early point: the compiler would use a function-wide
* register binding for 'e' and look up the argument / variable declaration
* instead of the (dynamic) catch binding.
*
* h() would actually work because 'with' turns off fast path identifier
* lookups for its duration.
*/
function f(e) {
try {
throw 'throw';
} catch (e) {
print(e);
}
}
function g() {
var e = 'var';
try {
throw 'throw';
} catch (e) {
print(e);
}
}
function h() {
var e = 'var';
with ({}) {
try {
throw 'throw';
} catch (e) {
print(e);
}
}
}
f('arg');
g();
h();