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:
parent
eb43d59e8e
commit
ba1f47a770
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue