Set correct async/generator in IIFE for params (#11346)
* Set correct async/generator in IIFE for params * Reject in async params * Skip async test on node 6 (it doesn't support async fns)
This commit is contained in:
@@ -181,6 +181,13 @@ export default function convertFunctionParams(path, loose) {
|
||||
const bodyPath = path.get("body.body");
|
||||
const arrowPath = bodyPath[bodyPath.length - 1].get("argument.callee");
|
||||
arrowPath.arrowFunctionToExpression();
|
||||
|
||||
arrowPath.node.generator = path.node.generator;
|
||||
arrowPath.node.async = path.node.async;
|
||||
|
||||
// We don't reset "async" because if the default value of a parameter
|
||||
// throws, it must reject asynchronously.
|
||||
path.node.generator = false;
|
||||
} else {
|
||||
path.get("body").unshiftContainer("body", body);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user