Similar to #173 and #177.
Steps to reproduce
for statement which contains:
of as an identifier on the left side of a binary expression, whose operator is /
Minimal source code
Also affects for..of and for..in statements
However, these are both pathological examples: while they are valid JavaScript, of / 2 would have to produce an iterable for these to execute without error.
Full repro
import { init, parse } from 'es-module-lexer';
(async () => {
await init;
parse('for (i = of / 2;;) {}');
})();
Error: Parse error @:1:22
at parse (file:///app/node_modules/.pnpm/es-module-lexer@1.7.0/node_modules/es-module-lexer/dist/lexer.js:2:682)
at file:///app/index.mjs:4:3 {
idx: 21
}
Affected versions
Reproducible in versions 1.5.1 through 1.7.0.
Like #177, we unfortunately have this code in our minified Vite output and so our CI/CD broke. I somehow managed to find it in our 8MB minified JS file 🫠
Similar to #173 and #177.
Steps to reproduce
forstatement which contains:ofas an identifier on the left side of a binary expression, whose operator is/Minimal source code
Also affects
for..ofandfor..instatementsHowever, these are both pathological examples: while they are valid JavaScript,
of / 2would have to produce an iterable for these to execute without error.Full repro
Affected versions
Reproducible in versions 1.5.1 through 1.7.0.
Like #177, we unfortunately have this code in our minified Vite output and so our CI/CD broke. I somehow managed to find it in our 8MB minified JS file 🫠