Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 49053dbcb7514ac44831e38fe227ef6362f5f8c3..e542e4de3f46394a8cfdd6bff9c92a3fb669e7a7 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -775,7 +775,8 @@ BUILTIN(ArraySlice) { |
// Set the ElementsKind. |
ElementsKind elements_kind = JSObject::cast(receiver)->GetElementsKind(); |
- if (result_array->GetElementsKind() != elements_kind) { |
+ if (IsMoreGeneralElementsKindTransition(result_array->GetElementsKind(), |
+ elements_kind)) { |
MaybeObject* maybe = result_array->TransitionElementsKind(elements_kind); |
if (maybe->IsFailure()) return maybe; |
} |
@@ -875,7 +876,8 @@ BUILTIN(ArraySplice) { |
// Set the ElementsKind. |
ElementsKind elements_kind = array->GetElementsKind(); |
- if (result_array->GetElementsKind() != elements_kind) { |
+ if (IsMoreGeneralElementsKindTransition(result_array->GetElementsKind(), |
+ elements_kind)) { |
MaybeObject* maybe = result_array->TransitionElementsKind(elements_kind); |
if (maybe->IsFailure()) return maybe; |
} |