increase test coverage

This commit is contained in:
Sebastian McKenzie
2015-11-10 14:26:40 -08:00
parent a55f210c7f
commit 884252b90f
6 changed files with 23 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "babel-plugin-transform-regenerator",
"author": "Ben Newman <bn@cs.stanford.edu>",
"description": "",
"description": "Explode async and generator functions into a state machine.",
"version": "6.0.18",
"homepage": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator",
"main": "lib/index.js",

View File

@@ -37,13 +37,7 @@ exports.visitor = {
return;
}
if (node.expression) {
// Transform expression lambdas into normal functions.
node.expression = false;
node.body = t.blockStatement([
t.returnStatement(node.body)
]);
}
path.ensureBlock();
if (node.async) {
path.get("body").traverse(awaitVisitor);