Re: A problem with an apparently common JS menu...
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: A problem with an apparently common JS menu...

From: Lasse Reichstein Nielsen <lrn@hotpop.com>
Date: Wed Nov 16 2005 - 08:21:06 CET

Thomas 'PointedEars' Lahn <PointedEars@web.de> writes:

[document.all]
> But if it is indeed a function, should it then not have all properties
> of Function objects and what is if a member is named like a property of
> Function objects? This all still seems very strange to me.

It's a host object, so it doesn't have to follow the conventions of
language objects. An object is a function if it has the internal
[[Call]] method, it doesn't have to inherit from Function.prototype
(ECMA262 section 8.6.2). And indeed it doesn't ("document.all.apply"
is undefined, and "document.all instanceof Function" is false).
The value of "typeof document.all" is "object", but typeof on host
objects is also allowed to be implementation dependent.

But document.all doesn't violate any rules of ECMAScript for a host
object.

/L

-- 
Lasse Reichstein Nielsen  -  lrn@hotpop.com
 DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
  'Faith without judgement merely degrades the spirit divine.'
Received on Mon Nov 21 03:31:09 2005