Merge pull request #2858 from hzoo/i-2835

transform-regenerator: set node.id to an identifier if null - fixes #…
This commit is contained in:
Sebastian McKenzie 2015-11-06 01:28:37 +00:00
commit 5508f4de56

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