Add ArrowFunctionExpression to opaqueTypes#277
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
| let opaqueTypes = { | ||
| FunctionExpression: true | ||
| FunctionExpression: true, | ||
| ArrowFunctionExpression: true |
There was a problem hiding this comment.
This makes a ton of sense!
Using arrow functions inside generators:
throws:
But works fine with
FunctionExpressions and arrow functions withoutBlockStatements:The root of the problems lies in the
explodeStatementmethod where we check node for the leaps and 2 of working cases returnsfalse, but the one with ArrowFunctionExpression + BlockStatement -true.Resolves: babel/babel-preset-env#160 and other cases without
babel-plugin-transform-es2015-arrow-functions.