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

Unified Diff: src/runtime/runtime-proxy.cc

Issue 1486553002: [proxies] Use IsRevoked where possible, remove has_handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 5 years, 1 month 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/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-proxy.cc
diff --git a/src/runtime/runtime-proxy.cc b/src/runtime/runtime-proxy.cc
index 2183c88cb8116df0df047765cd87ad47692cbfd2..72517195d925f1d84c8d242559aa9d19d7ab688f 100644
--- a/src/runtime/runtime-proxy.cc
+++ b/src/runtime/runtime-proxy.cc
@@ -20,19 +20,14 @@ RUNTIME_FUNCTION(Runtime_CreateJSProxy) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kProxyTargetNonObject));
}
- if (target->IsJSProxy() && !JSProxy::cast(*target)->has_handler()) {
- // TODO(cbruni): Use better error message.
- THROW_NEW_ERROR_RETURN_FAILURE(
- isolate, NewTypeError(MessageTemplate::kProxyTargetNonObject));
- }
if (!handler->IsSpecObject()) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kProxyHandlerNonObject));
}
- if (handler->IsJSProxy() && !JSProxy::cast(*handler)->has_handler()) {
- // TODO(cbruni): Use better error message.
+ if ((target->IsJSProxy() && JSProxy::cast(*target)->IsRevoked()) ||
+ (handler->IsJSProxy() && JSProxy::cast(*handler)->IsRevoked())) {
THROW_NEW_ERROR_RETURN_FAILURE(
- isolate, NewTypeError(MessageTemplate::kProxyHandlerNonObject));
+ isolate, NewTypeError(MessageTemplate::kProxyHandlerOrTargetRevoked));
}
return *isolate->factory()->NewJSProxy(Handle<JSReceiver>::cast(target),
Handle<JSReceiver>::cast(handler));
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698