Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 53097424115cb67f8a253939561c2f51e258febf..7bec18cdc146251d618e5025a6a74a185876c600 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -1050,10 +1050,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()); |
} |