aboutsummaryrefslogtreecommitdiff
path: root/lux-js/source
diff options
context:
space:
mode:
authorEduardo Julian2019-03-18 18:36:18 -0400
committerEduardo Julian2019-03-18 18:36:18 -0400
commit285de1ae1925c2b030bd96032498ccbaa6fc90c9 (patch)
tree3b1de3dc90b3f9f8b21289f37b6fb043c447fec4 /lux-js/source
parent0fcb373ed1cdc2750f02e5535d29569dd8ae5a5b (diff)
Cobbled together a simple packager.
Diffstat (limited to 'lux-js/source')
-rw-r--r--lux-js/source/program.lux7
1 files changed, 4 insertions, 3 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux
index 9cd93a9eb..0a723ec30 100644
--- a/lux-js/source/program.lux
+++ b/lux-js/source/program.lux
@@ -449,15 +449,16 @@
(wrap [])))
(def: (define! interpreter [module name] input)
- (-> javax/script/ScriptEngine Name _.Expression (Error [Text Any]))
+ (-> javax/script/ScriptEngine Name _.Expression (Error [Text Any _.Statement]))
(let [global (format (text.replace-all .module-separator ..separator module)
..separator (name.normalize name)
"___" (%n (text/hash name)))
@global (_.var global)]
(do error.monad
- [_ (execute! interpreter global (_.define @global input))
+ [#let [definition (_.define @global input)]
+ _ (execute! interpreter global definition)
value (evaluate! interpreter global @global)]
- (wrap [global value]))))
+ (wrap [global value definition]))))
(type: Host
(generation.Host _.Expression _.Statement))