<?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>28601</bug_id>
          
          <creation_ts>2015-05-04 20:57:46 +0000</creation_ts>
          <short_desc>Converting an ECMAScript value to a dictionary; use [[GetOwnProperty]] or [[Get]]?</short_desc>
          <delta_ts>2015-05-04 21:59:32 +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>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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="Travis Leithead [MSFT]">travil</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>adamk</cc>
    
    <cc>bugs</cc>
    
    <cc>bzbarsky</cc>
    
    <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>120062</commentid>
    <comment_count>0</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2015-05-04 20:57:46 +0000</bug_when>
    <thetext>Should we use [[GetOwnProperty]] or [[Get]] for checking the dictionary for a member?


Asking because with accessors on prototypes of Event objects, can I pass an event object instance in the dictionary parameter for an event constructor and have it work?

In http://heycam.github.io/webidl/#es-dictionary, is ambiguously says:

&quot;For each dictionary member member declared on dictionary, in order&quot;

It reads (to me) like &quot;on&quot; is a [[GetOwnProperty]], but perhaps it should be [[Get]]??</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120063</commentid>
    <comment_count>1</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2015-05-04 21:23:00 +0000</bug_when>
    <thetext>Chrome [Canary 44] and Firefox both allow this to work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120064</commentid>
    <comment_count>2</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2015-05-04 21:35:23 +0000</bug_when>
    <thetext>&quot;value is the result of calling the [[Get]] internal method on V with property name key.&quot;

The dictionary is the thing being created, and
&quot; every dictionary member is initially considered to be not present.&quot;

So, &quot;on&quot; doesn&apos;t refer to the JS object (V), but to the dictionary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120066</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2015-05-04 21:57:36 +0000</bug_when>
    <thetext>&gt; &quot;For each dictionary member member declared on dictionary, in order&quot;

If you look at how &quot;dictionary&quot; is defined, it comes from &quot;For each dictionary dictionary in dictionaries&quot; and &quot;dictionaries&quot; is &quot;a list consisting of D and all of D’s inherited dictionaries&quot; where D is an IDL dictionary type.

So &quot;dictionary&quot; in the above phrase is an IDL dictionary type, not a JS value or IDL value, and &quot;declared on dictionary&quot; means as a member of the relevant dictionary type.

There is not checking for a member going on at all, in other words.  You just take all the members listed in your IDL, and for each one you do a [[Get]] on the JS object.

And to answer your question in comment 0, for the typical way events are defined, you can in fact pass an event instance to that event&apos;s constructor and it will work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120067</commentid>
    <comment_count>4</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2015-05-04 21:59:14 +0000</bug_when>
    <thetext>(In reply to Olli Pettay from comment #2)
&gt; &quot;value is the result of calling the [[Get]] internal method on V with
&gt; property name key.&quot;
&gt; 
&gt; The dictionary is the thing being created, and
&gt; &quot; every dictionary member is initially considered to be not present.&quot;
&gt; 
&gt; So, &quot;on&quot; doesn&apos;t refer to the JS object (V), but to the dictionary.

Oops. You are right on. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>