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

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

Issue 1757543003: Restrict FunctionDeclarations in Statement position (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git cl format Created 4 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.h ('k') | 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/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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 bool* ok); 912 bool* ok);
913 WhileStatement* ParseWhileStatement(ZoneList<const AstRawString*>* labels, 913 WhileStatement* ParseWhileStatement(ZoneList<const AstRawString*>* labels,
914 bool* ok); 914 bool* ok);
915 Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); 915 Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok);
916 Statement* ParseThrowStatement(bool* ok); 916 Statement* ParseThrowStatement(bool* ok);
917 Expression* MakeCatchContext(Handle<String> id, VariableProxy* value); 917 Expression* MakeCatchContext(Handle<String> id, VariableProxy* value);
918 class DontCollectExpressionsInTailPositionScope; 918 class DontCollectExpressionsInTailPositionScope;
919 class CollectExpressionsInTailPositionToListScope; 919 class CollectExpressionsInTailPositionToListScope;
920 TryStatement* ParseTryStatement(bool* ok); 920 TryStatement* ParseTryStatement(bool* ok);
921 DebuggerStatement* ParseDebuggerStatement(bool* ok); 921 DebuggerStatement* ParseDebuggerStatement(bool* ok);
922 // Parse a SubStatement in strict mode, or with an extra block scope in
923 // sloppy mode to handle
924 // ES#sec-functiondeclarations-in-ifstatement-statement-clauses
925 // The legacy parameter indicates whether function declarations are
926 // banned by the ES2015 specification in this location, and they are being
927 // permitted here to match previous V8 behavior.
928 Statement* ParseScopedStatement(ZoneList<const AstRawString*>* labels,
929 bool legacy, bool* ok);
922 930
923 // !%_IsJSReceiver(result = iterator.next()) && 931 // !%_IsJSReceiver(result = iterator.next()) &&
924 // %ThrowIteratorResultNotAnObject(result) 932 // %ThrowIteratorResultNotAnObject(result)
925 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, 933 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result,
926 int pos); 934 int pos);
927 935
928 936
929 // Initialize the components of a for-in / for-of statement. 937 // Initialize the components of a for-in / for-of statement.
930 void InitializeForEachStatement(ForEachStatement* stmt, Expression* each, 938 void InitializeForEachStatement(ForEachStatement* stmt, Expression* each,
931 Expression* subject, Statement* body, 939 Expression* subject, Statement* body,
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 1236
1229 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { 1237 DoExpression* ParserTraits::ParseDoExpression(bool* ok) {
1230 return parser_->ParseDoExpression(ok); 1238 return parser_->ParseDoExpression(ok);
1231 } 1239 }
1232 1240
1233 1241
1234 } // namespace internal 1242 } // namespace internal
1235 } // namespace v8 1243 } // namespace v8
1236 1244
1237 #endif // V8_PARSING_PARSER_H_ 1245 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698