diff options
author | Ian Price <ianprice90@googlemail.com> | 2015-06-24 19:57:28 +0100 |
---|---|---|
committer | Ian Price <ianprice90@googlemail.com> | 2015-06-24 19:57:28 +0100 |
commit | 89029a54f43e7698e7ddb5f72ada4c44ec5a1c68 (patch) | |
tree | e9619428de3e67d425f09541090e806a3ecd6071 /module/language/javascript | |
parent | b631576f13677e7834a9604ee6b664f0ff2acc06 (diff) | |
download | guile-89029a54f43e7698e7ddb5f72ada4c44ec5a1c68.tar.gz |
Explicitly test for undefined arguments to handle false values like 0
Diffstat (limited to 'module/language/javascript')
-rw-r--r-- | module/language/javascript/simplify.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/module/language/javascript/simplify.scm b/module/language/javascript/simplify.scm index b3360aa40..2e3bde5f0 100644 --- a/module/language/javascript/simplify.scm +++ b/module/language/javascript/simplify.scm @@ -40,7 +40,15 @@ (flatten-block else))) (($ call function args) (make-call (flatten-exp function) - (map flatten-exp args))))) + (map flatten-exp args))) + + (($ ternary test then else) + (make-ternary (flatten-exp test) + (flatten-exp then) + (flatten-exp else))) + (($ prefix op exp) + (make-prefix op (flatten-exp exp))) + )) (define (maybe-make-block exp) (match exp ((exp) exp) |