Index: src/runtime.cc |
=================================================================== |
--- src/runtime.cc (revision 3786) |
+++ src/runtime.cc (working copy) |
@@ -2906,10 +2906,11 @@ |
// If an existing property is either FIELD, NORMAL or CONSTANT_FUNCTION |
// delete it to avoid running into trouble in DefineAccessor, which |
// handles this incorrectly if the property is readonly (does nothing) |
- if (result.type() == FIELD || result.type() == NORMAL |
- || result.type() == CONSTANT_FUNCTION) |
+ if (result.IsValid() && |
+ (result.type() == FIELD || result.type() == NORMAL |
+ || result.type() == CONSTANT_FUNCTION)) { |
obj->DeleteProperty(name, JSObject::NORMAL_DELETION); |
- |
+ } |
return obj->DefineAccessor(name, flag_setter->value() == 0, fun, attr); |
} |