Fix unbound variables and unbound values
authorSjoerd van Leent <svanleent@gmail.com>
Sat, 9 Jun 2012 01:21:08 +0000 (21:21 -0400)
committerNoah Lavine <noah.b.lavine@gmail.com>
Sat, 9 Jun 2012 01:21:08 +0000 (21:21 -0400)
* module/language/ecmascript/base.scm: fix two wrong variable names and a wrong
  number of arguments in a function call.

module/language/ecmascript/base.scm

index b244bec..6f5c65b 100644 (file)
@@ -92,7 +92,7 @@
   (pdel o (string->symbol p)))
 
 (define-method (has-property? (o <js-object>) p)
-  (if (hashq-get-handle (js-props o) v)
+  (if (hashq-get-handle (js-props o) p)
       #t
       (let ((proto (js-prototype o)))
         (if proto
         ((boolean? x) (if x 1 0))
         ((null? x) 0)
         ((eq? x *undefined*) +nan.0)
-        ((is-a? x <js-object>) (object->number x))
+        ((is-a? x <js-object>) (object->number x #t))
         ((string? x) (string->number x))
-        (else (throw 'TypeError o '->number))))
+        (else (throw 'TypeError x '->number))))
 
 (define (->integer x)
   (let ((n (->number x)))