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

Unified Diff: src/runtime.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/objects.cc ('k') | test/mjsunit/regress/regress-95920.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/regress/regress-95920.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698