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

Unified Diff: src/parser.h

Issue 1094653002: Revert "Factor formal argument parsing into ParserBase" (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « src/messages.js ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 89d756a23a43825ff30e60953f6ea3b2ae32db26..8d557aed53eca468795303c536bbd17252890551 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -557,8 +557,6 @@ class ParserTraits {
typedef ObjectLiteral::Property* ObjectLiteralProperty;
typedef ZoneList<v8::internal::Expression*>* ExpressionList;
typedef ZoneList<ObjectLiteral::Property*>* PropertyList;
- typedef const v8::internal::AstRawString* FormalParameter;
- typedef ZoneList<const v8::internal::AstRawString*>* FormalParameterList;
typedef ZoneList<v8::internal::Statement*>* StatementList;
// For constructing objects returned by the traversing functions.
@@ -696,6 +694,7 @@ class ParserTraits {
static Expression* EmptyExpression() {
return NULL;
}
+ static Expression* EmptyArrowParamList() { return NULL; }
static Literal* EmptyLiteral() {
return NULL;
}
@@ -706,10 +705,6 @@ class ParserTraits {
static ZoneList<Expression*>* NullExpressionList() {
return NULL;
}
- static const AstRawString* EmptyFormalParameter() { return NULL; }
- static ZoneList<const AstRawString*>* NullFormalParameterList() {
- return NULL;
- }
// Non-NULL empty string.
V8_INLINE const AstRawString* EmptyIdentifierString();
@@ -745,20 +740,14 @@ class ParserTraits {
ZoneList<v8::internal::Statement*>* NewStatementList(int size, Zone* zone) {
return new(zone) ZoneList<v8::internal::Statement*>(size, zone);
}
- ZoneList<const v8::internal::AstRawString*>* NewFormalParameterList(
- int size, Zone* zone) {
- return new (zone) ZoneList<const v8::internal::AstRawString*>(size, zone);
- }
V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type,
FunctionKind kind = kNormalFunction);
- void RecordArrowFunctionParameter(ZoneList<const AstRawString*>* params,
- VariableProxy* proxy,
- FormalParameterErrorLocations* error_locs,
- bool* ok);
- ZoneList<const AstRawString*>* ParseArrowFunctionFormalParameterList(
- Expression* params, const Scanner::Location& params_loc,
- FormalParameterErrorLocations* error_locs, bool* is_rest, bool* ok);
+ // Utility functions
+ int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope,
+ Scanner::Location* undefined_loc,
+ Scanner::Location* dupe_loc,
+ bool* ok);
// Temporary glue; these functions will move to ParserBase.
Expression* ParseV8Intrinsic(bool* ok);
@@ -779,9 +768,6 @@ class ParserTraits {
bool name_is_strict_reserved, int pos,
bool* ok);
- int DeclareFormalParameters(ZoneList<const AstRawString*>* params,
- Scope* scope, bool has_rest);
-
V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope,
bool* ok);
@@ -1059,6 +1045,8 @@ class Parser : public ParserBase<ParserTraits> {
ScriptCompiler::CompileOptions compile_options_;
ParseData* cached_parse_data_;
+ bool parsing_lazy_arrow_parameters_; // for lazily parsed arrow functions.
+
PendingCompilationErrorHandler pending_error_handler_;
// Other information which will be stored in Parser and moved to Isolate after
« no previous file with comments | « src/messages.js ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698