jscript: Add DISPATCH_PROPERTYGET flag only for DISPATCH_METHOD call in disp_call_value.

Spotted by Qian Hong.
This commit is contained in:
Jacek Caban 2014-09-16 20:42:33 +02:00 committed by Alexandre Julliard
parent 063ef3ca0e
commit 02406d4fd4
2 changed files with 10 additions and 1 deletions

View File

@ -1202,7 +1202,7 @@ HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, IDispatch *jsthis, W
return hres; return hres;
} }
if(r && argc) if(r && argc && flags == DISPATCH_METHOD)
flags |= DISPATCH_PROPERTYGET; flags |= DISPATCH_PROPERTYGET;
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);

View File

@ -95,6 +95,7 @@ DEFINE_EXPECT(dispexfunc_value);
DEFINE_EXPECT(testobj_delete_test); DEFINE_EXPECT(testobj_delete_test);
DEFINE_EXPECT(testobj_delete_nodelete); DEFINE_EXPECT(testobj_delete_nodelete);
DEFINE_EXPECT(testobj_value); DEFINE_EXPECT(testobj_value);
DEFINE_EXPECT(testobj_construct);
DEFINE_EXPECT(testobj_prop_d); DEFINE_EXPECT(testobj_prop_d);
DEFINE_EXPECT(testobj_withprop_d); DEFINE_EXPECT(testobj_withprop_d);
DEFINE_EXPECT(testobj_withprop_i); 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: case INVOKE_FUNC|INVOKE_PROPERTYGET:
ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
break; break;
case DISPATCH_CONSTRUCT:
CHECK_EXPECT(testobj_construct);
ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
break;
default: default:
ok(0, "invalid flag (%x)\n", wFlags); 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');"); parse_script_a("ok(String.prototype.concat.call(testObj, ' OK') === '1 OK', 'wrong concat result');");
CHECK_CALLED(testobj_value); 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_d);
SET_EXPECT(global_propget_i); SET_EXPECT(global_propget_i);
parse_script_a("this.testPropGet;"); parse_script_a("this.testPropGet;");