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

jscript: Handle non-JS objects in Object.getPrototypeOf.

parent b4175eeb
......@@ -850,13 +850,8 @@ static HRESULT Object_getPrototypeOf(script_ctx_t *ctx, jsval_t vthis, WORD flag
TRACE("(%s)\n", debugstr_jsval(argv[0]));
obj = to_jsdisp(get_object(argv[0]));
if(!obj) {
FIXME("Non-JS object\n");
return E_NOTIMPL;
}
if(r)
*r = obj->prototype
*r = obj && obj->prototype
? jsval_obj(jsdisp_addref(obj->prototype))
: jsval_null();
return S_OK;
......
......@@ -803,6 +803,8 @@ sync_test("getPrototypeOf", function() {
obj = Object.create(null);
ok(!("toString" in obj), "toString is in obj");
ok(Object.getPrototypeOf(obj) === null, "Object.getPrototypeOf(obj) = " + Object.getPrototypeOf(obj));
ok(Object.getPrototypeOf(external) === null, "Object.getPrototypeOf(non-JS obj) = " + Object.getPrototypeOf(external));
});
sync_test("toString", function() {
......
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