diff options
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)) |