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

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

Issue 1941823003: Properly disallow 'yield' in class expressions and arrow parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Better error message for yield in parameter Created 4 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
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/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 int function_token_position, FunctionLiteral::FunctionType type, 560 int function_token_position, FunctionLiteral::FunctionType type,
561 LanguageMode language_mode, bool* ok); 561 LanguageMode language_mode, bool* ok);
562 V8_INLINE void SkipLazyFunctionBody( 562 V8_INLINE void SkipLazyFunctionBody(
563 int* materialized_literal_count, int* expected_property_count, bool* ok, 563 int* materialized_literal_count, int* expected_property_count, bool* ok,
564 Scanner::BookmarkScope* bookmark = nullptr); 564 Scanner::BookmarkScope* bookmark = nullptr);
565 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( 565 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody(
566 const AstRawString* name, int pos, 566 const AstRawString* name, int pos,
567 const ParserFormalParameters& parameters, FunctionKind kind, 567 const ParserFormalParameters& parameters, FunctionKind kind,
568 FunctionLiteral::FunctionType function_type, bool* ok); 568 FunctionLiteral::FunctionType function_type, bool* ok);
569 569
570 ClassLiteral* ParseClassLiteral(const AstRawString* name, 570 ClassLiteral* ParseClassLiteral(Type::ExpressionClassifier* classifier,
571 const AstRawString* name,
571 Scanner::Location class_name_location, 572 Scanner::Location class_name_location,
572 bool name_is_strict_reserved, int pos, 573 bool name_is_strict_reserved, int pos,
573 bool* ok); 574 bool* ok);
574 575
575 V8_INLINE void MarkTailPosition(Expression* expression); 576 V8_INLINE void MarkTailPosition(Expression* expression);
576 577
577 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, 578 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope,
578 bool* ok); 579 bool* ok);
579 580
580 class TemplateLiteral : public ZoneObject { 581 class TemplateLiteral : public ZoneObject {
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 Expression* cond, Statement* next, Statement* body, bool* ok); 952 Expression* cond, Statement* next, Statement* body, bool* ok);
952 953
953 void RewriteDoExpression(Expression* expr, bool* ok); 954 void RewriteDoExpression(Expression* expr, bool* ok);
954 955
955 FunctionLiteral* ParseFunctionLiteral( 956 FunctionLiteral* ParseFunctionLiteral(
956 const AstRawString* name, Scanner::Location function_name_location, 957 const AstRawString* name, Scanner::Location function_name_location,
957 FunctionNameValidity function_name_validity, FunctionKind kind, 958 FunctionNameValidity function_name_validity, FunctionKind kind,
958 int function_token_position, FunctionLiteral::FunctionType type, 959 int function_token_position, FunctionLiteral::FunctionType type,
959 LanguageMode language_mode, bool* ok); 960 LanguageMode language_mode, bool* ok);
960 961
961 962 ClassLiteral* ParseClassLiteral(ExpressionClassifier* classifier,
962 ClassLiteral* ParseClassLiteral(const AstRawString* name, 963 const AstRawString* name,
963 Scanner::Location class_name_location, 964 Scanner::Location class_name_location,
964 bool name_is_strict_reserved, int pos, 965 bool name_is_strict_reserved, int pos,
965 bool* ok); 966 bool* ok);
966 967
967 // Magical syntax support. 968 // Magical syntax support.
968 Expression* ParseV8Intrinsic(bool* ok); 969 Expression* ParseV8Intrinsic(bool* ok);
969 970
970 // Get odd-ball literals. 971 // Get odd-ball literals.
971 Literal* GetLiteralUndefined(int position); 972 Literal* GetLiteralUndefined(int position);
972 973
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 1249
1249 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { 1250 DoExpression* ParserTraits::ParseDoExpression(bool* ok) {
1250 return parser_->ParseDoExpression(ok); 1251 return parser_->ParseDoExpression(ok);
1251 } 1252 }
1252 1253
1253 1254
1254 } // namespace internal 1255 } // namespace internal
1255 } // namespace v8 1256 } // namespace v8
1256 1257
1257 #endif // V8_PARSING_PARSER_H_ 1258 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/parsing/parser.cc » ('j') | src/parsing/parser-base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698