Index: src/parsing/preparser.cc |
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc |
index 51d7f50ec6592d6b6d0c280ec024b92986bed047..fd125e8919a04642a21b5a128cb956bc75a77c1e 100644 |
--- a/src/parsing/preparser.cc |
+++ b/src/parsing/preparser.cc |
@@ -1138,6 +1138,12 @@ PreParserExpression PreParser::ParseClassLiteral( |
// TODO(marja): Make PreParser use scope names too. |
// scope_->SetScopeName(name); |
+ // Parse optional type parameters. |
+ if (scope_->typed() && peek() == Token::LT) { // Braces required here. |
+ ParseTypeParameters(CHECK_OK); |
+ } |
+ |
+ // Parse optional extends clause. |
bool has_extends = Check(Token::EXTENDS); |
if (has_extends) { |
ExpressionClassifier classifier(this); |
@@ -1145,6 +1151,13 @@ PreParserExpression PreParser::ParseClassLiteral( |
ValidateExpression(&classifier, CHECK_OK); |
} |
+ // Parse optional implements clause. |
+ if (scope_->typed() && CheckContextualKeyword(CStrVector("implements"))) { |
+ do { |
+ ParseTypeReference(CHECK_OK); |
+ } while (Check(Token::COMMA)); |
+ } |
+ |
ClassLiteralChecker checker(this); |
bool has_seen_constructor = false; |