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

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

From: Simon Pieters <simonp@opera.com>
Date: Thu, 27 May 2010 12:56:02 +0200
To: "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <op.vdc1zod2idj3kv@simon-pieterss-macbook.local>
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 Thursday, 27 May 2010 10:56:38 UTC

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