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

Side by Side Diff: src/parser.h

Issue 1303013007: [es6] Remaining cases of parameter scopes for sloppy eval (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/parser.cc » ('j') | src/parser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PARSER_H_ 5 #ifndef V8_PARSER_H_
6 #define V8_PARSER_H_ 6 #define V8_PARSER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/compiler.h" // TODO(titzer): remove this include dependency 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 struct ParserFormalParameters : FormalParametersBase { 539 struct ParserFormalParameters : FormalParametersBase {
540 struct Parameter { 540 struct Parameter {
541 Parameter(const AstRawString* name, Expression* pattern, 541 Parameter(const AstRawString* name, Expression* pattern,
542 Expression* initializer, bool is_rest) 542 Expression* initializer, bool is_rest)
543 : name(name), pattern(pattern), initializer(initializer), 543 : name(name), pattern(pattern), initializer(initializer),
544 is_rest(is_rest) {} 544 is_rest(is_rest) {}
545 const AstRawString* name; 545 const AstRawString* name;
546 Expression* pattern; 546 Expression* pattern;
547 Expression* initializer; 547 Expression* initializer;
548 bool is_rest; 548 bool is_rest;
549 bool is_simple() const {
550 return pattern->IsVariableProxy() && initializer == nullptr && !is_rest;
551 }
549 }; 552 };
550 553
551 explicit ParserFormalParameters(Scope* scope) 554 explicit ParserFormalParameters(Scope* scope)
552 : FormalParametersBase(scope), params(4, scope->zone()) {} 555 : FormalParametersBase(scope), params(4, scope->zone()) {}
553 ZoneList<Parameter> params; 556 ZoneList<Parameter> params;
554 557
555 int Arity() const { return params.length(); } 558 int Arity() const { return params.length(); }
556 const Parameter& at(int i) const { return params[i]; } 559 const Parameter& at(int i) const { return params[i]; }
557 }; 560 };
558 561
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 parser_->BuildParameterInitializationBlock(parameters, ok); 1364 parser_->BuildParameterInitializationBlock(parameters, ok);
1362 if (!*ok) return; 1365 if (!*ok) return;
1363 if (init_block != nullptr) { 1366 if (init_block != nullptr) {
1364 body->Add(init_block, parser_->zone()); 1367 body->Add(init_block, parser_->zone());
1365 } 1368 }
1366 } 1369 }
1367 } 1370 }
1368 } } // namespace v8::internal 1371 } } // namespace v8::internal
1369 1372
1370 #endif // V8_PARSER_H_ 1373 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698