mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-05 17:29:43 +08:00
Inherit strictness from invoking function in eval.
This commit is contained in:
@@ -1359,7 +1359,7 @@ js_Function *jsC_compilefunction(js_State *J, js_Ast *prog)
|
||||
return newfun(J, prog->a, prog->b, prog->c, 0, J->default_strict);
|
||||
}
|
||||
|
||||
js_Function *jsC_compile(js_State *J, js_Ast *prog)
|
||||
js_Function *jsC_compilescript(js_State *J, js_Ast *prog, int default_strict)
|
||||
{
|
||||
return newfun(J, NULL, NULL, prog, 1, J->default_strict);
|
||||
return newfun(J, NULL, NULL, prog, 1, default_strict);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ struct js_Function
|
||||
};
|
||||
|
||||
js_Function *jsC_compilefunction(js_State *J, js_Ast *prog);
|
||||
js_Function *jsC_compile(js_State *J, js_Ast *prog);
|
||||
js_Function *jsC_compilescript(js_State *J, js_Ast *prog, int default_strict);
|
||||
const char *jsC_opcodestring(enum js_OpCode opcode);
|
||||
void jsC_dumpfunction(js_State *J, js_Function *fun);
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static void js_loadstringx(js_State *J, const char *filename, const char *source
|
||||
}
|
||||
|
||||
P = jsP_parse(J, filename, source);
|
||||
F = jsC_compile(J, P);
|
||||
F = jsC_compilescript(J, P, iseval ? J->strict : J->default_strict);
|
||||
jsP_freeparse(J);
|
||||
js_newscript(J, F, iseval ? (J->strict ? J->E : NULL) : J->GE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user