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

Unified Diff: src/parser.h

Issue 1468143004: [es6] Self-assignment in a default parameter initializer should throw (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Change less behavior, add TODO 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/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 6c641721861146f7d53c9f9f31f322802276e6e6..b86becb1751b9ce35eba0ba71877d859e0db5bcd 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -551,12 +551,17 @@ class SingletonLogger;
struct ParserFormalParameters : FormalParametersBase {
struct Parameter {
Parameter(const AstRawString* name, Expression* pattern,
- Expression* initializer, bool is_rest)
- : name(name), pattern(pattern), initializer(initializer),
+ Expression* initializer, int initializer_end_position,
+ bool is_rest)
+ : name(name),
+ pattern(pattern),
+ initializer(initializer),
+ initializer_end_position(initializer_end_position),
is_rest(is_rest) {}
const AstRawString* name;
Expression* pattern;
Expression* initializer;
+ int initializer_end_position;
bool is_rest;
bool is_simple() const {
return pattern->IsVariableProxy() && initializer == nullptr && !is_rest;
@@ -793,9 +798,10 @@ class ParserTraits {
V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type,
FunctionKind kind = kNormalFunction);
- V8_INLINE void AddFormalParameter(
- ParserFormalParameters* parameters, Expression* pattern,
- Expression* initializer, bool is_rest);
+ V8_INLINE void AddFormalParameter(ParserFormalParameters* parameters,
+ Expression* pattern,
+ Expression* initializer,
+ int initializer_end_position, bool is_rest);
V8_INLINE void DeclareFormalParameter(
Scope* scope, const ParserFormalParameters::Parameter& parameter,
ExpressionClassifier* classifier);
@@ -1338,9 +1344,11 @@ Expression* ParserTraits::SpreadCallNew(
}
-void ParserTraits::AddFormalParameter(
- ParserFormalParameters* parameters,
- Expression* pattern, Expression* initializer, bool is_rest) {
+void ParserTraits::AddFormalParameter(ParserFormalParameters* parameters,
+ Expression* pattern,
+ Expression* initializer,
+ int initializer_end_position,
+ bool is_rest) {
bool is_simple =
!is_rest && pattern->IsVariableProxy() && initializer == nullptr;
DCHECK(parser_->allow_harmony_destructuring_bind() ||
@@ -1350,7 +1358,8 @@ void ParserTraits::AddFormalParameter(
? pattern->AsVariableProxy()->raw_name()
: parser_->ast_value_factory()->empty_string();
parameters->params.Add(
- ParserFormalParameters::Parameter(name, pattern, initializer, is_rest),
+ ParserFormalParameters::Parameter(name, pattern, initializer,
+ initializer_end_position, is_rest),
parameters->scope->zone());
}
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698