Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: src/objects.cc

Issue 1420413002: Assume that ReportFailedAccessCheck always schedules an exception. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 433dda7d6f98daa1aac991c04413c4d3d4501bc8..2bc2299ed79ef09c531ebc7d86a79188e0cb504c 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1011,7 +1011,8 @@ MaybeHandle<Object> JSObject::GetPropertyWithFailedAccessCheck(
it->isolate()->ReportFailedAccessCheck(checked);
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(it->isolate(), Object);
- return it->factory()->undefined_value();
+ UNREACHABLE();
+ return MaybeHandle<Object>();
}
@@ -1030,7 +1031,8 @@ Maybe<PropertyAttributes> JSObject::GetPropertyAttributesWithFailedAccessCheck(
it->isolate()->ReportFailedAccessCheck(checked);
RETURN_VALUE_IF_SCHEDULED_EXCEPTION(it->isolate(),
Nothing<PropertyAttributes>());
- return Just(ABSENT);
+ UNREACHABLE();
+ return Nothing<PropertyAttributes>();
}
@@ -1059,8 +1061,6 @@ Maybe<bool> JSObject::SetPropertyWithFailedAccessCheck(
it->isolate()->ReportFailedAccessCheck(checked);
RETURN_VALUE_IF_SCHEDULED_EXCEPTION(it->isolate(), Nothing<bool>());
UNREACHABLE();
- it->isolate()->Throw(
- *it->isolate()->factory()->NewTypeError(MessageTemplate::kNoAccess));
return Nothing<bool>();
}
@@ -4792,7 +4792,7 @@ MaybeHandle<Object> JSObject::DefineOwnPropertyIgnoreAttributes(
if (!it->HasAccess()) {
it->isolate()->ReportFailedAccessCheck(it->GetHolder<JSObject>());
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(it->isolate(), Object);
- return value;
+ UNREACHABLE();
}
break;
@@ -5821,7 +5821,7 @@ MaybeHandle<Object> JSReceiver::DeleteProperty(LookupIterator* it,
if (it->HasAccess()) break;
isolate->ReportFailedAccessCheck(it->GetHolder<JSObject>());
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
- return it->factory()->false_value();
+ UNREACHABLE();
case LookupIterator::INTERCEPTOR: {
MaybeHandle<Object> maybe_result =
JSObject::DeletePropertyWithInterceptor(it);
@@ -6782,8 +6782,6 @@ Maybe<bool> JSObject::PreventExtensions(Handle<JSObject> object,
isolate->ReportFailedAccessCheck(object);
RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>());
UNREACHABLE();
- RETURN_FAILURE(isolate, should_throw,
- NewTypeError(MessageTemplate::kNoAccess));
}
if (object->IsJSGlobalProxy()) {
@@ -6883,8 +6881,6 @@ Maybe<bool> JSObject::PreventExtensionsWithTransition(
isolate->ReportFailedAccessCheck(object);
RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>());
UNREACHABLE();
- RETURN_FAILURE(isolate, should_throw,
- NewTypeError(MessageTemplate::kNoAccess));
}
if (object->IsJSGlobalProxy()) {
@@ -7778,6 +7774,7 @@ MaybeHandle<FixedArray> JSReceiver::GetKeys(Handle<JSReceiver> object,
if (iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)) {
isolate->ReportFailedAccessCheck(current);
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, FixedArray);
+ UNREACHABLE();
}
break;
}
@@ -7890,7 +7887,7 @@ MaybeHandle<Object> JSObject::DefineAccessor(LookupIterator* it,
if (!it->HasAccess()) {
isolate->ReportFailedAccessCheck(it->GetHolder<JSObject>());
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
- return isolate->factory()->undefined_value();
+ UNREACHABLE();
}
it->Next();
}
@@ -7955,7 +7952,7 @@ MaybeHandle<Object> JSObject::SetAccessor(Handle<JSObject> object,
if (!it.HasAccess()) {
isolate->ReportFailedAccessCheck(object);
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
- return it.factory()->undefined_value();
+ UNREACHABLE();
}
it.Next();
}
@@ -8002,7 +7999,7 @@ MaybeHandle<Object> JSObject::GetAccessor(Handle<JSObject> object,
if (it.HasAccess()) continue;
isolate->ReportFailedAccessCheck(it.GetHolder<JSObject>());
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
- return isolate->factory()->undefined_value();
+ UNREACHABLE();
case LookupIterator::JSPROXY:
return isolate->factory()->undefined_value();
« no previous file with comments | « src/builtins.cc ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698