Re: 'in' operator and feature detection technique...
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: 'in' operator and feature detection technique...

From: VK <schools_ring@yahoo.com>
Date: Fri Feb 10 2006 - 13:02:32 CET

Luke Matuszewski wrote:
> - for(... in ...) construct is supported since JavaScript 1.2 /
> JScript 3.0/IE4, but expressions like [string] in objRef (resulting of
> Boolean value) are not supported since IE5.5/JScript 5.5, JavaScript
> 1.5(?);

There are:

   for (...in...) {...} Statement

   in Operator // if ('something' in something)

for (...in...) *statement* is supported "since forever". It means that
when the first sketchy descriptions of JavaScript appeared (before any
ECMA and versioning), for (...in...) statement was already there in the
same form as it is now. Possibly it was not presented in the fist
drafts of LiveScript - I did not work with it.

in *operator* has been introduced in JScript 5.0 / JavaScript 1.5

While preparing the documentation for JScript 5.6, a typo had been made
so versions are being switched:
for (...in...) *statement* is marked as supported since JScript 5.0 and
in *operator* as supported since JScript 1.0

Switch the versions and you will get the right picture.

Unfortunately this typo was reproduced in a number of places as I can
tell. You are welcome to report it to all involved organizations under
your name if you want to. Overall this documentation bug wouldn't be
discovered without your post.
Received on Mon May 1 03:14:41 2006