aboutsummaryrefslogtreecommitdiffstats
path: root/src/transpile_js.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transpile_js.rs')
-rw-r--r--src/transpile_js.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/transpile_js.rs b/src/transpile_js.rs
index b14b964..5ca16e6 100644
--- a/src/transpile_js.rs
+++ b/src/transpile_js.rs
@@ -27,13 +27,14 @@ impl TranspileJS for ModelicaModel {
.to_string());
}
}
+ let args: Vec<String> = self.get_free_vars().iter().map(|s| s.clone()).collect();
Ok(format!(r#"function {slug}({args}) {{
{constants}
{binds}
return [{outputs}];
}}"#,
slug = "f",
- args = self.get_free_vars().join(", "),
+ args = args.join(", "),
constants = constants.join("\n "),
binds = binds.join("\n "),
outputs = outputs.join(", ")))