Skip to content

Commit 2b7d27d

Browse files
committed
Fixed blockless arrowFunctions
1 parent 3c06dd7 commit 2b7d27d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hertzscript-compiler",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "Produces preemptible JavaScript coroutines which conform to the HertzScript specification.",
55
"keywords": [
66
"javascript",

src/BabelPlugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ function Plugin(babel) {
159159
funcExp.type = "FunctionExpression";
160160
if (funcExp.body.type !== "BlockStatement") {
161161
funcExp.body = t.blockStatement([
162-
t.returnStatement(funcExp.body)
162+
t.expressionStatement(
163+
t.yieldExpression(hzReturnArg(funcExp.body)))
163164
]);
164165
}
165166
return t.callExpression(

0 commit comments

Comments
 (0)