diff options
author | Eduardo Julian | 2019-03-18 18:36:18 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-03-18 18:36:18 -0400 |
commit | 285de1ae1925c2b030bd96032498ccbaa6fc90c9 (patch) | |
tree | 3b1de3dc90b3f9f8b21289f37b6fb043c447fec4 /lux-js | |
parent | 0fcb373ed1cdc2750f02e5535d29569dd8ae5a5b (diff) |
Cobbled together a simple packager.
Diffstat (limited to 'lux-js')
-rw-r--r-- | lux-js/source/program.lux | 7 |
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)) |