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

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: add braces around single-line if stmt 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);
773 }
771 return parser_->NewUnresolved(name, start_position, end_position); 774 return parser_->NewUnresolved(name, start_position, end_position);
772 } 775 }
773 776
774 777
775 Expression* ParserTraits::ExpressionFromString(int pos, Scanner* scanner, 778 Expression* ParserTraits::ExpressionFromString(int pos, Scanner* scanner,
776 AstNodeFactory* factory) { 779 AstNodeFactory* factory) {
777 const AstRawString* symbol = GetSymbol(scanner); 780 const AstRawString* symbol = GetSymbol(scanner);
778 if (parser_->fni_ != NULL) parser_->fni_->PushLiteralName(symbol); 781 if (parser_->fni_ != NULL) parser_->fni_->PushLiteralName(symbol);
779 return factory->NewStringLiteral(symbol, pos); 782 return factory->NewStringLiteral(symbol, pos);
780 } 783 }
(...skipping 6289 matching lines...) Expand 10 before | Expand all | Expand 10 after
7070 node->Print(Isolate::Current()); 7073 node->Print(Isolate::Current());
7071 } 7074 }
7072 #endif // DEBUG 7075 #endif // DEBUG
7073 7076
7074 #undef CHECK_OK 7077 #undef CHECK_OK
7075 #undef CHECK_OK_VOID 7078 #undef CHECK_OK_VOID
7076 #undef CHECK_FAILED 7079 #undef CHECK_FAILED
7077 7080
7078 } // namespace internal 7081 } // namespace internal
7079 } // namespace v8 7082 } // 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