summaryrefslogtreecommitdiff
path: root/module/language/ecmascript/compile-ghil.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-02-22 11:06:13 +0100
committerAndy Wingo <wingo@pobox.com>2009-02-22 11:06:13 +0100
commitaf6c20b731c66397ab3886e162d6b6252d810cbb (patch)
tree3c39c5c35910f76e37f83af0cb05ef82d8211982 /module/language/ecmascript/compile-ghil.scm
parent8c306808c25fb1f353dca2b1d6a1356193e72dea (diff)
downloadguile-af6c20b731c66397ab3886e162d6b6252d810cbb.tar.gz
more arithmetic on non-numbers
* module/language/ecmascript/compile-ghil.scm (comp): Convert to number on unary +. * module/language/ecmascript/impl.scm: Define -, *, /, <, <=, >=, > operations on non-numbers.
Diffstat (limited to 'module/language/ecmascript/compile-ghil.scm')
-rw-r--r--module/language/ecmascript/compile-ghil.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/language/ecmascript/compile-ghil.scm b/module/language/ecmascript/compile-ghil.scm
index 1d1a94c69..3aa007a7e 100644
--- a/module/language/ecmascript/compile-ghil.scm
+++ b/module/language/ecmascript/compile-ghil.scm
@@ -89,7 +89,8 @@
(this
(@impl e l get-this '()))
((+ ,a)
- (make-ghil-inline e l 'add (list (comp a e) (make-ghil-quote e l 0))))
+ (make-ghil-inline e l 'add (list (@impl e l ->number (list (comp a e)))
+ (make-ghil-quote e l 0))))
((- ,a)
(make-ghil-inline e l 'sub (list (make-ghil-quote e l 0) (comp a e))))
((~ ,a)