<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17593</bug_id>
          
          <creation_ts>2012-06-25 18:31:42 +0000</creation_ts>
          <short_desc>Figure out if something needs to be said about [[Construct]]</short_desc>
          <delta_ts>2012-06-26 09:07:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ms2ger">Ms2ger</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69387</commentid>
    <comment_count>0</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-06-25 18:31:42 +0000</bug_when>
    <thetext>* Ms2ger tries to figure out what kind of error new window.ImageData(1,1) should throw
&lt;bz&gt; ms2ger: doesn&apos;t the spec say?
&lt;Ms2ger&gt; I&apos;m not sure
&lt;bz&gt; ah
&lt;bz&gt; one sec
&lt;Ms2ger&gt; [[Construct]] doesn&apos;t appear in normative prose in WebIDL
&lt;bz&gt; &quot; Interfaces that do not have a constructor will throw an exception when called as a function. &quot;
&lt;bz&gt; mmmm
&lt;Ms2ger&gt; Only, I&apos;m not sure if it needs to
&lt;bz&gt; oh, hmm
&lt;bz&gt; it defines a [[Call]]
&lt;Ms2ger&gt; Yeah
&lt;bz&gt; that might be a spec bug
&lt;Ms2ger&gt; Looking at http://ecma-international.org/ecma-262/5.1/#sec-11.2.2
&lt;bz&gt; and even the [[Call]] doesn&apos;t say what exception is thrown
&lt;bz&gt; just &quot;an exception&quot;
&lt;Ms2ger&gt; &quot;If constructor does not implement the [[Construct]] internal method, throw a TypeError exception.&quot;
&lt;bz&gt; mmm
&lt;bz&gt; yeah
&lt;bz&gt; please file bugs on webidl

Cameron, please figure it out :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69388</commentid>
    <comment_count>1</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-06-25 18:32:41 +0000</bug_when>
    <thetext>Note to self: fix 2d.imageData.object.ctor.html when this bug is fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69392</commentid>
    <comment_count>2</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-06-25 23:59:28 +0000</bug_when>
    <thetext>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 &quot;The internal [[Call]] method ...&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69395</commentid>
    <comment_count>3</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-06-26 09:07:16 +0000</bug_when>
    <thetext>Excellent, thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>