jscript: Check for null instance prototype.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0d017b12cf
commit
580413032c
2 changed files with 16 additions and 1 deletions
|
@ -1853,7 +1853,7 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_object_instance(val))
|
if(is_object_instance(val) && get_object(val))
|
||||||
prot = iface_to_jsdisp(get_object(val));
|
prot = iface_to_jsdisp(get_object(val));
|
||||||
jsval_release(val);
|
jsval_release(val);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1864,6 +1864,21 @@ ok(tmp === "VT_DISPATCH", "getVT(Object(nullDisp) = " + tmp);
|
||||||
tmp = Object(nullDisp).toString();
|
tmp = Object(nullDisp).toString();
|
||||||
ok(tmp === "[object Object]", "Object(nullDisp).toString() = " + tmp);
|
ok(tmp === "[object Object]", "Object(nullDisp).toString() = " + tmp);
|
||||||
|
|
||||||
|
function testNullPrototype() {
|
||||||
|
this.x = 13;
|
||||||
|
}
|
||||||
|
tmp = new testNullPrototype();
|
||||||
|
ok(tmp.x === 13, "tmp.x !== 13");
|
||||||
|
ok(!("y" in tmp), "tmp has 'y' property");
|
||||||
|
testNullPrototype.prototype.y = 10;
|
||||||
|
ok("y" in tmp, "tmp does not have 'y' property");
|
||||||
|
tmp = new testNullPrototype();
|
||||||
|
ok(tmp.y === 10, "tmp.y !== 10");
|
||||||
|
testNullPrototype.prototype = nullDisp;
|
||||||
|
tmp = new testNullPrototype();
|
||||||
|
ok(tmp.x === 13, "tmp.x !== 13");
|
||||||
|
ok(!("y" in tmp), "tmp has 'y' property");
|
||||||
|
|
||||||
function do_test() {}
|
function do_test() {}
|
||||||
function nosemicolon() {} nosemicolon();
|
function nosemicolon() {} nosemicolon();
|
||||||
function () {} nosemicolon();
|
function () {} nosemicolon();
|
||||||
|
|
Loading…
Add table
Reference in a new issue