зеркало из https://github.com/mozilla/gecko-dev.git
bug 320172: Functions that call eval need to be heavyweight functions so that var declarations in their eval'd string have a varobj to call home. r=brendan
This commit is contained in:
Родитель
4f86c6b578
Коммит
f143012f3e
|
@ -1146,6 +1146,14 @@ obj_eval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
return JS_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the caller is a lightweight function and doesn't have a variables
|
||||
* object, then we need to provide one for the compiler to stick any
|
||||
* declared (var) variables into.
|
||||
*/
|
||||
if (caller && !caller->varobj && !js_GetCallObject(cx, caller, NULL))
|
||||
return JS_FALSE;
|
||||
|
||||
#if JS_HAS_SCRIPT_OBJECT
|
||||
/*
|
||||
* Script.prototype.compile/exec and Object.prototype.eval all take an
|
||||
|
|
Загрузка…
Ссылка в новой задаче