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

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: tweaks 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index db65d5befbae7f779c1ef370fb3fa56bea3b7939..9418377c5ad059ee6b0088ab5eb7976670ac3a77 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3414,6 +3414,15 @@ MaybeObject* JSObject::PreventExtensions() {
return JSObject::cast(proto)->PreventExtensions();
}
+ // It's not possible to seal objects with external array elements
+ if (HasExternalArrayElements()) {
+ Handle<Object> args[1] = { args[0] };
+ Handle<Object> error =
+ isolate->factory()->NewTypeError("seal_external_array_elements",
+ HandleVector(args, 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') | test/mjsunit/regress/regress-95920.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698