Commit 813609b8 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Use already running interpreter for Function.apply() execution.

parent fa726bed
...@@ -377,6 +377,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t ...@@ -377,6 +377,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t
if(prop->name || This->builtin_info->class != JSCLASS_FUNCTION) { if(prop->name || This->builtin_info->class != JSCLASS_FUNCTION) {
vdisp_t vthis; vdisp_t vthis;
if(This->builtin_info->class != JSCLASS_FUNCTION)
flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK;
if(jsthis) if(jsthis)
set_disp(&vthis, jsthis); set_disp(&vthis, jsthis);
......
...@@ -274,12 +274,12 @@ static HRESULT invoke_value_proc(script_ctx_t *ctx, FunctionInstance *function, ...@@ -274,12 +274,12 @@ static HRESULT invoke_value_proc(script_ctx_t *ctx, FunctionInstance *function,
} }
static HRESULT call_function(script_ctx_t *ctx, FunctionInstance *function, IDispatch *this_obj, static HRESULT call_function(script_ctx_t *ctx, FunctionInstance *function, IDispatch *this_obj,
unsigned argc, jsval_t *argv, jsval_t *r) unsigned argc, jsval_t *argv, BOOL caller_execs_source, jsval_t *r)
{ {
if(function->value_proc) if(function->value_proc)
return invoke_value_proc(ctx, function, this_obj, DISPATCH_METHOD, argc, argv, r); return invoke_value_proc(ctx, function, this_obj, DISPATCH_METHOD, argc, argv, r);
return invoke_source(ctx, function, this_obj, argc, argv, FALSE, FALSE, r); return invoke_source(ctx, function, this_obj, argc, argv, FALSE, caller_execs_source, r);
} }
static HRESULT function_to_string(FunctionInstance *function, jsstr_t **ret) static HRESULT function_to_string(FunctionInstance *function, jsstr_t **ret)
...@@ -459,7 +459,7 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un ...@@ -459,7 +459,7 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
} }
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = call_function(ctx, function, this_obj, cnt, args, r); hres = call_function(ctx, function, this_obj, cnt, args, (flags & DISPATCH_JSCRIPT_CALLEREXECSSOURCE) != 0, r);
if(this_obj) if(this_obj)
IDispatch_Release(this_obj); IDispatch_Release(this_obj);
...@@ -492,7 +492,7 @@ static HRESULT Function_call(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns ...@@ -492,7 +492,7 @@ static HRESULT Function_call(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
cnt = argc-1; cnt = argc-1;
} }
hres = call_function(ctx, function, this_obj, cnt, argv+1, r); hres = call_function(ctx, function, this_obj, cnt, argv+1, FALSE, r);
if(this_obj) if(this_obj)
IDispatch_Release(this_obj); IDispatch_Release(this_obj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment