Index: src/elements.cc |
diff --git a/src/elements.cc b/src/elements.cc |
index 39686a2eabfa579499bdd04fd8f06cb68415e1c0..6afbcc0ee3c994d6055e0f5b6a12ad3dae1e28ed 100644 |
--- a/src/elements.cc |
+++ b/src/elements.cc |
@@ -1336,30 +1336,29 @@ class DictionaryElementsAccessor |
int entry = dictionary->FindEntry(key); |
if (entry != SeededNumberDictionary::kNotFound) { |
Object* result = dictionary->DeleteProperty(entry, mode); |
- if (result == heap->true_value()) { |
- MaybeObject* maybe_elements = dictionary->Shrink(key); |
- FixedArray* new_elements = NULL; |
- if (!maybe_elements->To(&new_elements)) { |
- return maybe_elements; |
- } |
- if (is_arguments) { |
- FixedArray::cast(obj->elements())->set(1, new_elements); |
- } else { |
- obj->set_elements(new_elements); |
+ if (result == heap->false_value()) { |
+ if (mode == JSObject::STRICT_DELETION) { |
+ // Deleting a non-configurable property in strict mode. |
+ HandleScope scope(isolate); |
+ Handle<Object> holder(obj); |
+ Handle<Object> name = isolate->factory()->NewNumberFromUint(key); |
+ Handle<Object> args[2] = { name, holder }; |
+ Handle<Object> error = |
+ isolate->factory()->NewTypeError("strict_delete_property", |
+ HandleVector(args, 2)); |
+ return isolate->Throw(*error); |
} |
+ return heap->false_value(); |
} |
- if (mode == JSObject::STRICT_DELETION && |
- result == heap->false_value()) { |
- // In strict mode, attempting to delete a non-configurable property |
- // throws an exception. |
- HandleScope scope(isolate); |
- Handle<Object> holder(obj); |
- Handle<Object> name = isolate->factory()->NewNumberFromUint(key); |
- Handle<Object> args[2] = { name, holder }; |
- Handle<Object> error = |
- isolate->factory()->NewTypeError("strict_delete_property", |
- HandleVector(args, 2)); |
- return isolate->Throw(*error); |
+ MaybeObject* maybe_elements = dictionary->Shrink(key); |
+ FixedArray* new_elements = NULL; |
+ if (!maybe_elements->To(&new_elements)) { |
+ return maybe_elements; |
+ } |
+ if (is_arguments) { |
+ FixedArray::cast(obj->elements())->set(1, new_elements); |
+ } else { |
+ obj->set_elements(new_elements); |
} |
} |
return heap->true_value(); |