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

Side by Side Diff: src/parsing/parser.h

Issue 2447143005: [parsing] When failing due to variable redeclaration, point at the variable. (Closed)
Patch Set: Address review comments. Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/parsing/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_PARSING_PARSER_H_ 5 #ifndef V8_PARSING_PARSER_H_
6 #define V8_PARSING_PARSER_H_ 6 #define V8_PARSING_PARSER_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/base/compiler-specific.h" 10 #include "src/base/compiler-specific.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3 462 // Implement sloppy block-scoped functions, ES2015 Annex B 3.3
463 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope); 463 void InsertSloppyBlockFunctionVarBindings(DeclarationScope* scope);
464 464
465 VariableProxy* NewUnresolved(const AstRawString* name, int begin_pos, 465 VariableProxy* NewUnresolved(const AstRawString* name, int begin_pos,
466 VariableKind kind = NORMAL_VARIABLE); 466 VariableKind kind = NORMAL_VARIABLE);
467 VariableProxy* NewUnresolved(const AstRawString* name); 467 VariableProxy* NewUnresolved(const AstRawString* name);
468 Variable* Declare(Declaration* declaration, 468 Variable* Declare(Declaration* declaration,
469 DeclarationDescriptor::Kind declaration_kind, 469 DeclarationDescriptor::Kind declaration_kind,
470 VariableMode mode, InitializationFlag init, bool* ok, 470 VariableMode mode, InitializationFlag init, bool* ok,
471 Scope* declaration_scope = nullptr); 471 Scope* declaration_scope = nullptr,
472 int var_end_pos = kNoSourcePosition);
472 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode, 473 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode,
473 int pos, bool* ok); 474 int pos, bool* ok);
474 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode, 475 Declaration* DeclareVariable(const AstRawString* name, VariableMode mode,
475 InitializationFlag init, int pos, bool* ok); 476 InitializationFlag init, int pos, bool* ok);
476 Declaration* DeclareModuleImport(const AstRawString* name, int pos, bool* ok); 477 Declaration* DeclareModuleImport(const AstRawString* name, int pos, bool* ok);
477 478
478 bool TargetStackContainsLabel(const AstRawString* label); 479 bool TargetStackContainsLabel(const AstRawString* label);
479 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); 480 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok);
480 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); 481 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok);
481 482
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 1142
1142 private: 1143 private:
1143 ParserTarget** variable_; 1144 ParserTarget** variable_;
1144 ParserTarget* previous_; 1145 ParserTarget* previous_;
1145 }; 1146 };
1146 1147
1147 } // namespace internal 1148 } // namespace internal
1148 } // namespace v8 1149 } // namespace v8
1149 1150
1150 #endif // V8_PARSING_PARSER_H_ 1151 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698