Commit 58041303 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

jscript: Check for null instance prototype.

parent 0d017b12
......@@ -1853,7 +1853,7 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built
return hres;
}
if(is_object_instance(val))
if(is_object_instance(val) && get_object(val))
prot = iface_to_jsdisp(get_object(val));
jsval_release(val);
}
......
......@@ -1864,6 +1864,21 @@ ok(tmp === "VT_DISPATCH", "getVT(Object(nullDisp) = " + tmp);
tmp = Object(nullDisp).toString();
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 nosemicolon() {} nosemicolon();
function () {} nosemicolon();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment