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

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

Issue 2171703004: Rescope arrow-function parameter lists by moving the delta to the parameter scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unnecessary DCHECK Created 4 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 | « src/parsing/pattern-rewriter.cc ('k') | no next file » | 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_PREPARSER_H 5 #ifndef V8_PARSING_PREPARSER_H
6 #define V8_PARSING_PREPARSER_H 6 #define V8_PARSING_PREPARSER_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/hashmap.h" 10 #include "src/base/hashmap.h"
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 int* expected_property_count, bool* ok) { 871 int* expected_property_count, bool* ok) {
872 UNREACHABLE(); 872 UNREACHABLE();
873 } 873 }
874 874
875 V8_INLINE PreParserStatementList ParseEagerFunctionBody( 875 V8_INLINE PreParserStatementList ParseEagerFunctionBody(
876 PreParserIdentifier function_name, int pos, 876 PreParserIdentifier function_name, int pos,
877 const PreParserFormalParameters& parameters, FunctionKind kind, 877 const PreParserFormalParameters& parameters, FunctionKind kind,
878 FunctionLiteral::FunctionType function_type, bool* ok); 878 FunctionLiteral::FunctionType function_type, bool* ok);
879 879
880 V8_INLINE void ParseArrowFunctionFormalParameterList( 880 V8_INLINE void ParseArrowFunctionFormalParameterList(
881 PreParserFormalParameters* parameters, 881 PreParserFormalParameters* parameters, PreParserExpression expression,
882 PreParserExpression expression, const Scanner::Location& params_loc, 882 const Scanner::Location& params_loc, Scanner::Location* duplicate_loc,
883 Scanner::Location* duplicate_loc, bool* ok); 883 const Scope::Snapshot& scope_snapshot, bool* ok);
884 884
885 void ParseAsyncArrowSingleExpressionBody( 885 void ParseAsyncArrowSingleExpressionBody(
886 PreParserStatementList body, bool accept_IN, 886 PreParserStatementList body, bool accept_IN,
887 Type::ExpressionClassifier* classifier, int pos, bool* ok); 887 Type::ExpressionClassifier* classifier, int pos, bool* ok);
888 888
889 V8_INLINE PreParserExpression ParseAsyncFunctionExpression(bool* ok); 889 V8_INLINE PreParserExpression ParseAsyncFunctionExpression(bool* ok);
890 890
891 void ReindexLiterals(const PreParserFormalParameters& paramaters) {} 891 void ReindexLiterals(const PreParserFormalParameters& paramaters) {}
892 892
893 struct TemplateLiteralState {}; 893 struct TemplateLiteralState {};
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 int pos) { 1185 int pos) {
1186 return pre_parser_->factory()->NewCall(function, args, pos); 1186 return pre_parser_->factory()->NewCall(function, args, pos);
1187 } 1187 }
1188 1188
1189 PreParserExpression PreParserTraits::SpreadCallNew(PreParserExpression function, 1189 PreParserExpression PreParserTraits::SpreadCallNew(PreParserExpression function,
1190 PreParserExpressionList args, 1190 PreParserExpressionList args,
1191 int pos) { 1191 int pos) {
1192 return pre_parser_->factory()->NewCallNew(function, args, pos); 1192 return pre_parser_->factory()->NewCallNew(function, args, pos);
1193 } 1193 }
1194 1194
1195
1196 void PreParserTraits::ParseArrowFunctionFormalParameterList( 1195 void PreParserTraits::ParseArrowFunctionFormalParameterList(
1197 PreParserFormalParameters* parameters, 1196 PreParserFormalParameters* parameters, PreParserExpression params,
1198 PreParserExpression params, const Scanner::Location& params_loc, 1197 const Scanner::Location& params_loc, Scanner::Location* duplicate_loc,
1199 Scanner::Location* duplicate_loc, bool* ok) { 1198 const Scope::Snapshot& scope_snapshot, bool* ok) {
1200 // TODO(wingo): Detect duplicated identifiers in paramlists. Detect parameter 1199 // TODO(wingo): Detect duplicated identifiers in paramlists. Detect parameter
1201 // lists that are too long. 1200 // lists that are too long.
1202 } 1201 }
1203 1202
1204 PreParserExpression PreParserTraits::ParseAsyncFunctionExpression(bool* ok) { 1203 PreParserExpression PreParserTraits::ParseAsyncFunctionExpression(bool* ok) {
1205 return pre_parser_->ParseAsyncFunctionExpression(ok); 1204 return pre_parser_->ParseAsyncFunctionExpression(ok);
1206 } 1205 }
1207 1206
1208 PreParserExpression PreParserTraits::ParseDoExpression(bool* ok) { 1207 PreParserExpression PreParserTraits::ParseDoExpression(bool* ok) {
1209 return pre_parser_->ParseDoExpression(ok); 1208 return pre_parser_->ParseDoExpression(ok);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 const PreParserFormalParameters& parameters, FunctionKind kind, 1265 const PreParserFormalParameters& parameters, FunctionKind kind,
1267 FunctionLiteral::FunctionType function_type, bool* ok) { 1266 FunctionLiteral::FunctionType function_type, bool* ok) {
1268 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, 1267 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters,
1269 kind, function_type, ok); 1268 kind, function_type, ok);
1270 } 1269 }
1271 1270
1272 } // namespace internal 1271 } // namespace internal
1273 } // namespace v8 1272 } // namespace v8
1274 1273
1275 #endif // V8_PARSING_PREPARSER_H 1274 #endif // V8_PARSING_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parsing/pattern-rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698