diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/js.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/js.lux | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js.lux b/new-luxc/source/luxc/lang/translation/js.lux index 9b1b2b503..680439355 100644 --- a/new-luxc/source/luxc/lang/translation/js.lux +++ b/new-luxc/source/luxc/lang/translation/js.lux @@ -35,8 +35,10 @@ (host.import java/lang/Long (intValue [] Integer)) -(host.import java/lang/AbstractStringBuilder - (append [String] AbstractStringBuilder)) +(host.import java/lang/CharSequence) + +(host.import java/lang/Appendable + (append [CharSequence] Appendable)) (host.import java/lang/StringBuilder (new []) @@ -80,8 +82,8 @@ (def: #export module-js-name Text "module.js") -(def: #export (init-module-buffer _) - (-> Top (Meta Unit)) +(def: #export init-module-buffer + (Meta Unit) (function [compiler] (#e.Success [(update@ #.host (|>> (:! Host) @@ -297,12 +299,6 @@ (:! Object))) )) -## (def: (wrap-lux-object object) -## (-> Top JSObject) -## (if (host.instance? JSObject object) -## (lux-obj object) -## obj)) - (def: #export unit Text "\u0000") (def: (module-name module) @@ -319,7 +315,8 @@ (-> JS (Meta Unit)) (do macro.Monad<Meta> [module-buffer module-buffer - #let [_ (AbstractStringBuilder::append [code] module-buffer)]] + #let [_ (Appendable::append [(:! CharSequence code)] + module-buffer)]] (execute code))) (def: #export (save-definition name code) @@ -333,7 +330,8 @@ module-buffer module-buffer program-buffer program-buffer #let [module-code (StringBuilder::toString [] module-buffer) - _ (AbstractStringBuilder::append [(format module-code "\n")] program-buffer)]] + _ (Appendable::append [(:! CharSequence (format module-code "\n"))] + program-buffer)]] (wrap (ioC.write target (format module "/" module-js-name) (|> module-code |