W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2010

RE: [WebIDL] interface objects with [Constructor] and [[Call]]

From: Travis Leithead <travil@microsoft.com>
Date: Fri, 11 Jun 2010 20:50:30 +0000
To: Simon Pieters <simonp@opera.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <9768D477C67135458BF978A45BCF9B380F63C3@TK5EX14MBXW605.wingroup.windeploy.ntdev.microsoft.com>
The way I interpret that, [[Call]] should equal [[Construct]] in all cases for host objects. Why? Because real-world code using XMLHttpRequest today mixes and matches the invocation pattern: 

'new XMLHttpRequest;'
'new XMLHttpRequest();'
'XMLHttpRequest();'

and for web-compat, we want all of these to succeed.


-----Original Message-----
From: public-script-coord-request@w3.org [mailto:public-script-coord-request@w3.org] On Behalf Of Simon Pieters
Sent: Thursday, May 27, 2010 3:56 AM
To: public-script-coord@w3.org
Subject: [WebIDL] interface objects with [Constructor] and [[Call]]

Hi,

Should interface objects with the [Constructor] extended attribute implement [[Call]] in ECMAScript? What should happen when it's invoked? It doesn't seem to be defined in WebIDL.

For builtins in ECMAScript the behavior varies. ES follows [[Call]] === [[Construct]] except for String, Number, Boolean, Date and RegExp.  
Although [[Call]] on those don't throw, just do something different compared to [[Construct]].

For XMLHttpRequest, Opera and Firefox act as if [[Construct]] was invoked for [[Call]], while Safari and Chrome throw a TypeError exception. Please define which is correct.

Cheers,
--
Simon Pieters
Opera Software


Received on Friday, 11 June 2010 20:52:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:02 UTC