<?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>27953</bug_id>
          
          <creation_ts>2015-02-04 01:30:28 +0000</creation_ts>
          <short_desc>Dictionaries with required properties shouldn&apos;t need to be optional</short_desc>
          <delta_ts>2015-04-17 05:12: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>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Olli Pettay">bugs</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>jackalmage</cc>
    
    <cc>jyasskin</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>117676</commentid>
    <comment_count>0</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2015-02-04 01:30:28 +0000</bug_when>
    <thetext>Doesn&apos;t really make sense to have optional dictionaries, if the dictionary has
required properties.


Gecko bug https://bugzilla.mozilla.org/show_bug.cgi?id=1129239</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117682</commentid>
    <comment_count>1</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2015-02-04 02:55:50 +0000</bug_when>
    <thetext>No, it does.  It&apos;s reasonable to have an argument which is optional altogether, but if you *do* pass a dict, it *must* have certain properties.  (In other words, they&apos;re either required or optional as a block.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117685</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2015-02-04 03:25:44 +0000</bug_when>
    <thetext>Except that&apos;s not how optional dictionaries behave in the spec at the moment.  Optional dictionaries always have the default value null (or Object.create(null) if you prefer to think of it that way; the behavior is identical), so not passing the argument for an optional dictionary is the same thing as passing null or Object.create(null), which is guaranteed to throw if the dictionary has a required member.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119607</commentid>
    <comment_count>3</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2015-04-17 05:01:07 +0000</bug_when>
    <thetext>I think if we want to ensure that APIs that allow an empty dictionary value to also be specified as undefined (and probably we do), and we also want to allow APIs with arguments with required dictionary members, then allowing the &quot;optional&quot; keyword to be dropped iff the dictionary does have required members makes sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119608</commentid>
    <comment_count>4</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2015-04-17 05:12:32 +0000</bug_when>
    <thetext>https://github.com/heycam/webidl/commit/b1dea262d0d5894d8954fa6478e30bf67fc2950d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>