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

Unified Diff: src/ast.cc

Issue 1083193005: WIP: new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix return from new func Created 5 years, 8 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/ast.h ('k') | src/ast-numbering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 5038716003e80125c1ff1fd1b3709443a0a3ea63..fbf6c775d4bd722d54fcee523687ec8dbd67fde7 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -63,6 +63,7 @@ VariableProxy::VariableProxy(Zone* zone, Variable* var, int start_position,
int end_position)
: Expression(zone, start_position),
bit_field_(IsThisField::encode(var->is_this()) |
+ IsNewTargetField::encode(var->is_new_target()) |
IsAssignedField::encode(false) |
IsResolvedField::encode(false)),
variable_feedback_slot_(FeedbackVectorICSlot::Invalid()),
@@ -76,16 +77,18 @@ VariableProxy::VariableProxy(Zone* zone, const AstRawString* name,
Variable::Kind variable_kind, int start_position,
int end_position)
: Expression(zone, start_position),
- bit_field_(IsThisField::encode(variable_kind == Variable::THIS) |
- IsAssignedField::encode(false) |
- IsResolvedField::encode(false)),
+ bit_field_(
+ IsThisField::encode(variable_kind == Variable::THIS) |
+ IsNewTargetField::encode(variable_kind == Variable::NEW_TARGET) |
+ IsAssignedField::encode(false) | IsResolvedField::encode(false)),
variable_feedback_slot_(FeedbackVectorICSlot::Invalid()),
raw_name_(name),
end_position_(end_position) {}
void VariableProxy::BindTo(Variable* var) {
- DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name());
+ DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name() ||
+ is_new_target() && var->is_new_target());
set_var(var);
set_is_resolved();
var->set_is_used();
« no previous file with comments | « src/ast.h ('k') | src/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698