Module: wine Branch: master Commit: 6a03b38f33b3f3898da505364cd58887633a98ab URL: http://source.winehq.org/git/wine.git/?a=commit;h=6a03b38f33b3f3898da505364c...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Mar 29 17:49:43 2016 +0200
jscript: Use already running interpreter for eval() execution.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/jscript/dispex.c | 2 +- dlls/jscript/global.c | 4 +++- dlls/jscript/jscript.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 4f5a35f..5efe0d5 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -377,7 +377,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t if(prop->name || This->builtin_info->class != JSCLASS_FUNCTION) { vdisp_t vthis;
- if(This->builtin_info->class != JSCLASS_FUNCTION) + if(This->builtin_info->class != JSCLASS_FUNCTION && prop->u.p->invoke != JSGlobal_eval) flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; if(jsthis) set_disp(&vthis, jsthis); diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index d473dc3..58dbd95 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -185,7 +185,7 @@ static HRESULT JSGlobal_escape(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u }
/* ECMA-262 3rd Edition 15.1.2.1 */ -static HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, +HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { call_frame_t *frame; @@ -226,6 +226,8 @@ static HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
if(frame->flags & EXEC_GLOBAL) exec_flags |= EXEC_GLOBAL; + if(flags & DISPATCH_JSCRIPT_CALLEREXECSSOURCE) + exec_flags |= EXEC_RETURN_TO_INTERP; hres = exec_source(ctx, exec_flags, code, &code->global_code, frame->scope, frame->this_obj, NULL, frame->variable_obj, NULL, r); release_bytecode(code); diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index cc66418..4331ee7 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -475,6 +475,8 @@ HRESULT regexp_string_match(script_ctx_t*,jsdisp_t*,jsstr_t*,jsval_t*) DECLSPEC_ BOOL bool_obj_value(jsdisp_t*) DECLSPEC_HIDDEN; unsigned array_get_length(jsdisp_t*) DECLSPEC_HIDDEN;
+HRESULT JSGlobal_eval(script_ctx_t*,vdisp_t*,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN; + static inline BOOL is_class(jsdisp_t *jsdisp, jsclass_t class) { return jsdisp->builtin_info->class == class;