<?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>17648</bug_id>
          
          <creation_ts>2012-06-29 08:32:11 +0000</creation_ts>
          <short_desc>[Awaiting ES6] Add iterators</short_desc>
          <delta_ts>2014-10-05 17:11:46 +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 3.1</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>
          
          <blocked>23210</blocked>
    
    <blocked>23211</blocked>
    
    <blocked>23212</blocked>
    
    <blocked>26102</blocked>
    
    <blocked>26183</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>allen</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>cam</cc>
    
    <cc>d</cc>
    
    <cc>erights</cc>
    
    <cc>erik.arvidsson</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69530</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-06-29 08:32:11 +0000</bug_when>
    <thetext>http://lists.w3.org/Archives/Public/public-script-coord/2012AprJun/thread.html#msg239

heycam suggests at least NodeList/HTMLCollection need this, but if they can have [ArrayClass] that would be better. https://bugs.webkit.org/show_bug.cgi?id=81573 suggests [ArrayClass] is probably not going to happen, but who knows, it is not resolved wontfix just yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69531</commentid>
    <comment_count>1</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-06-29 09:01:03 +0000</bug_when>
    <thetext>I think this should be done in WebIDL for all interfaces that support indexed properties, fwiw.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80090</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-12-13 10:55:30 +0000</bug_when>
    <thetext>heycam, what do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80160</commentid>
    <comment_count>3</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-12-14 05:31:35 +0000</bug_when>
    <thetext>Iterators have already been added to the spec, so if people want to write explicit ones for their interfaces they can.

http://dev.w3.org/2006/webapi/WebIDL/#idl-iterators
http://dev.w3.org/2006/webapi/WebIDL/#es-iterators

But I like the idea of having iterators by default for objects that support indexed properties.  This could be overridden if you explicitly declare an iterator.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80161</commentid>
    <comment_count>4</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-12-14 05:57:10 +0000</bug_when>
    <thetext>The ES6 draft has changed a lot since I looked at it last. :)  I can&apos;t see mention of iterator() methods on objects any more, which is what Web IDL is written against at the moment.  Maybe that strawman changed before being added to the spec.  I can see in section 12.6.4 (dealing with for-in and for-of loops), the runtime semantics of the &quot;For In/Of Expression Evaluation&quot; abstract operation, step 7.b says:

  Let keys be the result of performing Invoke with arguments obj, %iterator%, and an empty List.

but there doesn&apos;t seem to be a definition for this intrinsic object %iterator%.  Maybe that&apos;s meant to be an intrinsic symbol @@iterator?  Anyway, it feels like the spec isn&apos;t quite done on this yet, so perhaps I should wait a bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99203</commentid>
    <comment_count>5</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-01-27 21:45:20 +0000</bug_when>
    <thetext>Thread at http://www.w3.org/mid/520FE9BF.5060902@gmail.com mentioned this bug too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100428</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-02-12 19:46:45 +0000</bug_when>
    <thetext>Given that we could theoretically snapshot live lists, I asked arv, he said &quot;I think we should keep them live. ArrayIterator is live. Doing `NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]` works fine with live lists.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100439</commentid>
    <comment_count>7</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-02-12 21:13:00 +0000</bug_when>
    <thetext>Fwiw, that&apos;s basically what Gecko implements right now.  We&apos;ve had a few complaints about it, in the usual way.  Live lists suck to work with.  :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112350</commentid>
    <comment_count>8</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-09-29 04:12:28 +0000</bug_when>
    <thetext>I&apos;ve updated the spec to use @@iterator and reference other abstract iterator-related operations from the ES6 spec.  I&apos;ve removed interface interfaces, as they were a complication that I&apos;m not sure we need.  I&apos;ve also updated the iterator that exists automatically due to declaring indexed properties to just use the default Array iterator.

An easier way to iterate over a set of objects -- bug 26183 -- is still to come.

https://github.com/heycam/webidl/commit/f87ea39994972ebd75f4b98c2dc01a32aaa9d1f5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112351</commentid>
    <comment_count>9</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-09-29 04:28:43 +0000</bug_when>
    <thetext>(In reply to Cameron McCormack from comment #8)
&gt; An easier way to iterate over a set of objects -- bug 26183 -- is still to
&gt; come.

&quot;list of values&quot;, not &quot;set of objects&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112680</commentid>
    <comment_count>10</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-10-04 04:38:48 +0000</bug_when>
    <thetext>Do we actually want to make the @@iterator property enumerable?

It doesn&apos;t affect for..in enumeration either way, since that skips symbol-named props, but it seems like we might want to not make it enumerable in general.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112681</commentid>
    <comment_count>11</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-10-04 05:01:16 +0000</bug_when>
    <thetext>Oh, I think we should be using the defaults mentioned in https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-standard-built-in-objects, i.e. { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112682</commentid>
    <comment_count>12</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-10-04 05:10:00 +0000</bug_when>
    <thetext>Fixed that: https://github.com/heycam/webidl/commit/650316df6cdd154fd759a9d5b5130a67ce142aa1

I wasn&apos;t sure what to do about @@toStringTag, as some properties with this name in the ES6 spec are configurable and some are not.  Just added an ednote for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112721</commentid>
    <comment_count>13</comment_count>
    <who name="Allen Wirfs-Brock">allen</who>
    <bug_when>2014-10-05 17:11:46 +0000</bug_when>
    <thetext>(In reply to Cameron McCormack from comment #12)
&gt; I wasn&apos;t sure what to do about @@toStringTag, as some properties with this
&gt; name in the ES6 spec are configurable and some are not.  Just added an
&gt; ednote for now.

That&apos;s a bug in the ES6 spec (now fixed in my draft)

All standard @@toStringTag properties should be non-writable (unless an accessor), non-enumerable, and configurable</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>