mirror of
https://github.com/reactos/wine.git
synced 2025-03-03 10:17:23 +00:00
jscript: Pass global object as this if 'this' argument is null or undefined in Function.call.
This commit is contained in:
parent
c214022eca
commit
0e2132faf7
dlls/jscript
@ -455,9 +455,14 @@ static HRESULT Function_call(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
|
||||
|
||||
argc = arg_cnt(dp);
|
||||
if(argc) {
|
||||
hres = to_object(ctx, get_arg(dp,0), &this_obj);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
VARIANT *v = get_arg(dp,0);
|
||||
|
||||
if(V_VT(v) != VT_EMPTY && V_VT(v) != VT_NULL) {
|
||||
hres = to_object(ctx, v, &this_obj);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
args.cArgs = argc-1;
|
||||
}
|
||||
|
||||
|
@ -1395,10 +1395,13 @@ callTest2.apply(tmp);
|
||||
(function () { callTest2.apply(tmp, arguments); })();
|
||||
|
||||
function callTest3() {
|
||||
testThis(this);
|
||||
ok(arguments.length === 0, "arguments.length = " + arguments.length + " expected 0");
|
||||
}
|
||||
|
||||
callTest3.call();
|
||||
callTest3.call(undefined);
|
||||
callTest3.call(null);
|
||||
|
||||
tmp = Number.prototype.toString.call(3);
|
||||
ok(tmp === "3", "Number.prototype.toString.call(3) = " + tmp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user