-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Emit function name when emitting arrow functions in ES5 #46042
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
Conversation
src/compiler/transformers/es2015.ts
Outdated
@@ -4417,4 +4421,40 @@ namespace ts { | |||
return isIdentifier(expression) && expression.escapedText === "arguments"; | |||
} | |||
} | |||
|
|||
function forEachFreeIdentifier(node: Node, cb: (id: Identifier) => void): void { |
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.
I've copied this one from src/services/codefixes/convertToEs6Module.ts
. What will be the best place to put it so it can be shared?
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.
src/compiler/utilities.ts
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.
@andrewbranch thanks, done
A little concerned about the tree walk, but let's see what the perf suite shows. @typescript-bot perf test this |
Heya @DanielRosenwasser, I've started to run the perf test suite on this PR at 34f6e9d. You can monitor the build here. Update: The results are in! |
@DanielRosenwasser Here they are:Comparison Report - main..46042
System
Hosts
Scenarios
Developer Information: |
@DanielRosenwasser It seems that the perf results look fine. Could you please check my comment above about the placement of utility functions? |
@DanielRosenwasser @andrewbranch @sandersn Any chance this will make it to the 4.6? |
The bug for this change is old and, unfortunately, es5 is still the default target for Typescript, so this would change emit all over the world for very little benefit, as laid out in @rbuckton's comment on the bug. We should not take this PR or fix the bug. |
Fixes #6433.