From 27648dd619f1764ba58ca244e9fd0b017665058d Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 2 Mar 2017 18:09:03 -0400 Subject: - Fixed a bug in which the value of a loop wasn't being returned. --- luxc/src/lux/compiler/js/lux.clj | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/luxc/src/lux/compiler/js/lux.clj b/luxc/src/lux/compiler/js/lux.clj index e0d5a4247..5c6039d2b 100644 --- a/luxc/src/lux/compiler/js/lux.clj +++ b/luxc/src/lux/compiler/js/lux.clj @@ -91,7 +91,7 @@ register-inits (&/map% compile inits) =body (compile body)] (return (str "(function _loop(" (->> registers (&/|interpose ",") (&/fold str "")) ") {" - =body + (str "return " =body ";") "})(" (->> register-inits (&/|interpose ",") (&/fold str "")) ")")) )) @@ -343,9 +343,7 @@ _ false) - def-type (&a/expr-type* ?body) - ;; _ (&/|log! (string/replace def-js "" "^@")) - ] + def-type (&a/expr-type* ?body)] _ (&&/save-js! ?name def-js) def-value (&&/run-js!+ var-name) _ (&/without-repl-closure -- cgit v1.2.3