Closed evanw closed 2 years ago
Thanks for posting. The lexer isn't perfect and there are some academic cases that can break it, in particular https://github.com/nodejs/cjs-module-lexer/issues/22 and https://github.com/nodejs/cjs-module-lexer/issues/20. We effectively do have a "real code" eventual cutoff which may not be the best choice for a perfect parser, although we do aim to support all real code. This is very much not an academic case though, fixed in https://github.com/guybedford/es-module-lexer/pull/124.
I was curious how regular expressions were handled and I noticed some cases with
break
andcontinue
that aren't handled. Here's an example of one:This library thinks that these are all imports.