NULL
};
-static HRESULT create_arguments(script_ctx_t *ctx, LCID lcid, DISPPARAMS *dp,
+static HRESULT create_arguments(script_ctx_t *ctx, IDispatch *calee, LCID lcid, DISPPARAMS *dp,
jsexcept_t *ei, IServiceProvider *caller, DispatchEx **ret)
{
DispatchEx *args;
DWORD i;
HRESULT hres;
+ static const WCHAR caleeW[] = {'c','a','l','l','e','e',0};
+
args = heap_alloc_zero(sizeof(DispatchEx));
if(!args)
return E_OUTOFMEMORY;
V_VT(&var) = VT_I4;
V_I4(&var) = arg_cnt(dp);
hres = jsdisp_propput_name(args, lengthW, lcid, &var, ei, caller);
+
+ if(SUCCEEDED(hres)) {
+ V_VT(&var) = VT_DISPATCH;
+ V_DISPATCH(&var) = calee;
+ hres = jsdisp_propput_name(args, caleeW, lcid, &var, ei, caller);
+ }
}
if(FAILED(hres)) {
if(FAILED(hres))
return hres;
- hres = create_arguments(function->dispex.ctx, lcid, dp, ei, caller, &arg_disp);
+ hres = create_arguments(function->dispex.ctx, (IDispatch*)_IDispatchEx_(&function->dispex),
+ lcid, dp, ei, caller, &arg_disp);
if(SUCCEEDED(hres)) {
VARIANT var;
ok(arguments.length === 2, "arguments.length is not 2");
ok(arguments["0"] === true, "arguments[0] is not true");
ok(arguments["1"] === "test", "arguments[1] is not \"test\"");
+ ok(arguments.callee === testFunc1, "arguments.calee !== testFunc1");
return true;
}
ok(this.test === true, "this.test is not true");
ok(arguments.length === 1, "arguments.length is not 1");
ok(arguments["0"] === true, "arguments[0] is not true");
+ ok(typeof(arguments.callee) === "function", "typeof(arguments.calee) = " + typeof(arguments.calee));
return "test";
};
ok(this !== undefined, "this is undefined");
ok(arguments.length === 1, "arguments.length is not 1");
ok(arguments["0"] === true, "arguments[0] is not 1");
+ ok(arguments.callee === testConstr1, "arguments.calee !== testConstr1");
return false;
}