Fix upvar decompilation for eval-from-fun case (452441, r=igor).

This commit is contained in:
Brendan Eich
2008-08-29 00:24:11 -07:00
parent 1bb635fcc3
commit 923e281f86
6 changed files with 21 additions and 6 deletions

View File

@@ -1318,14 +1318,15 @@ js_obj_eval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
fp->flags |= JSFRAME_EVAL;
} while ((fp = fp->down) != caller);
script = js_CompileScript(cx, scopeobj, principals, TCF_COMPILE_N_GO,
script = js_CompileScript(cx, scopeobj, principals,
TCF_COMPILE_N_GO |
TCF_PUT_STATIC_DEPTH(caller->script->staticDepth + 1),
JSSTRING_CHARS(str), JSSTRING_LENGTH(str),
NULL, file, line);
if (!script) {
ok = JS_FALSE;
goto out;
}
script->staticDepth = caller->script->staticDepth + 1;
if (argc < 2) {
/* Execute using caller's new scope object (might be a Call object). */