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.

10 Responses to “Does your Browser conform?”

  1. Sebastian Says:

    Works here too:
    Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1

  2. benshine Says:

    This also works in rhino, specifically rhino 1.6 release 2 2005 09 19.

  3. Adam Says:

    Opera, Version 9.00, Build 8333, Platform Windows XP

  4. Adam Says:

    ah, forgot - works for me.

  5. Eric Says:

    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.

  6. Massimiliano Mazzarolo Says:

    Works even with konqueror
    Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.2 (like Gecko)

  7. bigj Says:

    Works on Mac OS X 10.4 with Camino Version 2006021400 (1.0Int) installed.

  8. molder Says:

    doesn’t want to work in LINKS ;]
    guyz, u r doing great job! thank u

  9. Javier Says:

    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

  10. SwitchBL8 Says:

    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.