-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace null
in ArrayExpression
and ArrayPattern
with Null
node
#9857
base: main
Are you sure you want to change the base?
Conversation
@@ -272,4 +277,36 @@ function includeShebang(ast, options) { | |||
} | |||
} | |||
|
|||
function replaceNullElements(node, ast, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment that explain motivation to introduce Null
node or link to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thorn0 Could you review?
Are these tracked somewhere? By And I thought of one more case: call(foo,,/*a*/,/*b*/,bar) |
Yes, opened an issue to track this #10046 |
🤔 Still blocked? |
Description
Add a dummy node for
null
in array, so we can attach comments. This solution should work for other similar problem, like #9787 (comment) orfor(;;);
Fixes #1013
Fixes #9299
Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨