transform-regenerator: set node.id to an identifier if null - fixes #2835

This commit is contained in:
Henry Zhu 2015-11-05 20:10:15 -05:00
parent fc0baf1e2c
commit 940b86dadb

View File

@ -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) {