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

Side by Side Diff: src/parser.h

Issue 943543002: [strong] Declaration-after-use errors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: computed prop names comment fix Created 5 years, 9 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 | « src/messages.js ('k') | src/parser.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" // For CachedDataMode 10 #include "src/compiler.h" // For CachedDataMode
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 const AstRawString* GetNumberAsSymbol(Scanner* scanner); 535 const AstRawString* GetNumberAsSymbol(Scanner* scanner);
536 536
537 Expression* ThisExpression(Scope* scope, AstNodeFactory* factory, 537 Expression* ThisExpression(Scope* scope, AstNodeFactory* factory,
538 int pos = RelocInfo::kNoPosition); 538 int pos = RelocInfo::kNoPosition);
539 Expression* SuperReference(Scope* scope, AstNodeFactory* factory, 539 Expression* SuperReference(Scope* scope, AstNodeFactory* factory,
540 int pos = RelocInfo::kNoPosition); 540 int pos = RelocInfo::kNoPosition);
541 Expression* DefaultConstructor(bool call_super, Scope* scope, int pos, 541 Expression* DefaultConstructor(bool call_super, Scope* scope, int pos,
542 int end_pos); 542 int end_pos);
543 Literal* ExpressionFromLiteral(Token::Value token, int pos, Scanner* scanner, 543 Literal* ExpressionFromLiteral(Token::Value token, int pos, Scanner* scanner,
544 AstNodeFactory* factory); 544 AstNodeFactory* factory);
545 Expression* ExpressionFromIdentifier(const AstRawString* name, int pos, 545 Expression* ExpressionFromIdentifier(const AstRawString* name,
546 int start_position, int end_position,
546 Scope* scope, AstNodeFactory* factory); 547 Scope* scope, AstNodeFactory* factory);
547 Expression* ExpressionFromString(int pos, Scanner* scanner, 548 Expression* ExpressionFromString(int pos, Scanner* scanner,
548 AstNodeFactory* factory); 549 AstNodeFactory* factory);
549 Expression* GetIterator(Expression* iterable, AstNodeFactory* factory); 550 Expression* GetIterator(Expression* iterable, AstNodeFactory* factory);
550 ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) { 551 ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) {
551 return new(zone) ZoneList<v8::internal::Expression*>(size, zone); 552 return new(zone) ZoneList<v8::internal::Expression*>(size, zone);
552 } 553 }
553 ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) { 554 ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) {
554 return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone); 555 return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone);
555 } 556 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 // function f() { { { var x; } let x; } } 792 // function f() { { { var x; } let x; } }
792 // function g() { { var x; let x; } } 793 // function g() { { var x; let x; } }
793 // 794 //
794 // The var declarations are hoisted to the function scope, but originate from 795 // The var declarations are hoisted to the function scope, but originate from
795 // a scope where the name has also been let bound or the var declaration is 796 // a scope where the name has also been let bound or the var declaration is
796 // hoisted over such a scope. 797 // hoisted over such a scope.
797 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); 798 void CheckConflictingVarDeclarations(Scope* scope, bool* ok);
798 799
799 // Parser support 800 // Parser support
800 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); 801 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode);
801 void Declare(Declaration* declaration, bool resolve, bool* ok); 802 Variable* Declare(Declaration* declaration, bool resolve, bool* ok);
802 803
803 bool TargetStackContainsLabel(const AstRawString* label); 804 bool TargetStackContainsLabel(const AstRawString* label);
804 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); 805 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok);
805 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); 806 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok);
806 807
807 void AddAssertIsConstruct(ZoneList<Statement*>* body, int pos); 808 void AddAssertIsConstruct(ZoneList<Statement*>* body, int pos);
808 809
809 // Factory methods. 810 // Factory methods.
810 FunctionLiteral* DefaultConstructor(bool call_super, Scope* scope, int pos, 811 FunctionLiteral* DefaultConstructor(bool call_super, Scope* scope, int pos,
811 int end_pos); 812 int end_pos);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 } 941 }
941 942
942 943
943 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, 944 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state,
944 int start, Expression* tag) { 945 int start, Expression* tag) {
945 return parser_->CloseTemplateLiteral(state, start, tag); 946 return parser_->CloseTemplateLiteral(state, start, tag);
946 } 947 }
947 } } // namespace v8::internal 948 } } // namespace v8::internal
948 949
949 #endif // V8_PARSER_H_ 950 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698