diff options
author | Eduardo Julian | 2018-04-06 08:32:41 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-04-06 08:32:41 -0400 |
commit | ca238f9c89d3156842b0a3d5fe24a5d69b2eedb0 (patch) | |
tree | 50ba106541f2357daf27393df28e8b263f7311e1 /new-luxc/source/luxc/lang/translation/js/eval.jvm.lux | |
parent | 84d7e87817cd2c074653b34d028c8fa807febc7f (diff) |
- Adapted new-luxc's code to latest stdlib changes.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/js/eval.jvm.lux | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux index d4546ca4c..3d4dbc782 100644 --- a/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux @@ -11,6 +11,16 @@ (lang (host [js #+ JS Expression Statement]))) [//]) +(do-template [<name>] + [(exception: #export (<name> {message Text}) + message)] + + [Unknown-Kind-Of-JS-Object] + [Null-Has-No-Lux-Representation] + + [Cannot-Evaluate] + ) + (host.import java/lang/Object (toString [] String)) @@ -101,9 +111,6 @@ (#.Some output)))) #.None)) -(exception: #export Unknown-Kind-Of-JS-Object) -(exception: #export Null-Has-No-Lux-Representation) - (def: (lux-object js-object) (-> Object (Error Top)) (`` (cond (host.null? js-object) @@ -152,11 +159,9 @@ ## else (ex.throw Unknown-Kind-Of-JS-Object (Object::toString [] (:! Object js-object)))))) -(exception: #export Cannot-Evaluate) - (def: #export (eval code) (-> Expression (Meta Top)) - (function [compiler] + (function (_ compiler) (case (|> compiler (get@ #.host) (:! //.Host) |