Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index ec8493ad37dfba0fb693db4e971c38ae890d20e6..03148ce18961498fb330b3336132db8caed66b92 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -14442,8 +14442,11 @@ MaybeObject* JSObject::PrepareSlowElementsForSort(uint32_t limit) { |
Handle<Object> JSObject::PrepareElementsForSort(Handle<JSObject> object, |
uint32_t limit) { |
Isolate* isolate = object->GetIsolate(); |
+ if (object->HasSloppyArgumentsElements() || |
+ object->map()->is_observed()) { |
+ return handle(Smi::FromInt(-1), isolate); |
+ } |
- ASSERT(!object->map()->is_observed()); |
if (object->HasDictionaryElements()) { |
// Convert to fast elements containing only the existing properties. |
// Ordering is irrelevant, since we are going to sort anyway. |