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

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

Issue 1752133004: [proxies] throw TypeError in [[Call]] if is_callable Map bit is unset (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
Index: src/runtime/runtime-proxy.cc
diff --git a/src/runtime/runtime-proxy.cc b/src/runtime/runtime-proxy.cc
index 7764d25c5823d24ff880b32ad47a29d90877ee33..b7e13f180bcd21165b6ca17bfa03aabec6049155 100644
--- a/src/runtime/runtime-proxy.cc
+++ b/src/runtime/runtime-proxy.cc
@@ -21,6 +21,14 @@ RUNTIME_FUNCTION(Runtime_JSProxyCall) {
// thisArgument == receiver
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0);
CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, args.length() - 1);
+
+ if (V8_UNLIKELY(!proxy->target()->IsCallable())) {
+ // TODO(caitp): Remove when handled in compiler/backends/builtins
+ Handle<String> callsite = Runtime::RenderCallSite(isolate, proxy);
+ THROW_NEW_ERROR_RETURN_FAILURE(
+ isolate, NewTypeError(MessageTemplate::kCalledNonCallable, callsite));
Camillo Bruni 2016/03/02 17:41:03 Would you mind fixing it directly in PLATFORM/buil
caitp (gmail) 2016/03/02 18:26:57 Done, with ports for ia32, x64, arm and arm64
+ }
+
Handle<String> trap_name = isolate->factory()->apply_string();
// 1. Let handler be the value of the [[ProxyHandler]] internal slot of O.
Handle<Object> handler(proxy->handler(), isolate);

Powered by Google App Engine
This is Rietveld 408576698