| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index a3e868ab3c183257d4129913100c9ef99925ec1f..d565cbb8ea1a01b8aa7d6d5199394c7609342848 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -4238,16 +4238,12 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
|
| Maybe<bool> Object::SetProperty(LookupIterator* it, Handle<Object> value,
|
| LanguageMode language_mode,
|
| StoreFromKeyed store_mode) {
|
| - ShouldThrow should_throw =
|
| - is_sloppy(language_mode) ? DONT_THROW : THROW_ON_ERROR;
|
| - if (it->GetReceiver()->IsJSProxy() && it->GetName()->IsPrivate()) {
|
| - RETURN_FAILURE(it->isolate(), should_throw,
|
| - NewTypeError(MessageTemplate::kProxyPrivate));
|
| - }
|
| bool found = false;
|
| Maybe<bool> result =
|
| SetPropertyInternal(it, value, language_mode, store_mode, &found);
|
| if (found) return result;
|
| + ShouldThrow should_throw =
|
| + is_sloppy(language_mode) ? DONT_THROW : THROW_ON_ERROR;
|
| return AddDataProperty(it, value, NONE, should_throw, store_mode);
|
| }
|
|
|
| @@ -4255,13 +4251,7 @@ Maybe<bool> Object::SetProperty(LookupIterator* it, Handle<Object> value,
|
| Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value,
|
| LanguageMode language_mode,
|
| StoreFromKeyed store_mode) {
|
| - ShouldThrow should_throw =
|
| - is_sloppy(language_mode) ? DONT_THROW : THROW_ON_ERROR;
|
| Isolate* isolate = it->isolate();
|
| - if (it->GetReceiver()->IsJSProxy() && it->GetName()->IsPrivate()) {
|
| - RETURN_FAILURE(isolate, should_throw,
|
| - NewTypeError(MessageTemplate::kProxyPrivate));
|
| - }
|
|
|
| bool found = false;
|
| Maybe<bool> result =
|
| @@ -4271,6 +4261,9 @@ Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value,
|
| // The property either doesn't exist on the holder or exists there as a data
|
| // property.
|
|
|
| + ShouldThrow should_throw =
|
| + is_sloppy(language_mode) ? DONT_THROW : THROW_ON_ERROR;
|
| +
|
| if (!it->GetReceiver()->IsJSReceiver()) {
|
| return WriteToReadOnlyProperty(it, value, should_throw);
|
| }
|
| @@ -4486,8 +4479,11 @@ Maybe<bool> Object::AddDataProperty(LookupIterator* it, Handle<Object> value,
|
| PropertyAttributes attributes,
|
| ShouldThrow should_throw,
|
| StoreFromKeyed store_mode) {
|
| - DCHECK(!it->GetReceiver()->IsJSProxy());
|
| if (!it->GetReceiver()->IsJSObject()) {
|
| + if (it->GetReceiver()->IsJSProxy() && it->GetName()->IsPrivate()) {
|
| + RETURN_FAILURE(it->isolate(), should_throw,
|
| + NewTypeError(MessageTemplate::kProxyPrivate));
|
| + }
|
| return CannotCreateProperty(it->isolate(), it->GetReceiver(), it->GetName(),
|
| value, should_throw);
|
| }
|
| @@ -6164,7 +6160,7 @@ Maybe<bool> JSReceiver::DeleteProperty(LookupIterator* it,
|
| if (it->GetReceiver()->IsJSProxy()) {
|
| if (it->state() != LookupIterator::NOT_FOUND) {
|
| DCHECK_EQ(LookupIterator::DATA, it->state());
|
| - DCHECK(it->GetName()->IsPrivate());
|
| + DCHECK(it->name()->IsPrivate());
|
| it->Delete();
|
| }
|
| return Just(true);
|
|
|