Skip to content

Commit e57b0c1

Browse files
committed
fix statement doubling when implicitly returning an export
1 parent 04a1d82 commit e57b0c1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

moonscript/transform.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,10 @@ Statement = Transformer({
462462
})
463463
else
464464
return build.group({
465-
node,
465+
{
466+
"export",
467+
node[2]
468+
},
466469
build.assign({
467470
names = node[2],
468471
values = node[3]

moonscript/transform.moon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,9 @@ Statement = Transformer {
263263
cls
264264
}
265265
else
266+
-- pull out vawlues and assign them after the export
266267
build.group {
267-
node
268+
{ "export", node[2] }
268269
build.assign {
269270
names: node[2]
270271
values: node[3]

0 commit comments

Comments
 (0)