-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Babel 8] Remove some Scope
methods
#16705
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57810 |
Scope#{traverse,_renameFromMap}
Scope
methods
} else if (typeof i === "number") { | ||
args.push(t.numericLiteral(i)); | ||
|
||
// Used in array-rest to create an array from a subset of an iterable. | ||
helperName = "slicedToArray"; | ||
// TODO if (this.hub.isLoose("es6.forOf")) helperName += "-loose"; | ||
} else { | ||
// Used in array-rest to create an array | ||
helperName = "toArray"; | ||
} |
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.
In this file i
is always true
, right?
@@ -193,7 +248,7 @@ export class DestructuringTransformer { | |||
) { | |||
return node; | |||
} else { | |||
return this.scope.toArray(node, count, this.arrayLikeIsIterable); | |||
return toArray(this.scope, node, count, this.arrayLikeIsIterable); |
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.
Can we maybe inline the toArray
function here, given that this method is very short and already called toArray
?
|
||
let helperName; | ||
const args = [node]; | ||
if (i === true) { |
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.
Can i
ever be true
here?
f82fcb2
to
846227a
Compare
d76ac15
to
2ef5c1a
Compare
Fixes #1, Fixes #2