mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 933798 - Don't inhibit name optimizations in try blocks. r=bhackett
This commit is contained in:
parent
2662326c9c
commit
7067a85ea3
@ -1144,12 +1144,8 @@ TryConvertFreeName(BytecodeEmitter *bce, ParseNode *pn)
|
||||
// The only statements within a lazy function which can push lexical
|
||||
// scopes are try/catch blocks. Use generic ops in this case.
|
||||
for (StmtInfoBCE *stmt = bce->topStmt; stmt; stmt = stmt->down) {
|
||||
switch (stmt->type) {
|
||||
case STMT_TRY:
|
||||
case STMT_FINALLY:
|
||||
if (stmt->type == STMT_CATCH)
|
||||
return true;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
size_t hops = 0;
|
||||
|
30
js/src/jit-test/tests/basic/bug934997.js
Normal file
30
js/src/jit-test/tests/basic/bug934997.js
Normal file
@ -0,0 +1,30 @@
|
||||
function test1() {
|
||||
var BUGNUMBER = '';
|
||||
var summary = '';
|
||||
var actual = '';
|
||||
test(BUGNUMBER);
|
||||
function test() {
|
||||
try {
|
||||
(function () { eval("'foo'.b()", arguments) })();
|
||||
} catch(ex) {
|
||||
actual = ex + '';
|
||||
}
|
||||
}
|
||||
assertEq(actual, 'TypeError: "foo".b is not a function');
|
||||
}
|
||||
test1();
|
||||
|
||||
function test2() {
|
||||
var BUGNUMBER = '';
|
||||
var summary = '';
|
||||
function g() {
|
||||
'use strict';
|
||||
try {
|
||||
eval('function foo() { var a, arguments, b;}');
|
||||
} catch (x) {
|
||||
return (x instanceof SyntaxError);
|
||||
}
|
||||
};
|
||||
assertEq(g(), true);
|
||||
}
|
||||
test2();
|
Loading…
Reference in New Issue
Block a user