W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2010

[whatwg] Should window.name be [Replaceable]?

From: Biju <bijumaillist@gmail.com>
Date: Mon, 5 Jul 2010 00:35:54 -0400
Message-ID: <AANLkTilpsqxHUZV90CVEJaI1RJ-DZ3wQDEtUo638Jm8c@mail.gmail.com>
On Mon, Jul 5, 2010 at 12:05 AM, Joseph Pecoraro <pecoraro at apple.com> wrote:
> ? ?- I didn't have access to IE to test. I'd appreciate
> ? ? ?someone giving it a shot to see how they act.

On IE8 it is printing "string,string,string"


And it looks like in Firefox
1) name = with_a_number changes type to matched the assigned value
2)  window.name = with_a_number keeps the previous type

See
   (function() {
       var arr = [];
       arr.push( typeof window.name );
       name = 1;
        // "number" if [Replaceable], "string" otherwise
       arr.push( typeof window.name );
       window.name = 1;
       arr.push( typeof window.name );
       alert( arr );
   })();

give ===> string,number,number
Received on Sunday, 4 July 2010 21:35:54 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:24 UTC