Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index eef2e6616a6d3ab96b576cc847904e674813b83e..1ba2a5522521ccdb45897c670a0d15d8954bdf55 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -1052,10 +1052,11 @@ RUNTIME_FUNCTION(Runtime_Compare) { |
RUNTIME_FUNCTION(Runtime_HasInPrototypeChain) { |
HandleScope scope(isolate); |
DCHECK_EQ(2, args.length()); |
- CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
- Maybe<bool> result = |
- JSReceiver::HasInPrototypeChain(isolate, object, prototype); |
+ if (!object->IsJSReceiver()) return isolate->heap()->false_value(); |
+ Maybe<bool> result = JSReceiver::HasInPrototypeChain( |
+ isolate, Handle<JSReceiver>::cast(object), prototype); |
MAYBE_RETURN(result, isolate->heap()->exception()); |
return isolate->heap()->ToBoolean(result.FromJust()); |
} |