Index: src/parsing/preparser.cc |
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc |
index 08d5eafd4de581828aaa0d3090f2b0db9ddb1a64..9a978c11ae4e769ab5b106406aee7618aa3ca1b8 100644 |
--- a/src/parsing/preparser.cc |
+++ b/src/parsing/preparser.cc |
@@ -1258,6 +1258,12 @@ PreParserExpression PreParser::ParseClassLiteral( |
Expect(Token::RBRACE, CHECK_OK); |
+ // We desugar class literals into a runtime function call which takes three |
+ // new array literals as arguments, so we need to reserve indices for them. |
+ function_state_->NextMaterializedLiteralIndex(); |
+ function_state_->NextMaterializedLiteralIndex(); |
+ function_state_->NextMaterializedLiteralIndex(); |
+ |
return Expression::Default(); |
} |