Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 5eefd27fbbd8a4ade93285de1b8797da58ccb73f..aed6030b6d4441e40e0a4a08853a5eb5e6e3d9ee 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -420,6 +420,10 @@ BUILTIN(ArrayPop) { |
int len = Smi::cast(array->length())->value(); |
if (len == 0) return isolate->heap()->undefined_value(); |
+ if (JSArray::HasReadOnlyLength(array)) { |
+ return CallJsBuiltin(isolate, "ArrayPop", args); |
+ } |
+ |
ElementsAccessor* accessor = array->GetElementsAccessor(); |
int new_length = len - 1; |
Handle<Object> element = |
@@ -451,6 +455,10 @@ BUILTIN(ArrayShift) { |
int len = Smi::cast(array->length())->value(); |
if (len == 0) return heap->undefined_value(); |
+ if (JSArray::HasReadOnlyLength(array)) { |
+ return CallJsBuiltin(isolate, "ArrayShift", args); |
+ } |
+ |
// Get first element |
ElementsAccessor* accessor = array->GetElementsAccessor(); |
Handle<Object> first = |
@@ -756,6 +764,11 @@ BUILTIN(ArraySplice) { |
return CallJsBuiltin(isolate, "ArraySplice", args); |
} |
+ if (new_length != len && JSArray::HasReadOnlyLength(array)) { |
+ AllowHeapAllocation allow_allocation; |
+ return CallJsBuiltin(isolate, "ArraySplice", args); |
+ } |
+ |
if (new_length == 0) { |
Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements( |
elms_obj, elements_kind, actual_delete_count); |