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 - 01:02:43 CET

Thomas 'PointedEars' Lahn wrote:
> VK wrote:
>
> > ('property' in someObject) is not intended for features test - though
> > it can be used and it is used this way (when the support for
> > prehistoric browsers is not a requirement).
>
> So your history begins not long before 2000 CE? That would explain some
> of your misconceptions, although not all of them.

And what your history begins with? 1995? The oldest IE currently
supported by Microsoft is IE 5.5 SP2. This is the oldest version one
can hold by claming "corporate demands". Any older versions are being
kept by few individuals for reasons which are out of my interest.
If NN4, IE4, Opera 6 etc. users still want to enjoy the modern web w/o
_free_ updates then they are welcome to join into "Old Browsers User
Society" and donate into special fund which would pay to Yahoo, MSN,
myself and any other developers for extra solutions for outdated
browsers. But I'm affraid that they are willing to spend their money
for my extra efforts as much as I willing to spend extra efforts for
them for free.

I'm supporting JavaScript 1.5 and higher, JScript 5.6 plus a bunch of
half-a** done DOM implementations made over the last few years. That's
already 50% volunteer work not covered by my payroll.

And I need to sit on my spare day for free because some John Doe
bothers to spend 10 min to update his Opera 3.0 to Opera 8.51 ? Kiss
my..

> JavaScript 1.0 and ECMAScript implementations (e.g. JavaScript 1.1+, JScript
> 1.0+) have always been languages that used prototype-based inheritance.

What inheritance?!? JavaScript that did not have any inheritance - not
prototype based, not classical. You simply cannot create anything -
only declare variables and add properties to window object. Plus Math
and Date objects.

> The `in' operator was introduced in JavaScript 1.5 (Mozilla/5.0 rv:0.6,
> November 2000), JScript 5.5 (IE 5.5, July 1999) [1], and ECMAScript
> Edition 3 (December 1999).
>
> The `hasOwnProperty' method was introduced in JavaScript 1.5, JScript 5.5,
> and ECMAScript Edition 3.

Yes, exactly because developers got all tools for fully functional
inheritance and they needed (or at least it was thought so) traking
tools for inherited members.

> Since the current major version of IE is 6.0, that would mean you consider
> its previous major version, IE 5.0, historic already, even though it is
> still used.

See above

> The operator simply uses the prototype chain, by calling the internal
> GetValue() method (ES3 Final, 8.7.1) which calls the internal [[Get]]
> method (8.6.2.1) which calls the [[Get]] method of [[Prototype]] if it
> is not `null' (steps 4 and 5), _up to its end_ (including the prototype
> of the prototype aso.). It does not check only the object's prototype
> explicitly as that would not be sufficient.

If you call it "simply" then so be it :-)
You can forward this explanation to Microsoft, because they seem in the
dark how does their operator work.
Received on Mon May 1 03:13:40 2006