mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibJS: Make a slash after a curly close mean not-division
There's no grammar rule that allows this.
This commit is contained in:
committed by
Andreas Kling
parent
46ef333e9c
commit
0292ad33eb
@@ -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
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user