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.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/transpile_js.rs b/src/transpile_js.rs
index 1ec9a10..7c8932f 100644
--- a/src/transpile_js.rs
+++ b/src/transpile_js.rs
@@ -10,8 +10,10 @@ impl TranspileJS for ModelicaModel {
fn repr_js(&self) -> Result<String, String> {
let mut constants = vec![];
for (c, e) in self.get_constant_vars() {
- constants.push(format!("var {} = {};",
- c, try!(e.repr_js())));
+ if let Some(v) = e {
+ constants.push(format!("var {} = {};",
+ c, try!(v.repr_js())));
+ }
}
let mut binds = vec![];
let mut outputs = vec![];