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

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

Issue 2235423003: [parser] improve inferred function names for async arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: really the last of it Created 4 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/parsing/parser.h ('k') | src/parsing/parser-base.h » ('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/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/ast/ast.h" 10 #include "src/ast/ast.h"
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 return factory->NewNumberLiteral(value, pos, has_dot); 759 return factory->NewNumberLiteral(value, pos, has_dot);
760 } 760 }
761 default: 761 default:
762 DCHECK(false); 762 DCHECK(false);
763 } 763 }
764 return NULL; 764 return NULL;
765 } 765 }
766 766
767 Expression* ParserTraits::ExpressionFromIdentifier(const AstRawString* name, 767 Expression* ParserTraits::ExpressionFromIdentifier(const AstRawString* name,
768 int start_position, 768 int start_position,
769 int end_position) { 769 int end_position,
770 if (parser_->fni_ != NULL) parser_->fni_->PushVariableName(name); 770 InferName infer) {
771 if (infer == InferName::Yes && parser_->fni_ != NULL)
772 parser_->fni_->PushVariableName(name);
771 return parser_->NewUnresolved(name, start_position, end_position); 773 return parser_->NewUnresolved(name, start_position, end_position);
772 } 774 }
773 775
774
Dan Ehrenberg 2016/08/12 22:07:18 Nit: revert whitespace change
caitp 2016/08/12 22:19:08 Done, and some other style mixups fixed
775 Expression* ParserTraits::ExpressionFromString(int pos, Scanner* scanner, 776 Expression* ParserTraits::ExpressionFromString(int pos, Scanner* scanner,
776 AstNodeFactory* factory) { 777 AstNodeFactory* factory) {
777 const AstRawString* symbol = GetSymbol(scanner); 778 const AstRawString* symbol = GetSymbol(scanner);
778 if (parser_->fni_ != NULL) parser_->fni_->PushLiteralName(symbol); 779 if (parser_->fni_ != NULL) parser_->fni_->PushLiteralName(symbol);
779 return factory->NewStringLiteral(symbol, pos); 780 return factory->NewStringLiteral(symbol, pos);
780 } 781 }
781 782
782 783
783 Expression* ParserTraits::GetIterator(Expression* iterable, 784 Expression* ParserTraits::GetIterator(Expression* iterable,
784 AstNodeFactory* factory, int pos) { 785 AstNodeFactory* factory, int pos) {
(...skipping 6285 matching lines...) Expand 10 before | Expand all | Expand 10 after
7070 node->Print(Isolate::Current()); 7071 node->Print(Isolate::Current());
7071 } 7072 }
7072 #endif // DEBUG 7073 #endif // DEBUG
7073 7074
7074 #undef CHECK_OK 7075 #undef CHECK_OK
7075 #undef CHECK_OK_VOID 7076 #undef CHECK_OK_VOID
7076 #undef CHECK_FAILED 7077 #undef CHECK_FAILED
7077 7078
7078 } // namespace internal 7079 } // namespace internal
7079 } // namespace v8 7080 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698