-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Has PRoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
This is a feature request (I think). Arguments are not optimized if an inner function shadows the name with a parameter (or rest parameters in my case).
Input Code
const log = (...args) => console.log(...args);
function test_opt(...args) {
log(...args);
}
function test_deopt(...args) {
const fn = (...args) => log(...args);
fn(...args);
}Babel Configuration (.babelrc, package.json, cli command)
{
"presets": [ "es2015" ]
}Expected vs. Current Behavior
I'd expect the code to be optimizable to use .apply( thisArg, arguments ) throughout.
However, in test_deopt the outer ...args gets copied just to be passed into the inner fn.
I can verify that the problem disappears if I rename either the ...args of test_deopt or of the fn arrow function.
Environment
| software | version(s) |
|---|---|
| Babel | 6.24.1 |
| node | 6.9.5 |
| npm | N/A (yarn 0.20.3) |
| Operating System | macOS |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has PRoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue