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

Side by Side Diff: src/parser.cc

Issue 1286383005: Parse arrow functions at proper precedence level (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Fix nits Created 5 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/messages.h ('k') | src/pattern-rewriter.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 #include "src/parser.h" 5 #include "src/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 3913 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 } 3924 }
3925 3925
3926 AddFormalParameter(parameters, expr, initializer, is_rest); 3926 AddFormalParameter(parameters, expr, initializer, is_rest);
3927 } 3927 }
3928 3928
3929 3929
3930 void ParserTraits::ParseArrowFunctionFormalParameterList( 3930 void ParserTraits::ParseArrowFunctionFormalParameterList(
3931 ParserFormalParameters* parameters, Expression* expr, 3931 ParserFormalParameters* parameters, Expression* expr,
3932 const Scanner::Location& params_loc, 3932 const Scanner::Location& params_loc,
3933 Scanner::Location* duplicate_loc, bool* ok) { 3933 Scanner::Location* duplicate_loc, bool* ok) {
3934 if (expr->IsEmptyParentheses()) return;
3935
3934 ParseArrowFunctionFormalParameters(parameters, expr, params_loc, 3936 ParseArrowFunctionFormalParameters(parameters, expr, params_loc,
3935 duplicate_loc, ok); 3937 duplicate_loc, ok);
3936 if (!*ok) return; 3938 if (!*ok) return;
3937 3939
3938 for (int i = 0; i < parameters->Arity(); ++i) { 3940 for (int i = 0; i < parameters->Arity(); ++i) {
3939 auto parameter = parameters->at(i); 3941 auto parameter = parameters->at(i);
3940 ExpressionClassifier classifier; 3942 ExpressionClassifier classifier;
3941 DeclareFormalParameter( 3943 DeclareFormalParameter(
3942 parameters->scope, parameter, parameters->is_simple, &classifier); 3944 parameters->scope, parameter, parameters->is_simple, &classifier);
3943 if (!duplicate_loc->IsValid()) { 3945 if (!duplicate_loc->IsValid()) {
(...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
6042 Expression* Parser::SpreadCallNew(Expression* function, 6044 Expression* Parser::SpreadCallNew(Expression* function,
6043 ZoneList<v8::internal::Expression*>* args, 6045 ZoneList<v8::internal::Expression*>* args,
6044 int pos) { 6046 int pos) {
6045 args->InsertAt(0, function, zone()); 6047 args->InsertAt(0, function, zone());
6046 6048
6047 return factory()->NewCallRuntime( 6049 return factory()->NewCallRuntime(
6048 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 6050 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
6049 } 6051 }
6050 } // namespace internal 6052 } // namespace internal
6051 } // namespace v8 6053 } // namespace v8
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698