From 6659f7a0334ef83c47ffc982a8a4b51a1e944d3c Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke
function parseStatement() {
- if (tokType === _slash)
+ if (tokType === _slash || tokType === _assign && tokVal == "/=")
readToken(true);
var starttype = tokType, node = startNode();Most types of statements are recognized by the keyword they diff --git a/test/tests.js b/test/tests.js index 8c427868b2..f021de1328 100644 --- a/test/tests.js +++ b/test/tests.js @@ -26266,6 +26266,23 @@ test("a.in / b", { ] }); +test("{}/=/", { + type: "Program", + body: [ + { + type: "BlockStatement", + body: [] + }, + { + type: "ExpressionStatement", + expression: { + type: "Literal", + raw: "/=/" + } + } + ] +}); + // Failure tests testFail("{", @@ -26874,4 +26891,3 @@ testFail("throw\n10;", "Illegal newline after throw (1:5)"); } ); })(); -