[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-09 Thread atrepp
I learnt something, i didn't know that you can use Number as a function, i think i will move to primitives. thanks, Alex :) On 9 oct, 15:40, kangax <[EMAIL PROTECTED]> wrote: > On Oct 9, 4:11 am, atrepp <[EMAIL PROTECTED]> wrote: > > > You are surely right about the utility of Number object over

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-09 Thread kangax
On Oct 9, 4:11 am, atrepp <[EMAIL PROTECTED]> wrote: > You are surely right about the utility of Number object over > primitives and the overhead it can be. I use the Number Constructor to > parse string and convert to Number and store it like that in my cache. Why don't you use `Number` (as a fu

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-09 Thread atrepp
I just want to be compatible with Firefox or Webkit. I don't use IE :) On 9 oct, 10:18, Tobie Langel <[EMAIL PROTECTED]> wrote: > > there are other custom objects that inherits from Number. > > And that works cross-browser !? > > Best, > > Tobie --~--~-~--~~~---~--~---

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-09 Thread Tobie Langel
> there are other custom objects that inherits from Number. And that works cross-browser !? Best, Tobie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to p

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-09 Thread atrepp
You are surely right about the utility of Number object over primitives and the overhead it can be. I use the Number Constructor to parse string and convert to Number and store it like that in my cache. In the cache, there are other custom objects that inherits from Number. Cordially, Alex On 8 o

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-08 Thread Andrew Dupont
No, you were completely right — either it should support both the primitive and the wrapper _or_ we need to document why it does not. I was prepared to say we'd do the latter, since I didn't want to deal with the differences between the two, but it turns out there _are_ no differences, save for th

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-08 Thread Tom Gregory
On Oct 8, 2008, at 11:29 AM, Andrew Dupont wrote: > I shall end the shitstorm here and now. > > ... he probably can't think of a single case in which it's > _useful_ to use the wrapper objects instead of the primitives they > wrap. Honestly, I can't either. I don't see any reason to use t

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-08 Thread Andrew Dupont
I shall end the shitstorm here and now. To quote the rhino book: "Once we've created a string object S [through `new String`], what can we do with it? Nothing that we cannot do with the corresponding primitive string value. If we use the `typeof` operator, it tells us that S is indeed an object,

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-08 Thread Mona Remlawi
why go throw all this complexity when javascript has a native isNaN function... On Wed, Oct 8, 2008 at 6:40 PM, Tom Gregory <[EMAIL PROTECTED]> wrote: > > Thanks for the reply. > > I realize I don't get a vote here, but IMHO it either needs to be a) > well documented that Object.isNumber( new Nu

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-08 Thread Tom Gregory
Thanks for the reply. I realize I don't get a vote here, but IMHO it either needs to be a) well documented that Object.isNumber( new Number(5) ) returns false, or b) support the Number class. The trouble with the name "isNumber" is that it's ambiguous--it can mean equally "is a number" or

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-08 Thread Jerod Venema
POLS is a no-brainer here. Since this IS a legit line in javascript: var n = new Number(4); then saying: Object.isNumber(n); => false is ridiculous. Regardless of whether using "new Number" is preferred syntax or not, its craziness to claim that that's a valid response for that function. -Jero

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-08 Thread atrepp
I have a DB Cache where i store the value in Number object, i want to send back this value without to use valueOf each time. And Hash.toQueryString() is a good example why it should detect Number Object. I don't think that this function can ignore Number Object. Cordially, Alex On 7 oct, 17:05, k

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-07 Thread kangax
On Oct 7, 11:17 am, Tom Gregory <[EMAIL PROTECTED]> wrote: > How 'bout POLS? It's a bit hard to tell what "intuitive" definition of "number" is in a weakly typed language. According to ECMA-262 specs, an object created with `new Number` is not of type number but rather of type object. Besides so

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-07 Thread Tom Gregory
How 'bout POLS? TAG On Oct 7, 2008, at 9:05 AM, kangax wrote: > > Alex, > > I have already replied to you on Lighthouse, but, out of curiosity, > why do you need `isNumber` to "work" with objects? What's the usecase > and why plan type-conversion (before calling isNumber) doesn't satisfy > you?

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-07 Thread kangax
On Oct 7, 5:21 am, atrepp <[EMAIL PROTECTED]> wrote: > 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/37... > > With Webkit (5525.20.1) and Protototype 1.6.

[Prototype-core] Re: Bug : Object.isNumber() and Hash.toQueryString()

2008-10-07 Thread atrepp
Sorry It is not : if (Object.isNumber(values)) return results.push(toQueryPair(key, values.toString())); but if (Object.isNumber(values)) results.push(toQueryPair(key, values.toString())); On 7 oct, 11:21, atrepp <[EMAIL PROTECTED]> wrote: > Bug 2 http://prototype.lighthou