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

Unified Diff: src/builtins.cc

Issue 1972613002: Support subclassing API functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/api-natives.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index ed07d5d089101311f1f90c61b396e6ba61de64ca..3c19810bdc112a7779c0c9997cd7c6d030cae975 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -4571,9 +4571,11 @@ MUST_USE_RESULT MaybeHandle<Object> HandleApiCallHelper(
}
Handle<ObjectTemplateInfo> instance_template(
ObjectTemplateInfo::cast(fun_data->instance_template()), isolate);
- ASSIGN_RETURN_ON_EXCEPTION(isolate, receiver,
- ApiNatives::InstantiateObject(instance_template),
- Object);
+ ASSIGN_RETURN_ON_EXCEPTION(
+ isolate, receiver,
+ ApiNatives::InstantiateObject(instance_template,
+ Handle<JSReceiver>::cast(new_target)),
+ Object);
args[0] = *receiver;
DCHECK_EQ(*receiver, *args.receiver());
} else {
« no previous file with comments | « src/api-natives.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698