You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was curious how regular expressions were handled and I noticed some cases with break and continue that aren't handled. Here's an example of one:
x: while(true){if(foo)break/import("a")/.test(bar)||baz()if(foo)continue/import("b")/.test(bar)||baz()if(foo)break x
/import("c")/.test(bar)||baz()if(foo)continue x
/import("d")/.test(bar)||baz()}
This library thinks that these are all imports.
The text was updated successfully, but these errors were encountered:
Thanks for posting. The lexer isn't perfect and there are some academic cases that can break it, in particular nodejs/cjs-module-lexer#22 and nodejs/cjs-module-lexer#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 #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.
The text was updated successfully, but these errors were encountered: