From 02406d4fd4d55a9ef3950f2ba3932088b2fcbac5 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 16 Sep 2014 20:42:33 +0200 Subject: [PATCH] jscript: Add DISPATCH_PROPERTYGET flag only for DISPATCH_METHOD call in disp_call_value. Spotted by Qian Hong. --- dlls/jscript/dispex.c | 2 +- dlls/jscript/tests/run.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 347e7e1398c..604bd265e74 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -1202,7 +1202,7 @@ HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, IDispatch *jsthis, W return hres; } - if(r && argc) + if(r && argc && flags == DISPATCH_METHOD) flags |= DISPATCH_PROPERTYGET; hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index f6d600a9561..b8edd7d7023 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -95,6 +95,7 @@ DEFINE_EXPECT(dispexfunc_value); DEFINE_EXPECT(testobj_delete_test); DEFINE_EXPECT(testobj_delete_nodelete); DEFINE_EXPECT(testobj_value); +DEFINE_EXPECT(testobj_construct); DEFINE_EXPECT(testobj_prop_d); DEFINE_EXPECT(testobj_withprop_d); DEFINE_EXPECT(testobj_withprop_i); @@ -364,6 +365,10 @@ static HRESULT WINAPI testObj_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, case INVOKE_FUNC|INVOKE_PROPERTYGET: ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); break; + case DISPATCH_CONSTRUCT: + CHECK_EXPECT(testobj_construct); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + break; default: ok(0, "invalid flag (%x)\n", wFlags); } @@ -2121,6 +2126,10 @@ static BOOL run_tests(void) parse_script_a("ok(String.prototype.concat.call(testObj, ' OK') === '1 OK', 'wrong concat result');"); CHECK_CALLED(testobj_value); + SET_EXPECT(testobj_construct); + parse_script_a("var t = new testObj(1);"); + CHECK_CALLED(testobj_construct); + SET_EXPECT(global_propget_d); SET_EXPECT(global_propget_i); parse_script_a("this.testPropGet;");