Skip to content

Commit

Permalink
fix: generalise in initialization expression for for statement
Browse files Browse the repository at this point in the history
  • Loading branch information
lydiagarms committed Jul 18, 2024
1 parent 257938f commit 9160566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/codeGenerators/orchestration/nodejs/toOrchestration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function codeGenerator(node: any, options: any = {}): any {
if (!node.initialValue.operator) {
if (!node.initialValue.nodeType) return `\nlet ${codeGenerator(node.declarations[0])};`
// local var dec
if (node.initialValue.nodeType === 'Literal' && !node.isInitializationExpression) return `\nlet ${codeGenerator(node.declarations[0])} = generalise(${codeGenerator(node.initialValue)});`;
if (node.initialValue.nodeType === 'Literal' && node.isInitializationExpression) return `\nlet ${codeGenerator(node.declarations[0])} = ${codeGenerator(node.initialValue)};`;
return `\nlet ${codeGenerator(node.declarations[0])} = generalise(${codeGenerator(node.initialValue)});`;
}
return `\nlet ${codeGenerator(node.initialValue)};`;
Expand Down

0 comments on commit 9160566

Please sign in to comment.