jscript: Use already running interpreter for eval() execution.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-03-29 17:49:43 +02:00 committed by Alexandre Julliard
parent 889f2657dd
commit 6a03b38f33
3 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;