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

Unified Diff: src/objects.cc

Issue 1188383002: Work In Progress: support new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/compiler.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 54762699e16f9bdbb592cde7a793f676c21e7657..1062b7f9e334306af3902761ce1e0af6d2fb09d2 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -10535,7 +10535,8 @@ void SharedFunctionInfo::DisableOptimization(BailoutReason reason) {
void SharedFunctionInfo::InitFromFunctionLiteral(
Handle<SharedFunctionInfo> shared_info, FunctionLiteral* lit) {
shared_info->set_length(lit->scope()->default_function_length());
- if (IsSubclassConstructor(lit->kind())) {
+ if (IsSubclassConstructor(lit->kind()) ||
+ lit->scope()->new_target_var() != nullptr) {
shared_info->set_internal_formal_parameter_count(lit->parameter_count() +
1);
} else {
« no previous file with comments | « src/compiler.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698