Subject: [PATCH] Fixed unbound variables and unbound values for the ecmascript base Guile scheme file.

From: Sjoerd van Leent <[email-masked]>
Date: Mon, 21 May 2012 20:50:46 +0200

Afftected are:
  module/langyage/ecmascript/base.scm:

  - has-property? should check against the value p instead of v when
    handling hashq-get-handle

  - When x is of type <js-object> on line 179, it should be appending #t to
    the call to object->number, as object->number requires it

  - Within the same bit, a few lines later, A TypeError should be thrown
    using the value x instead of the non-existant value o
---
 module/language/ecmascript/base.scm |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/module/language/ecmascript/base.scm b/module/language/ecmascript/base.scm
index b244bec..6f5c65b 100644
--- a/module/language/ecmascript/base.scm
+++ b/module/language/ecmascript/base.scm
@@ -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
@@ -176,9 +176,9 @@
         ((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)))