mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 855088 - Watch for 'arguments' variables declared within 'with' blocks, r=luke.
This commit is contained in:
parent
eb4321380d
commit
9e809c98e5
@ -2493,8 +2493,20 @@ Parser<FullParseHandler>::bindVarOrConst(JSContext *cx, BindData<FullParseHandle
|
||||
|
||||
if (stmt && stmt->type == STMT_WITH) {
|
||||
pn->pn_dflags |= PND_DEOPTIMIZED;
|
||||
if (pc->sc->isFunctionBox())
|
||||
pc->sc->asFunctionBox()->setMightAliasLocals();
|
||||
if (pc->sc->isFunctionBox()) {
|
||||
FunctionBox *funbox = pc->sc->asFunctionBox();
|
||||
funbox->setMightAliasLocals();
|
||||
|
||||
/*
|
||||
* This definition isn't being added to the parse context's
|
||||
* declarations, so make sure to indicate the need to deoptimize
|
||||
* the script's arguments object.
|
||||
*/
|
||||
if (name == cx->names().arguments) {
|
||||
funbox->setArgumentsHasLocalBinding();
|
||||
funbox->setDefinitelyNeedsArgsObj();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
5
js/src/jit-test/tests/basic/bug855088.js
Normal file
5
js/src/jit-test/tests/basic/bug855088.js
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
(function (y) {
|
||||
arguments.y = 2;
|
||||
with (0) var arguments=5;
|
||||
})(1);
|
Loading…
Reference in New Issue
Block a user