| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index fe1a4336eea973a777f270b17cc292a9aad65821..86fcb9ae2410d064e3e8f258925aee005b9efa95 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -127,7 +127,7 @@ bool Object::IsPromise(Handle<Object> object) {
|
| }
|
|
|
|
|
| -MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
|
| +MaybeHandle<Object> Object::GetProperty(LookupIterator* it, Strength strength) {
|
| for (; it->IsFound(); it->Next()) {
|
| switch (it->state()) {
|
| case LookupIterator::NOT_FOUND:
|
| @@ -145,15 +145,27 @@ MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
|
| }
|
| case LookupIterator::ACCESS_CHECK:
|
| if (it->HasAccess()) break;
|
| - return JSObject::GetPropertyWithFailedAccessCheck(it);
|
| + return JSObject::GetPropertyWithFailedAccessCheck(it, strength);
|
| case LookupIterator::ACCESSOR:
|
| - return GetPropertyWithAccessor(it);
|
| + return GetPropertyWithAccessor(it, strength);
|
| case LookupIterator::INTEGER_INDEXED_EXOTIC:
|
| + if (is_strong(strength)) {
|
| + THROW_NEW_ERROR(it->isolate(),
|
| + NewTypeError(MessageTemplate::kStrongPropertyAccess,
|
| + it->GetReceiver(), it->GetName()),
|
| + Object);
|
| + }
|
| return it->factory()->undefined_value();
|
| case LookupIterator::DATA:
|
| return it->GetDataValue();
|
| }
|
| }
|
| + if (is_strong(strength)) {
|
| + THROW_NEW_ERROR(it->isolate(),
|
| + NewTypeError(MessageTemplate::kStrongPropertyAccess,
|
| + it->GetReceiver(), it->GetName()),
|
| + Object);
|
| + }
|
| return it->factory()->undefined_value();
|
| }
|
|
|
| @@ -302,7 +314,8 @@ MaybeHandle<Object> JSProxy::GetPropertyWithHandler(Handle<JSProxy> proxy,
|
| }
|
|
|
|
|
| -MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it) {
|
| +MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it,
|
| + Strength strength) {
|
| Isolate* isolate = it->isolate();
|
| Handle<Object> structure = it->GetAccessors();
|
| Handle<Object> receiver = it->GetReceiver();
|
| @@ -332,6 +345,12 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it) {
|
| args.Call(call_fun, v8::Utils::ToLocal(name));
|
| RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
|
| if (result.IsEmpty()) {
|
| + if (is_strong(strength)) {
|
| + THROW_NEW_ERROR(isolate,
|
| + NewTypeError(MessageTemplate::kStrongPropertyAccess,
|
| + receiver, name),
|
| + Object);
|
| + }
|
| return isolate->factory()->undefined_value();
|
| }
|
| Handle<Object> return_value = v8::Utils::OpenHandle(*result);
|
| @@ -349,6 +368,12 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it) {
|
| receiver, Handle<JSReceiver>::cast(getter));
|
| }
|
| // Getter is not a function.
|
| + if (is_strong(strength)) {
|
| + THROW_NEW_ERROR(isolate,
|
| + NewTypeError(MessageTemplate::kStrongPropertyAccess,
|
| + receiver, it->GetName()),
|
| + Object);
|
| + }
|
| return isolate->factory()->undefined_value();
|
| }
|
|
|
| @@ -487,11 +512,11 @@ static bool FindAllCanReadHolder(LookupIterator* it) {
|
|
|
|
|
| MaybeHandle<Object> JSObject::GetPropertyWithFailedAccessCheck(
|
| - LookupIterator* it) {
|
| + LookupIterator* it, Strength strength) {
|
| Handle<JSObject> checked = it->GetHolder<JSObject>();
|
| while (FindAllCanReadHolder(it)) {
|
| if (it->state() == LookupIterator::ACCESSOR) {
|
| - return GetPropertyWithAccessor(it);
|
| + return GetPropertyWithAccessor(it, strength);
|
| }
|
| DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state());
|
| auto result = GetPropertyWithInterceptor(it);
|
|
|