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

Side by Side Diff: src/parsing/parser-base.h

Issue 2270223002: Disallow 'yield' in async arrow parameter lists inside generators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | test/cctest/test-parsing.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 #ifndef V8_PARSING_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/hashmap.h" 10 #include "src/base/hashmap.h"
(...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 Scanner::Location spread_pos; 2890 Scanner::Location spread_pos;
2891 typename Traits::Type::ExpressionList args; 2891 typename Traits::Type::ExpressionList args;
2892 if (V8_UNLIKELY(is_async && this->IsIdentifier(result))) { 2892 if (V8_UNLIKELY(is_async && this->IsIdentifier(result))) {
2893 ExpressionClassifier async_classifier(this); 2893 ExpressionClassifier async_classifier(this);
2894 args = ParseArguments(&spread_pos, true, &async_classifier, CHECK_OK); 2894 args = ParseArguments(&spread_pos, true, &async_classifier, CHECK_OK);
2895 if (peek() == Token::ARROW) { 2895 if (peek() == Token::ARROW) {
2896 if (fni_) { 2896 if (fni_) {
2897 fni_->RemoveAsyncKeywordFromEnd(); 2897 fni_->RemoveAsyncKeywordFromEnd();
2898 } 2898 }
2899 ValidateBindingPattern(&async_classifier, CHECK_OK); 2899 ValidateBindingPattern(&async_classifier, CHECK_OK);
2900 ValidateFormalParameterInitializer(&async_classifier, CHECK_OK);
2900 if (!async_classifier.is_valid_async_arrow_formal_parameters()) { 2901 if (!async_classifier.is_valid_async_arrow_formal_parameters()) {
2901 ReportClassifierError( 2902 ReportClassifierError(
2902 async_classifier.async_arrow_formal_parameters_error()); 2903 async_classifier.async_arrow_formal_parameters_error());
2903 *ok = false; 2904 *ok = false;
2904 return this->EmptyExpression(); 2905 return this->EmptyExpression();
2905 } 2906 }
2906 if (args->length()) { 2907 if (args->length()) {
2907 // async ( Arguments ) => ... 2908 // async ( Arguments ) => ...
2908 return Traits::ExpressionListToExpression(args); 2909 return Traits::ExpressionListToExpression(args);
2909 } 2910 }
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
3724 has_seen_constructor_ = true; 3725 has_seen_constructor_ = true;
3725 return; 3726 return;
3726 } 3727 }
3727 } 3728 }
3728 3729
3729 3730
3730 } // namespace internal 3731 } // namespace internal
3731 } // namespace v8 3732 } // namespace v8
3732 3733
3733 #endif // V8_PARSING_PARSER_BASE_H 3734 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698