Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 6e93e58620d04564d04255dcef9571b17540b104..9ec690079dffefcb83e8d2c063b998dd82db0d93 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -4350,26 +4350,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineAccessorProperty) { |
RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0); |
PropertyAttributes attr = static_cast<PropertyAttributes>(unchecked); |
- // TODO(svenpanne) Define getter/setter/attributes in a single step. |
- if (getter->IsNull() && setter->IsNull()) { |
- JSArray* array; |
- { MaybeObject* maybe_array = GetOwnProperty(isolate, obj, name); |
- if (!maybe_array->To(&array)) return maybe_array; |
- } |
- Object* current = FixedArray::cast(array->elements())->get(GETTER_INDEX); |
- getter = Handle<Object>(current, isolate); |
- } |
- if (!getter->IsNull()) { |
- MaybeObject* ok = |
- obj->DefineAccessor(*name, ACCESSOR_GETTER, *getter, attr); |
- if (ok->IsFailure()) return ok; |
- } |
- if (!setter->IsNull()) { |
- MaybeObject* ok = |
- obj->DefineAccessor(*name, ACCESSOR_SETTER, *setter, attr); |
- if (ok->IsFailure()) return ok; |
- } |
- |
+ JSObject::DefineAccessor(obj, name, getter, setter, attr); |
+ JSObject::TransformToFastProperties(obj, 0); |
Michael Starzinger
2012/03/21 12:33:08
See first comment.
Sven Panne
2012/03/21 13:14:18
Done.
|
return isolate->heap()->undefined_value(); |
} |