Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 44ab519ce3668c32c443e18ba1af7dec19a95523..abc71b321f904515d9dccf6c9dec54b0b0956575 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -4293,6 +4293,17 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineDataProperty) { |
if (proto->IsNull()) return *obj_value; |
js_object = Handle<JSObject>::cast(proto); |
} |
+ |
+ // Don't allow element properties to be redefined on objects with external |
+ // array elements. |
+ if (js_object->HasExternalArrayElements()) { |
+ Handle<Object> args[2] = { js_object, name }; |
+ Handle<Object> error = |
+ isolate->factory()->NewTypeError("redef_external_array_element", |
+ HandleVector(args, 2)); |
+ return isolate->Throw(*error); |
+ } |
+ |
Handle<NumberDictionary> dictionary = NormalizeElements(js_object); |
// Make sure that we never go back to fast case. |
dictionary->set_requires_slow_elements(); |