Firefox3 beta3 has a strange Array behaviour

See Alex’s blog entry he posted the problem with Firefox3 beta3!
In short


>>> typeof []
"object"
>>> var a = [];
>>> var b = new Array();
>>> a.constructor == b.constructor
false
>>> c = [];
[]
>>> c.constructor == a.constructor
true
>>> d = new Array();
[]
>>> b.constructor == d.constructor;
true
>>> b.constructor == a.constructor;
false

After reading Eugene’s article about functional fun with dojo I wanted to play with dojox.lang.functional, and got stuck right away on one of the first calls.


>>> dojo.require("dojox.lang.functional")
>>> dojo.require("dojox.lang.functional.fold")
>>> df = dojox.lang.functional
>>> df.reduce([1,2,3], "+")
TypeError: a.hasNext is not a function

Oops, that was not what I expected, thanks to Alex’s help Firefox3 beta3 could be identified as the one who causes the problem. And I filed a bug there, so lets hope the next Firefox beta/version does it right.

[Update] The bug seems to be in FireBug, not in Firefox

1 Comment »

  1. Pythoneer » It seems to be a Firebug Bug said,

    February 18, 2008 at 6:00 pm

    [...] reporting the mentioned bug to the Firefox guys they were not able to confirm it, and they are right! It seems to be a Firebug [...]

RSS feed for comments on this post · TrackBack URL

Leave a Comment