transform-regenerator: set node.id to an identifier if null - fixes #2835
This commit is contained in:
parent
fc0baf1e2c
commit
940b86dadb
@ -146,6 +146,10 @@ function getOuterFnExpr(funPath) {
|
||||
var node = funPath.node;
|
||||
t.assertFunction(node);
|
||||
|
||||
if (!node.id) {
|
||||
node.id = funPath.scope.parent.generateUidIdentifier("callee");
|
||||
}
|
||||
|
||||
if (node.generator && // Non-generator functions don't need to be marked.
|
||||
t.isFunctionDeclaration(node)) {
|
||||
var pp = funPath.findParent(function (path) {
|
||||
@ -171,9 +175,7 @@ function getOuterFnExpr(funPath) {
|
||||
);
|
||||
}
|
||||
|
||||
return node.id || (
|
||||
node.id = funPath.scope.parent.generateUidIdentifier("callee")
|
||||
);
|
||||
return node.id;
|
||||
}
|
||||
|
||||
function getRuntimeMarkDecl(blockPath) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user