jscript: Use default object prototype if it's null.

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:
Gabriel Ivăncescu 2021-03-11 18:01:09 +02:00 committed by Alexandre Julliard
parent eb43d59e8e
commit ba1f47a770
2 changed files with 11 additions and 0 deletions

View file

@ -1855,6 +1855,9 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built
if(is_object_instance(val) && get_object(val))
prot = iface_to_jsdisp(get_object(val));
else
prot = ctx->object_prototype;
jsval_release(val);
}

View file

@ -1878,6 +1878,14 @@ testNullPrototype.prototype = nullDisp;
tmp = new testNullPrototype();
ok(tmp.x === 13, "tmp.x !== 13");
ok(!("y" in tmp), "tmp has 'y' property");
ok(!tmp.hasOwnProperty("y"), "tmp has 'y' property");
ok(!tmp.propertyIsEnumerable("y"), "tmp has 'y' property enumerable");
ok(tmp.toString() == "[object Object]", "tmp.toString returned " + tmp.toString());
testNullPrototype.prototype = null;
tmp = new testNullPrototype();
ok(!tmp.hasOwnProperty("y"), "tmp has 'y' property");
ok(!tmp.propertyIsEnumerable("y"), "tmp has 'y' property enumerable");
ok(tmp.toString() == "[object Object]", "tmp.toString returned " + tmp.toString());
function do_test() {}
function nosemicolon() {} nosemicolon();