Repository navigation
Add function name to spec-transformed arrow functions - #5620
Conversation
While it may appear that this should be done by es2015-function-name, another way to think about it is that es2015-function-name implements the naming that javascript engines are supposed to do; and javascript engines cannot name function expressions that are the object of a member expression.
|
@Kovensky, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hzoo and @existentialism to be potential reviewers. |
|
Hey @Kovensky! It looks like one or more of your builds have failed. I've copied the relevant info below to save you some time. |
Codecov Report
@@ Coverage Diff @@
## 7.0 #5620 +/- ##
=========================================
+ Coverage 84.59% 84.6% +0.01%
=========================================
Files 283 283
Lines 9738 9740 +2
Branches 2734 2735 +1
=========================================
+ Hits 8238 8241 +3
+ Misses 987 986 -1
Partials 513 513
Continue to review full report at Codecov.
|
| export default function ({ types: t }) { | ||
| // @flow | ||
|
|
||
| import nameFunction from "babel-helper-function-name"; |
There was a problem hiding this comment.
Looks like we need this in package.json?
There was a problem hiding this comment.
Hm, probably.
Would be nice if lerna could take care of it 😄
|
LGTM otherwise. |
|
Could you please update the example in https://github.com/babel/babel/blob/ef6f58ad22cd1399054a781294cd1bfb06ef2a97/packages/babel-plugin-transform-es2015-arrow-functions/README.md Otherwise looks good to me. |
|
We don't have an example for spec mode, did you mean we should add one @xtuc? Do you want to add it and squash merge? |
|
I would like to add an example for spec mode but I will probably do a separate PR. |
While it may appear that this should be done by es2015-function-name,
another way to think about it is that es2015-function-name implements
the naming that javascript engines are supposed to do; and javascript
engines cannot name function expressions that are the object of a
member expression.