Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 0f753ff2f410ea0463a7b608af4d990421ef7466..1100adb3fc98d2bee567ea5ed65e78ed7d96d219 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -4131,7 +4131,7 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it, |
LanguageMode language_mode, |
StoreFromKeyed store_mode, |
bool* found) { |
- it->UpdateProtector(); |
+ DCHECK(it->IsFound()); |
ShouldThrow should_throw = |
is_sloppy(language_mode) ? DONT_THROW : THROW_ON_ERROR; |
@@ -4139,7 +4139,7 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it, |
// interceptor calls. |
AssertNoContextChange ncc(it->isolate()); |
- for (; it->IsFound(); it->Next()) { |
+ do { |
switch (it->state()) { |
case LookupIterator::NOT_FOUND: |
UNREACHABLE(); |
@@ -4202,7 +4202,8 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it, |
*found = false; |
return Nothing<bool>(); |
} |
- } |
+ it->Next(); |
+ } while (it->IsFound()); |
*found = false; |
return Nothing<bool>(); |
@@ -4212,10 +4213,13 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it, |
Maybe<bool> Object::SetProperty(LookupIterator* it, Handle<Object> value, |
LanguageMode language_mode, |
StoreFromKeyed store_mode) { |
- bool found = true; |
- Maybe<bool> result = |
- SetPropertyInternal(it, value, language_mode, store_mode, &found); |
- if (found) return result; |
+ it->UpdateProtector(); |
+ if (it->IsFound()) { |
+ bool found = true; |
+ Maybe<bool> result = |
+ SetPropertyInternal(it, value, language_mode, store_mode, &found); |
+ if (found) return result; |
+ } |
// If the receiver is the JSGlobalObject, the store was contextual. In case |
// the property did not exist yet on the global object itself, we have to |
@@ -4237,10 +4241,13 @@ Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value, |
StoreFromKeyed store_mode) { |
Isolate* isolate = it->isolate(); |
- bool found = true; |
- Maybe<bool> result = |
- SetPropertyInternal(it, value, language_mode, store_mode, &found); |
- if (found) return result; |
+ it->UpdateProtector(); |
+ if (it->IsFound()) { |
+ bool found = true; |
+ Maybe<bool> result = |
+ SetPropertyInternal(it, value, language_mode, store_mode, &found); |
+ if (found) return result; |
+ } |
// The property either doesn't exist on the holder or exists there as a data |
// property. |
@@ -4315,8 +4322,7 @@ Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value, |
} |
} |
- return JSObject::AddDataProperty(&own_lookup, value, NONE, should_throw, |
- store_mode); |
+ return AddDataProperty(&own_lookup, value, NONE, should_throw, store_mode); |
} |
MaybeHandle<Object> Object::ReadAbsentProperty(LookupIterator* it) { |