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'm currently using jscodeshift to implement some codemod. While using builders.regExpLiteral, I noticed any kind of regular expression was being output as /undefined/.
Upon investigation, it appears that this line is accessing the .pattern property of a RegExp object, which doesn't seem to exist according to MDN. If the .pattern access is replaced with .source, the output becomes correct.
Version information:
ast-types: 0.15.2 and 0.16.0.
Node.js: v18.12.1
The text was updated successfully, but these errors were encountered:
I'm currently using
jscodeshift
to implement some codemod. While usingbuilders.regExpLiteral
, I noticed any kind of regular expression was being output as/undefined/
.I managed to get a reproducer using this code:
The output was:
The expected output is:
Upon investigation, it appears that this line is accessing the
.pattern
property of a RegExp object, which doesn't seem to exist according to MDN. If the.pattern
access is replaced with.source
, the output becomes correct.Version information:
The text was updated successfully, but these errors were encountered: