This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
* Ms2ger tries to figure out what kind of error new window.ImageData(1,1) should throw <bz> ms2ger: doesn't the spec say? <Ms2ger> I'm not sure <bz> ah <bz> one sec <Ms2ger> [[Construct]] doesn't appear in normative prose in WebIDL <bz> " Interfaces that do not have a constructor will throw an exception when called as a function. " <bz> mmmm <Ms2ger> Only, I'm not sure if it needs to <bz> oh, hmm <bz> it defines a [[Call]] <Ms2ger> Yeah <bz> that might be a spec bug <Ms2ger> Looking at http://ecma-international.org/ecma-262/5.1/#sec-11.2.2 <bz> and even the [[Call]] doesn't say what exception is thrown <bz> just "an exception" <Ms2ger> "If constructor does not implement the [[Construct]] internal method, throw a TypeError exception." <bz> mmm <bz> yeah <bz> please file bugs on webidl Cameron, please figure it out :)
Note to self: fix 2d.imageData.object.ctor.html when this bug is fixed.
Interface objects are function objects: http://dev.w3.org/2006/webapi/WebIDL/#interface-object All function objects have the the default [[Construct]] behaviour that the ES spec defines: http://dev.w3.org/2006/webapi/WebIDL/#dfn-function-object This is regardless of whether there was a [Constructor] on the interface. The default [[Construct]] behaviour is to create a new object and invoke [[Call]]: http://es5.github.com/#x13.2.2 [[Call]] will throw a TypeError if the interface was not defined with a [Constructor]: http://dev.w3.org/2006/webapi/WebIDL/#es-interface-call (scroll down to "The internal [[Call]] method ...")
Excellent, thanks.