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

Unified Diff: src/parsing/preparser.cc

Issue 1853763002: Allow constructor and method signatures in classes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@types-1849803002-intf-decl
Patch Set: Fix method type annotations in the preparser Created 4 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
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 2be6301db258e2bcd8c84316c09ed4187a09dd25..cf54051d94053e24afb122045f14d30fbe52a0f6 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -1059,7 +1059,9 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
parenthesized_function_ = false;
// Parse optional type annotation.
- if (scope_->typed() && Check(Token::COLON)) { // Braces required here.
+ if (scope_->typed() &&
+ !(type_flags & typesystem::kDisallowTypeAnnotation) &&
+ Check(Token::COLON)) { // Braces required here.
ParseValidType(CHECK_OK);
}

Powered by Google App Engine
This is Rietveld 408576698