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

Unified Diff: src/objects.cc

Issue 608014: Normalize the object before updating getter/setter info. (Closed)
Patch Set: Last round Created 10 years, 10 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 | « no previous file | test/mjsunit/regress/regress-612.js » ('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 6d86532db578f984a57a100b13371fef2d5a320c..452705744a66e51d43d040731cb7cb6ea8da174c 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2840,6 +2840,11 @@ Object* JSObject::DefineGetterSetter(String* name,
if (result.type() == CALLBACKS) {
Object* obj = result.GetCallbackObject();
if (obj->IsFixedArray()) {
+ // The object might be in fast mode even though it has
+ // a getter/setter.
+ Object* ok = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+ if (ok->IsFailure()) return ok;
+
PropertyDetails details = PropertyDetails(attributes, CALLBACKS);
SetNormalizedProperty(name, obj, details);
return obj;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-612.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698