unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Sjoerd van Leent <svanleent@gmail.com>
To: 10623@debbugs.gnu.org
Cc: Sjoerd van Leent <svanleent@gmail.com>
Subject: bug#10623: [PATCH] Fixed unbound variables and unbound values for the ecmascript base Guile scheme file.
Date: Mon, 21 May 2012 20:50:46 +0200	[thread overview]
Message-ID: <1337626246-3639-2-git-send-email-svanleent@gmail.com> (raw)
In-Reply-To: <1337626246-3639-1-git-send-email-svanleent@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]


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(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fixed-unbound-variables-and-unbound-values-for-the-e.patch --]
[-- Type: text/x-patch; name="0001-Fixed-unbound-variables-and-unbound-values-for-the-e.patch", Size: 868 bytes --]

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)))

  reply	other threads:[~2012-05-21 18:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27  8:31 bug#10623: Bugs in ecmascript/base.scm Mark H Weaver
2012-05-21 18:50 ` bug#10623: [PATCH] Fixed unbound variables and unbound values Sjoerd van Leent
2012-05-21 18:50   ` Sjoerd van Leent [this message]
2012-07-04 19:00     ` bug#10623: [PATCH] Fixed unbound variables and unbound values for the ecmascript base Guile scheme file Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337626246-3639-2-git-send-email-svanleent@gmail.com \
    --to=svanleent@gmail.com \
    --cc=10623@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).