From: Dmitry A. Soshnikov on
On Dec 29, 7:43 pm, Asen Bozhilov <asen.bozhi...(a)gmail.com> wrote:

[snip]

>
>   I'm cannot found browser ECMA-262 implementation which follow the
> specification in `12.6.4 The for-in Statement` step 3 in `for
> ( LeftHandSideExpression in Expression ) Statement` and step 4 in `for
> ( var VariableDeclarationNoIn in Expression )`
>   | Call ToObject(GetValue(Expression))
>
>   Only in "DMD Script" i get a expected behavior in relation to ECMA
> 262-3 12.6.4.

Yep, implementations know about that. For example, Spidermonkey
justifies that like "web JS" ;)

/*
* Enumerating over null and undefined gives an empty enumerator.
* This is contrary to ECMA-262 9.9 ToObject, invoked from step 3 of
* the first production in 12.6.4 and step 4 of the second production,
* but it's "web JS" compatible.
*/

http://code.google.com/p/v8/source/browse/trunk/src/arm/codegen-arm.cc#1747

V8, e.g. like this (referencing on Spidermonkey and WebKit):

// Both SpiderMonkey and kjs ignore null and undefined in contrast
// to the specification. 12.6.4 mandates a call to ToObject.

http://code.google.com/p/v8/source/browse/trunk/src/arm/codegen-arm.cc#1747

/ds
From: Dmitry A. Soshnikov on
On Dec 29, 10:40 pm, "Dmitry A. Soshnikov"
<dmitry.soshni...(a)gmail.com> wrote:

[snip]

> Spidermonkey
>
> http://code.google.com/p/v8/source/browse/trunk/src/arm/codegen-arm.c...
>

Oops, sorry, wrong link. This one is correct for Spidermonkey:

<URL: http://mxr.mozilla.org/mozilla/source/js/src/jsiter.c#352>

/ds
From: Asen Bozhilov on
Garrett Smith wrote:

> If you have an example of a piece of code that suffered a bug because of
> it, I'd be happy to include it.

No. I'm not have any example from production code or popular library.
You're correct about that. Is not very often *error*.

> I don't understand. What you are suggesting?

The main goal of my previous post is related to "Implicit type
conversion" and "Automatically type conversion". Perhaps for that will
be good to have separate article, if doesn't have yet.

Regards.
From: Dmitry A. Soshnikov on
On Dec 29, 9:48 pm, Garrett Smith <dhtmlkitc...(a)gmail.com> wrote:

[snip]

>     - DO not use delete operator with host object (IE Errors)

Again, too categorical. If you know what you are doing, it can be
useful to use `delete'. Better to write "Be carefull using delete
operator with host objects because... (IE Errors)".

/ds
From: Garrett Smith on
Asen Bozhilov wrote:
> Garrett Smith wrote:
>
>> If you have an example of a piece of code that suffered a bug because of
>> it, I'd be happy to include it.
>
> No. I'm not have any example from production code or popular library.
> You're correct about that. Is not very often *error*.
>
>> I don't understand. What you are suggesting?
>
> The main goal of my previous post is related to "Implicit type
> conversion" and "Automatically type conversion". Perhaps for that will
> be good to have separate article, if doesn't have yet.

There is an faq note about type conversion by Cornford.

http://www.jibbering.com/faq/faq_notes/type_convert.html

I have worked on cleaning that document up to have HTML 4.01 strict at:-

/faq/notes/type-conversion/
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/