-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Remove folding Array.prototype.concat (fix #577) #578
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,16 +32,6 @@ module.exports = ({ types: t }) => { | |
} | ||
}, | ||
calls: { | ||
concat(...args) { | ||
return t.arrayExpression( | ||
this.elements.concat( | ||
...args.map(arg => { | ||
if (t.isArrayExpression(arg)) return arg.elements; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to check if any of these are variables instead of removing this entirely? For example, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it really common to use constants here in concat ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess not. |
||
return arg; | ||
}) | ||
) | ||
); | ||
}, | ||
join(sep = t.stringLiteral(",")) { | ||
if (!t.isStringLiteral(sep)) return; | ||
let bad = false; | ||
|
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.
You might want to test this with
push
since you’re removing it: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 👍