On Wednesday 11 February 2009 05:06:55 RobG wrote:
The language is designed so you shouldn't need to care. I think this
helps the argument of why functions like isString are not a good
idea. If you want to test for specific properties or features of an
object, test for them. Don't test
On Feb 8, 1:19 pm, RobG rg...@iinet.net.au wrote:
On Feb 8, 12:55 am, Jim Higson j...@333.org wrote:
alert( Object.isString( foo ));
// alerts string
It alerts true.
So it does ^-)
alert( Object.isString( new String( foo ) ));
// alerts object
It alerts false.
^-) again
I know
2009/2/10 Jim Higson j...@333.org:
On Feb 8, 1:19 pm, RobG rg...@iinet.net.au wrote:
On Feb 8, 12:55 am, Jim Higson j...@333.org wrote:
alert( Object.isString( foo ));
// alerts string
It alerts true.
So it does ^-)
alert( Object.isString( new String( foo ) ));
// alerts object
Ha. I'm relatively new to JS and I though that ...
var s_String = bob;
was just a shortcut for
var s_LooksLikeAStringButDoesNotGoQuack = new String(bob);
I always thought that internally they were the same thing.
I think a lot of people who used Javascript for a long time think the
2009/2/10 Jim Higson j...@333.org:
Ha. I'm relatively new to JS and I though that ...
var s_String = bob;
was just a shortcut for
var s_LooksLikeAStringButDoesNotGoQuack = new String(bob);
I always thought that internally they were the same thing.
I think a lot of people who used
What does new String(bob) offer over normal bob?
As far as I know, nothing. Hence my assertion that Prototype should
treat object strings as if they were a normal string.
Hmmm... actually I should have said nothing I've ever found
useful :-)
With
2009/2/10 Jim Higson j...@333.org:
What does new String(bob) offer over normal bob?
As far as I know, nothing. Hence my assertion that Prototype should
treat object strings as if they were a normal string.
Hmmm... actually I should have said nothing I've ever found
useful :-)
With
On Feb 10, 10:05 am, Richard Quadling rquadl...@googlemail.com
wrote:
[...]
So, it seems the only place where things go wonky is with eval().
`eval ` treats passed string as a Program, and evaluates it as such.
There's nothing wonky about it : )
And the odd behaviour indicates that the
On Feb 10, 9:35 pm, Jim Higson j...@333.org wrote:
On Feb 8, 1:19 pm, RobG rg...@iinet.net.au wrote:
[...]
It's a bit unfair to blame the language for what you consider an
inappropriate use of one of its features. Perhaps the name of the
function should be isStringPrimitive.
I guess I
On Feb 8, 12:55 am, Jim Higson j...@333.org wrote:
alert( Object.isString( foo ));
// alerts string
It alerts true.
alert( Object.isString( new String( foo ) ));
// alerts object
It alerts false.
I know why this happens - because Prototype uses the underlying typeof's
understanding
On Feb 8, 8:19 am, RobG rg...@iinet.net.au wrote:
[...]
It can hardly be called a bug when it does what the documentation says
it does (I think works as designed is the polite response). The
function itself is a bit pointless though, as are similar functions
like isNumber, e.g.
It's not
On Feb 8, 11:53 pm, kangax kan...@gmail.com wrote:
On Feb 8, 8:19 am, RobG rg...@iinet.net.au wrote:
[...]
It can hardly be called a bug when it does what the documentation says
it does (I think works as designed is the polite response). The
function itself is a bit pointless though, as
On Feb 9, 11:37 am, kangax kan...@gmail.com wrote:
On Feb 8, 7:32 pm, RobG rg...@iinet.net.au wrote:
On Feb 8, 11:53 pm, kangax kan...@gmail.com wrote:
[...]
It's not pointless, but the scope of its use is indeed pretty narrow.
Can you provide a scenario where isNumber is more
On Feb 8, 9:59 pm, RobG rg...@iinet.net.au wrote:
On Feb 9, 11:37 am, kangax kan...@gmail.com wrote:
[...]
Of course. `isNumber` (as it is in a trunk) will return `true` for
Number *object*, while `typeof` will obviously return object.
Whether Number objects are something that should be
That's been fixed in trunk.
Best,
Tobie
On Feb 7, 3:55 pm, Jim Higson j...@333.org wrote:
alert( Object.isString( foo ));
// alerts string
alert( Object.isString( new String( foo ) ));
// alerts object
I know why this happens - because Prototype uses the underlying typeof's
On Feb 7, 9:55 am, Jim Higson j...@333.org wrote:
alert( Object.isString( foo ));
// alerts string
alert( Object.isString( new String( foo ) ));
// alerts object
I know why this happens - because Prototype uses the underlying typeof's
understanding of type.
Personally I think this is a
16 matches
Mail list logo