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

Unified Diff: src/parsing/preparser.h

Issue 2311903003: Move ParseHoistableDeclaration to ParserBase. (Closed)
Patch Set: rebased Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index daadef33a7deadbc4b56f9b95124e98b843fc2a1..94e36c9526819c3bbc6e3b4904c683b858de2335 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -393,10 +393,6 @@ class PreParserStatement {
return PreParserStatement(kJumpStatement);
}
- static PreParserStatement FunctionDeclaration() {
- return PreParserStatement(kFunctionDeclaration);
- }
-
// Creates expression statement from expression.
// Preserves being an unparenthesized string literal, possibly
// "use strict".
@@ -425,10 +421,6 @@ class PreParserStatement {
bool IsUseAsmLiteral() { return code_ == kUseAsmExpressionStatement; }
- bool IsFunctionDeclaration() {
- return code_ == kFunctionDeclaration;
- }
-
bool IsJumpStatement() {
return code_ == kJumpStatement;
}
@@ -446,7 +438,6 @@ class PreParserStatement {
kStringLiteralExpressionStatement,
kUseStrictExpressionStatement,
kUseAsmExpressionStatement,
- kFunctionDeclaration
};
explicit PreParserStatement(Type code) : code_(code) {}
@@ -760,11 +751,6 @@ class PreParser : public ParserBase<PreParser> {
// By making the 'exception handling' explicit, we are forced to check
// for failure at the call sites.
Statement ParseScopedStatement(bool legacy, bool* ok);
- Statement ParseHoistableDeclaration(ZoneList<const AstRawString*>* names,
- bool default_export, bool* ok);
- Statement ParseHoistableDeclaration(int pos, ParseFunctionFlags flags,
- ZoneList<const AstRawString*>* names,
- bool default_export, bool* ok);
Statement ParseFunctionDeclaration(bool* ok);
Statement ParseAsyncFunctionDeclaration(ZoneList<const AstRawString*>* names,
bool default_export, bool* ok);
@@ -887,6 +873,13 @@ class PreParser : public ParserBase<PreParser> {
const DeclarationParsingResult::Declaration* declaration,
ZoneList<const AstRawString*>* names, bool* ok) {}
+ V8_INLINE PreParserStatement DeclareFunction(
+ PreParserIdentifier variable_name, PreParserExpression function, int pos,
+ bool is_generator, bool is_async, ZoneList<const AstRawString*>* names,
+ bool* ok) {
+ return Statement::Default();
+ }
+
V8_INLINE void QueueDestructuringAssignmentForRewriting(
PreParserExpression assignment) {}
V8_INLINE void QueueNonPatternForRewriting(PreParserExpression expr,
@@ -970,11 +963,16 @@ class PreParser : public ParserBase<PreParser> {
return PreParserExpression::Default();
}
+ V8_INLINE static void GetDefaultStrings(
+ PreParserIdentifier* default_string,
+ PreParserIdentifier* star_default_star_string) {}
+
// Functions for encapsulating the differences between parsing and preparsing;
// operations interleaved with the recursive descent.
V8_INLINE static void PushLiteralName(PreParserIdentifier id) {}
V8_INLINE static void PushVariableName(PreParserIdentifier id) {}
V8_INLINE void PushPropertyName(PreParserExpression expression) {}
+ V8_INLINE void PushEnclosingName(PreParserIdentifier name) {}
V8_INLINE static void InferFunctionName(PreParserExpression expression) {}
V8_INLINE static void CheckAssigningFunctionLiteralToProperty(
@@ -1051,6 +1049,9 @@ class PreParser : public ParserBase<PreParser> {
V8_INLINE static PreParserExpression EmptyFunctionLiteral() {
return PreParserExpression::Default();
}
+ V8_INLINE static PreParserStatement GetEmptyStatement() {
nickie 2016/09/06 17:29:57 Again, there's NullStatement in line 1076.
marja 2016/09/08 11:15:58 Done.
+ return PreParserStatement::Default();
+ }
V8_INLINE static bool IsEmptyExpression(PreParserExpression expr) {
return expr.IsEmpty();
« src/parsing/parser.h ('K') | « src/parsing/parser-base.h ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698