optional async transformers should remove their ids - fixes #552
This commit is contained in:
@@ -20,10 +20,12 @@ module.exports = function (node, callId, scope) {
|
||||
traverse(node, visitor, scope);
|
||||
|
||||
var call = t.callExpression(callId, [node]);
|
||||
var id = node.id;
|
||||
delete node.id;
|
||||
|
||||
if (t.isFunctionDeclaration(node)) {
|
||||
var declar = t.variableDeclaration("var", [
|
||||
t.variableDeclarator(node.id, call)
|
||||
var declar = t.variableDeclaration("let", [
|
||||
t.variableDeclarator(id, call)
|
||||
]);
|
||||
declar._blockHoist = true;
|
||||
return declar;
|
||||
|
||||
@@ -10,7 +10,6 @@ exports.manipulateOptions = function (opts) {
|
||||
|
||||
exports.optional = true;
|
||||
|
||||
|
||||
exports.Function = function (node, parent, scope, context, file) {
|
||||
if (!node.async || node.generator) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user