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

Unified Diff: src/factory.cc

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: ia32, arm and arm64 ports. Misc cleanups. Created 5 years, 4 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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 19939659649330ede03c94a3210c667a45e839bd..5a77390c8bb4e1529ab11c53cf85c122f6a4d77c 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1881,7 +1881,7 @@ Handle<JSProxy> Factory::NewJSProxy(Handle<Object> handler,
Handle<JSProxy> Factory::NewJSFunctionProxy(Handle<Object> handler,
- Handle<Object> call_trap,
+ Handle<JSReceiver> call_trap,
Handle<Object> construct_trap,
Handle<Object> prototype) {
// Allocate map.
@@ -1889,6 +1889,7 @@ Handle<JSProxy> Factory::NewJSFunctionProxy(Handle<Object> handler,
// maps. Will probably depend on the identity of the handler object, too.
Handle<Map> map = NewMap(JS_FUNCTION_PROXY_TYPE, JSFunctionProxy::kSize);
Map::SetPrototype(map, prototype);
+ map->set_is_callable();
// Allocate the proxy object.
Handle<JSFunctionProxy> result = New<JSFunctionProxy>(map, NEW_SPACE);
@@ -1951,6 +1952,7 @@ void Factory::ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type,
// Functions require some minimal initialization.
if (type == JS_FUNCTION_TYPE) {
map->set_function_with_prototype(true);
+ map->set_is_callable();
Handle<JSFunction> js_function = Handle<JSFunction>::cast(proxy);
InitializeFunction(js_function, shared.ToHandleChecked(), context);
} else {

Powered by Google App Engine
This is Rietveld 408576698