Index: src/runtime/runtime-array.cc |
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc |
index 125b87b9e76886e96ea70ec2a056acf476001c6f..f651ed40e122d6810f1607214bb2ceabaa940d7b 100644 |
--- a/src/runtime/runtime-array.cc |
+++ b/src/runtime/runtime-array.cc |
@@ -120,9 +120,11 @@ RUNTIME_FUNCTION(Runtime_PushIfAbsent) { |
RUNTIME_FUNCTION(Runtime_RemoveArrayHoles) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 2); |
- CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0); |
CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]); |
- return *JSObject::PrepareElementsForSort(object, limit); |
+ if (object->IsJSProxy()) return Smi::FromInt(-1); |
+ return *JSObject::PrepareElementsForSort(Handle<JSObject>::cast(object), |
+ limit); |
} |