From 7e435624cb7d6ea086507a7743b169c6f08fc024 Mon Sep 17 00:00:00 2001 From: LuanRT Date: Wed, 24 Aug 2022 04:16:57 -0300 Subject: [PATCH] fix(for-stmts): do not return if body type is `ExpressionStatement` --- src/nodes/ForStatement.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nodes/ForStatement.ts b/src/nodes/ForStatement.ts index cf5cd47..71745d0 100644 --- a/src/nodes/ForStatement.ts +++ b/src/nodes/ForStatement.ts @@ -33,8 +33,9 @@ export default class ForStatement { visitor.visitNode(node.update); } - if (body) + if (body && node.body.type !== 'ExpressionStatement') { return body; + } } } } \ No newline at end of file