Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index db65d5befbae7f779c1ef370fb3fa56bea3b7939..c77a432ba83ebed071904eddda8a78e072fd2044 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3414,6 +3414,17 @@ MaybeObject* JSObject::PreventExtensions() { |
return JSObject::cast(proto)->PreventExtensions(); |
} |
+ // It's not possible to seal objects with external array elements |
+ if (HasExternalArrayElements()) { |
+ HandleScope scope(isolate); |
+ Handle<Object> object(this); |
+ Handle<Object> error = |
+ isolate->factory()->NewTypeError( |
+ "cant_prevent_ext_external_array_elements", |
+ HandleVector(&object, 1)); |
+ return isolate->Throw(*error); |
+ } |
+ |
// If there are fast elements we normalize. |
NumberDictionary* dictionary = NULL; |
{ MaybeObject* maybe = NormalizeElements(); |