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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>131698</bug_id>
          
          <creation_ts>2014-04-15 14:56:36 -0700</creation_ts>
          <short_desc>Simple ES6 feature: Array.from</short_desc>
          <delta_ts>2016-03-14 12:47:50 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>EasyFix, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oliver Hunt">oliver</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>caitp</cc>
    
    <cc>ggaren</cc>
    
    <cc>graouts</cc>
    
    <cc>m.goleb+bugzilla</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1000967</commentid>
    <comment_count>0</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2014-04-15 14:56:36 -0700</bug_when>
    <thetext>http://people.mozilla.org/~jorendorff/es6-draft.html#sec-22.1.2.1

Should be doable in builtin JS</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1000968</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2014-04-15 14:56:51 -0700</bug_when>
    <thetext>&lt;rdar://problem/16625961&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1007364</commentid>
    <comment_count>2</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2014-05-07 10:51:46 -0700</bug_when>
    <thetext>Dupe of 130966, landed in http://trac.webkit.org/changeset/167797.

*** This bug has been marked as a duplicate of bug 130966 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1007369</commentid>
    <comment_count>3</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2014-05-07 10:52:30 -0700</bug_when>
    <thetext>Wrong bug, sorry!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1060749</commentid>
    <comment_count>4</comment_count>
    <who name="Caitlin Potter (:caitp)">caitp</who>
    <bug_when>2015-01-12 19:18:17 -0800</bug_when>
    <thetext>This bug should be simple, but is at least partially blocked on iterators being available.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1060823</commentid>
    <comment_count>5</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2015-01-13 08:10:50 -0800</bug_when>
    <thetext>We support for-of on all currently iterable types, as well as the spread operator so should be either

Return [...arguments]

Or 

Return [...source]

I can&apos;t recall spec of the top of my head</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1060959</commentid>
    <comment_count>6</comment_count>
    <who name="Caitlin Potter (:caitp)">caitp</who>
    <bug_when>2015-01-13 15:09:11 -0800</bug_when>
    <thetext>You&apos;re correct, for-of and the spread operator are supported for certain types (although strings appear to not be iterable yet in JSC).

However, iterator methods seem to be attached via private properties / internal slots, rather than using the well-known symbol @@iterator.

The Array.from algorithm uses `GetMethod(items, @@iterator)` to determine whether or not it can use the from-iterable path or the from-array-like path, so an implementation is still sort of blocked on that (or at least blocked on exposing a getter for the private iterator properties to JS builtins, if it is to be implemented in JS).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1060976</commentid>
    <comment_count>7</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2015-01-13 15:42:48 -0800</bug_when>
    <thetext>I would actually say that the hardest part here will be updating the builtins generation logic to support constructor/static functions.

The subsequent logic would be to expose (as a private global) the Symbol object, with @@iterator attached. (You&apos;d still need to use for-of.  Our internal iterator implementation doesn&apos;t match spec behaviour for reasons best summed up as &quot;performance&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1060977</commentid>
    <comment_count>8</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2015-01-13 15:45:48 -0800</bug_when>
    <thetext>note builtin JS can do magical things - look at the js files in builtins/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1174620</commentid>
    <comment_count>9</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-03-14 12:47:08 -0700</bug_when>
    <thetext>This is done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1174621</commentid>
    <comment_count>10</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-03-14 12:47:50 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/183357</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>