[Laszlo-dev] Any suggestions on this JScript lossage?
P T Withington
ptw at pobox.com
Sat Nov 3 04:24:06 PDT 2007
Thanks for that link. I had heard about it but not read it. MS seems
to have really pit their foot in it there...
On Nov 2, 2007, at 19:25, Philip Romanik <promanik at laszlosystems.com>
wrote:
> The example on this page covers it:
> http://blogs.msdn.com/jscript/archive/2007/10/29/ecmascript-3-and-beyond.aspx
>
> Here's the same test in html:
>
> <html>
> <body>
> <script>
> var hash = {foo: 1, toString: 2};
> for (var k in hash) document.write("<br/>name: ", k);
>
> // http://blogs.msdn.com/jscript/archive/2007/10/29/ecmascript-3-and-beyond.aspx
> var res = hash.propertyIsEnumerable("toString");
> document.write("<br/>hash.propertyIsEnumerable(\"toString\"): ", res);
> </script>
> </body>
> </html>
>
>
>
>> This is the problem. In IE6, 'toString' will not be enumerated,
>> even if it is an explicit property in an Object:
>>
>> lzx> for (var k in {foo: 1, toSTring: 2}) Debug.write(k)
>> foo
>> toSTring
>> lzx> for (var k in {foo: 1, toString: 2}) Debug.write(k)
>> foo
>> lzx>
>
More information about the Laszlo-dev
mailing list