ladybird/Userland/Libraries/LibJS/Tests/modules/default-regexp-export.mjs
Simon Wanner a2efecac03 LibJS: Parse slashes after reserved identifiers correctly
Previously we were unable to parse code like `yield/2` because `/2`
was parsed as a regex. At the same time `for (a in / b/)` was parsed
as a division.

This is solved by defaulting to division in the lexer, but calling
`force_slash_as_regex()` from the parser whenever an IdentifierName
is parsed as a ReservedWord.
2023-06-10 07:20:33 +02:00

3 lines
49 B
JavaScript

export default /foo/;
export let passed = true;