diff options
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibJS/Lexer.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Tests/syntax/slash-after-block.js | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Lexer.cpp b/Userland/Libraries/LibJS/Lexer.cpp index 5d39c5431e..0263231065 100644 --- a/Userland/Libraries/LibJS/Lexer.cpp +++ b/Userland/Libraries/LibJS/Lexer.cpp @@ -360,7 +360,6 @@ bool Lexer::slash_means_division() const return type == TokenType::BigIntLiteral || type == TokenType::BoolLiteral || type == TokenType::BracketClose - || type == TokenType::CurlyClose || type == TokenType::Identifier || type == TokenType::NullLiteral || type == TokenType::NumericLiteral diff --git a/Userland/Libraries/LibJS/Tests/syntax/slash-after-block.js b/Userland/Libraries/LibJS/Tests/syntax/slash-after-block.js new file mode 100644 index 0000000000..67839147f9 --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/syntax/slash-after-block.js @@ -0,0 +1,6 @@ +test("slash token resolution in lexer", () => { + expect(`{ blah.blah; }\n/foo/`).toEval(); + expect("``/foo/").not.toEval(); + expect("1/foo/").not.toEval(); + expect("1/foo").toEval(); +}); |