Hi,

I have a problem with Object.isNumber() because it test only for type
number and not for the object Number.

http://prototype.lighthouseapp.com/projects/8886-prototype/tickets/375-objectisnumber-is-false-for-number-object

With Webkit (5525.20.1) and Protototype 1.6.0.3 :

var a = new Number(4);
typeof a;
=> "object"
a instanceof Number;
=> true
Object.isNumber(a);
=> false

var b = 4;
typeof b;
=> "number"
b instanceof Number;
=> false
Object.isNumber(b);
=> true

The function should be :
======
  isNumber: function(object) {
    return typeof ((object == 'number') || (object instanceof
Number));
  },
======


Bug 2
http://prototype.lighthouseapp.com/projects/8886-prototype/tickets/376-hashtoquerystring-forgets-number-object

I modified Hash.toQueryString() so it put Number object in the Query
String :
======
    toQueryString: function() {
      return this.inject([], function(results, pair) {
        var key = encodeURIComponent(pair.key), values = pair.value;

        if (values && typeof values == 'object') {
          if (Object.isArray(values))
            return results.concat(values.map(toQueryPair.curry(key)));
          if (Object.isNumber(values))
            return results.push(toQueryPair(key, values.toString()));
        } else results.push(toQueryPair(key, values));
        return results;
      }).join('&');
    },
=======

Cordially,
Alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to