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

Unified Diff: src/api-natives.cc

Issue 1467473002: Install ConstructNonConstructable as construct stub for non-constructables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | src/bootstrapper.cc » ('j') | src/builtins.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api-natives.cc
diff --git a/src/api-natives.cc b/src/api-natives.cc
index d8dd1510417641197da707cf27f79e51586886d3..66be92c3fa2121b458bb9f1ee48a519fa6898263 100644
--- a/src/api-natives.cc
+++ b/src/api-natives.cc
@@ -439,7 +439,9 @@ Handle<JSFunction> ApiNatives::CreateApiFunction(
Isolate* isolate, Handle<FunctionTemplateInfo> obj,
Handle<Object> prototype, ApiInstanceType instance_type) {
Handle<Code> code = isolate->builtins()->HandleApiCall();
- Handle<Code> construct_stub = isolate->builtins()->JSConstructStubApi();
+ Handle<Code> construct_stub =
+ prototype.is_null() ? isolate->builtins()->ConstructedNonConstructable()
+ : isolate->builtins()->JSConstructStubApi();
obj->set_instantiated(true);
Handle<JSFunction> result;
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/builtins.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698