Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: src/objects.cc

Issue 7858031: Don't allow seal or element property definition on external arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/messages.js ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698