Does your Browser conform?
Brendan Eich asks, in a comment on Class-based OOP in Javascript done right:
ECMA-262 Edition 3 (http://www.mozilla.org/js/language/E262-3.pdf among other places) specifies (13.2.2 [[Construct]] in function objects, step 7) that the result of new C for a function C is the value returned from C if that value is an object.
What browsers fail to get this right?
This:
var foo = {toString: function () { return "the only Foo"; }};
function Foo() {
return foo;
}
works in Opera 8.52,
Firefox 1.5.0.1 and
IE 6.0.2900 on Windows. It works in Opera 8.52.2190, Firefox 1.5.0.1, and Safari 2.0.3 on OS X. You can try your favorite browser by pushing this button:
Unfortunately for us, it does NOT work for any Flash player, and one of our target runtimes is Flash.









March 27th, 2006 at 6:41 am
Works here too:
Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1
March 29th, 2006 at 6:41 pm
This also works in rhino, specifically rhino 1.6 release 2 2005 09 19.
April 1st, 2006 at 6:06 pm
Opera, Version 9.00, Build 8333, Platform Windows XP
April 1st, 2006 at 6:07 pm
ah, forgot - works for me.
April 4th, 2006 at 8:27 pm
It worked for me in Safari 1.3.2 (v312.6) using Mac OSX 10.3.9, except that the mouse cursor didn’t change to indicate that the button is a button.
April 6th, 2006 at 1:57 pm
Works even with konqueror
Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.2 (like Gecko)
May 13th, 2006 at 4:19 am
Works on Mac OS X 10.4 with Camino Version 2006021400 (1.0Int) installed.
May 23rd, 2006 at 7:27 am
doesn’t want to work in LINKS ;]
guyz, u r doing great job! thank u
May 29th, 2006 at 3:04 pm
a mi No me funciona ( not work ) la pagina de prueba, donde deberian aparecer 3 fotos, solo se ven 3 puntitos.
esta pagina, en la que estoy ahora, si funciona.
estoy con el opera.
saludos
Javier
September 12th, 2006 at 2:31 pm
1) Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
2) Opera/9.01 (Windows NT 5.1; U; en)
In both browsers it works like a charm.