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

Side by Side Diff: src/parser.h

Issue 1146683002: [destructuring] Implement initializers in patterns. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased onto ToT Created 5 years, 7 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/pattern-rewriter.cc » ('j') | no next file with comments »
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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 #undef DECLARE_VISIT 1000 #undef DECLARE_VISIT
1001 virtual void Visit(AstNode* node) override; 1001 virtual void Visit(AstNode* node) override;
1002 1002
1003 void RecurseIntoSubpattern(AstNode* pattern, Expression* value) { 1003 void RecurseIntoSubpattern(AstNode* pattern, Expression* value) {
1004 Expression* old_value = current_value_; 1004 Expression* old_value = current_value_;
1005 current_value_ = value; 1005 current_value_ = value;
1006 pattern->Accept(this); 1006 pattern->Accept(this);
1007 current_value_ = old_value; 1007 current_value_ = old_value;
1008 } 1008 }
1009 1009
1010 Variable* CreateTempVar(Expression* value);
1011
1010 AstNodeFactory* factory() const { return descriptor_->parser->factory(); } 1012 AstNodeFactory* factory() const { return descriptor_->parser->factory(); }
1011 AstValueFactory* ast_value_factory() const { 1013 AstValueFactory* ast_value_factory() const {
1012 return descriptor_->parser->ast_value_factory(); 1014 return descriptor_->parser->ast_value_factory();
1013 } 1015 }
1014 bool inside_with() const { return descriptor_->parser->inside_with(); } 1016 bool inside_with() const { return descriptor_->parser->inside_with(); }
1015 Zone* zone() const { return descriptor_->parser->zone(); } 1017 Zone* zone() const { return descriptor_->parser->zone(); }
1016 Scope* TemporaryDeclarationScope() const {
1017 return descriptor_->parser->scope_->DeclarationScope();
1018 }
1019 1018
1020 Expression* pattern_; 1019 Expression* pattern_;
1021 int initializer_position_; 1020 int initializer_position_;
1022 Block* block_; 1021 Block* block_;
1023 const DeclarationDescriptor* descriptor_; 1022 const DeclarationDescriptor* descriptor_;
1024 ZoneList<const AstRawString*>* names_; 1023 ZoneList<const AstRawString*>* names_;
1025 Expression* current_value_; 1024 Expression* current_value_;
1026 bool* ok_; 1025 bool* ok_;
1027 }; 1026 };
1028 1027
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 } 1265 }
1267 1266
1268 1267
1269 Expression* ParserTraits::SpreadCallNew( 1268 Expression* ParserTraits::SpreadCallNew(
1270 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { 1269 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) {
1271 return parser_->SpreadCallNew(function, args, pos); 1270 return parser_->SpreadCallNew(function, args, pos);
1272 } 1271 }
1273 } } // namespace v8::internal 1272 } } // namespace v8::internal
1274 1273
1275 #endif // V8_PARSER_H_ 1274 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698