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

Unified Diff: src/objects.cc

Issue 8951013: Remove bogus writability check in DefineGetterSetter. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years 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 | 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 2b6f2352ae647b5a2eec0b7461caa3aeab50b8a2..fac8b5bd876c662e02680aa53e81bd9a721581c9 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4257,10 +4257,9 @@ void JSObject::LookupCallback(String* name, LookupResult* result) {
// Search for a getter or setter in an elements dictionary and update its
-// attributes. Returns either undefined if the element is read-only, or the
-// getter/setter pair (fixed array) if there is an existing one, or the hole
-// value if the element does not exist or is a normal non-getter/setter data
-// element.
+// attributes. Returns either the getter/setter pair (fixed array) if there
+// is an existing one, or the hole value if the element does not exist or is
+// a normal non-getter/setter data element.
static Object* UpdateGetterSetterInDictionary(NumberDictionary* dictionary,
uint32_t index,
PropertyAttributes attributes,
@@ -4269,7 +4268,6 @@ static Object* UpdateGetterSetterInDictionary(NumberDictionary* dictionary,
if (entry != NumberDictionary::kNotFound) {
Object* result = dictionary->ValueAt(entry);
PropertyDetails details = dictionary->DetailsAt(entry);
- if (details.IsReadOnly()) return heap->undefined_value();
rossberg 2011/12/16 12:03:36 IsReadOnly clearly is the wrong check here. But I
Michael Starzinger 2011/12/16 12:38:02 Done. As discussed offline: The correct check here
if (details.type() == CALLBACKS && result->IsFixedArray()) {
if (details.attributes() != attributes) {
dictionary->DetailsAtPut(entry,
@@ -4353,7 +4351,6 @@ MaybeObject* JSObject::DefineGetterSetter(String* name,
LookupResult result(heap->isolate());
LocalLookup(name, &result);
if (result.IsProperty()) {
- if (result.IsReadOnly()) return heap->undefined_value();
if (result.type() == CALLBACKS) {
Object* obj = result.GetCallbackObject();
// Need to preserve old getters/setters.
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698