W3C home > Mailing lists > Public > public-webapi@w3.org > March 2008

Re: [Bindings] What does typeof return for interface objects?

From: Cameron McCormack <cam@mcc.id.au>
Date: Wed, 19 Mar 2008 21:55:46 +1100
To: "Web APIs WG (public)" <public-webapi@w3.org>
Message-ID: <20080319105546.GA7430@arc.mcc.id.au>

Maciej Stachowiak:
> ECMA-262 actually allows typeof to return anything at all for host  
> objects (which all of the DOM binding objects are).

Of course you’re correct, I forgot about that.

> So it would not be an ECMA-262 violation, technically, for an
> uncallable object to give typeof == 'function', but I do think it
> would be a bad idea.

I agree, it doesn’t seem to useful to make the object return 'function'
for typeof when it can’t be called.

Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au
Received on Wednesday, 19 March 2008 10:56:25 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:25 UTC