From 19eb25c2f1263988f67ff72f632dea50b8e3f8dd Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 27 Feb 2017 18:54:25 -0400 Subject: - console.log is now defined when starting compilation, and not when LuxRT is compiled, to avoid issues when compiling a partially-cached program. --- luxc/src/lux/compiler/js.clj | 3 ++- luxc/src/lux/compiler/js/rt.clj | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'luxc') diff --git a/luxc/src/lux/compiler/js.clj b/luxc/src/lux/compiler/js.clj index b43ab5b4d..fa4bf9518 100644 --- a/luxc/src/lux/compiler/js.clj +++ b/luxc/src/lux/compiler/js.clj @@ -161,7 +161,8 @@ (let [!err! *err*] (defn compile-program [mode program-module resources-dir source-dirs target-dir] (do (init! resources-dir target-dir) - (let [m-action (|do [_ (&&cache/pre-load-cache! source-dirs + (let [m-action (|do [_ (&&/run-js! "var console = { log: print };") + _ (&&cache/pre-load-cache! source-dirs &&js-cache/load-def-value &&js-cache/install-all-defs-in-module &&js-cache/uninstall-all-defs-in-module) diff --git a/luxc/src/lux/compiler/js/rt.clj b/luxc/src/lux/compiler/js/rt.clj index e9dfa451b..b1c1aeb1b 100644 --- a/luxc/src/lux/compiler/js/rt.clj +++ b/luxc/src/lux/compiler/js/rt.clj @@ -1197,8 +1197,7 @@ (def LuxRT "LuxRT") (def compile-LuxRT - (|do [_ (&&/run-js! "var console = { log: print };") - :let [rt-object (str "{" (->> (merge lux-methods + (|do [:let [rt-object (str "{" (->> (merge lux-methods adt-methods i64-methods n64-methods -- cgit v1.2.3