jscript: Handle non-JS objects in Object.getPrototypeOf.
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
b4175eebc0
commit
f858318384
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue