зеркало из https://github.com/mozilla/pjs.git
Bug 684489 - Fix a strict direct eval bug affecting Google Maps. r=Waldo.
--HG-- extra : rebase_source : 5e708cc26a923934a363f327696bcd2913038f21
This commit is contained in:
Родитель
78176dbb9c
Коммит
32cc1c8be6
|
@ -1510,7 +1510,17 @@ Parser::setFunctionKinds(FunctionBox *funbox, uint32 *tcflags)
|
|||
|
||||
if (funbox->tcflags & TCF_FUN_HEAVYWEIGHT) {
|
||||
/* nothing to do */
|
||||
} else if (funbox->inAnyDynamicScope()) {
|
||||
} else if (callerFrame || funbox->inAnyDynamicScope()) {
|
||||
/*
|
||||
* Either we are in a with-block or a function scope that is
|
||||
* subject to direct eval; or we are compiling strict direct eval
|
||||
* code.
|
||||
*
|
||||
* In either case, fun may reference names that are not bound but
|
||||
* are not necessarily global either. (In the strict direct eval
|
||||
* case, we could bind them, but currently do not bother; see
|
||||
* the comment about strict mode code in BindTopLevelVar.)
|
||||
*/
|
||||
JS_ASSERT(!fun->isNullClosure());
|
||||
} else {
|
||||
bool hasUpvars = false;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
eval("var x = {}; ({p: function() { x.m; }}).p();");
|
Загрузка…
Ссылка в новой задаче