Backed out changeset e49d0dfcaa5c (bug 1165052)
authorTooru Fujisawa <arai_a@mac.com>
Mon, 28 Mar 2016 06:49:56 +0900
changeset 290665 8e3a42336a3738b82d35e5fb09d9aef347106ba9
parent 290664 d61e32f1ad9cf2c377317066bb668f7e7bb86e2e
child 290666 64788d3e93a9b95a3111faf76af4a0f7b690d1d6
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1165052
milestone48.0a1
backs oute49d0dfcaa5c7415c94b830e11dda40700522011
Backed out changeset e49d0dfcaa5c (bug 1165052)
js/src/builtin/Array.js
--- a/js/src/builtin/Array.js
+++ b/js/src/builtin/Array.js
@@ -304,52 +304,52 @@ function ArrayStaticMap(list, callbackfn
     if (arguments.length < 2)
         ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'Array.map');
     if (!IsCallable(callbackfn))
         ThrowTypeError(JSMSG_NOT_FUNCTION, DecompileArg(1, callbackfn));
     var T = arguments.length > 2 ? arguments[2] : void 0;
     return callFunction(ArrayMap, list, callbackfn, T);
 }
 
-/* ES 2016 draft Mar 25, 2016 22.1.3.7 Array.prototype.filter. */
+/* ES2015 22.1.3.7 Array.prototype.filter. */
 function ArrayFilter(callbackfn/*, thisArg*/) {
-    /* Step 1. */
+    /* Steps 1-2. */
     var O = ToObject(this);
 
-    /* Step 2. */
+    /* Steps 3-4. */
     var len = ToInteger(O.length);
 
-    /* Step 3. */
+    /* Step 5. */
     if (arguments.length === 0)
         ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'Array.prototype.filter');
     if (!IsCallable(callbackfn))
         ThrowTypeError(JSMSG_NOT_FUNCTION, DecompileArg(0, callbackfn));
 
-    /* Step 4. */
+    /* Step 6. */
     var T = arguments.length > 1 ? arguments[1] : void 0;
 
-    /* Step 5. */
-    var A = ArraySpeciesCreate(O, 0);
+    /* Step 7. */
+    var A = [];
 
-    /* Steps 6-8. */
-    /* Steps 8.a (implicit), and 8.d. */
+    /* Steps 8-11. */
+    /* Steps 11.a (implicit), and 11.e. */
     for (var k = 0, to = 0; k < len; k++) {
-        /* Steps 8.b-c. */
+        /* Steps 11.b-c. */
         if (k in O) {
-            /* Step 8.c.i. */
+            /* Steps 11.c.i-ii. */
             var kValue = O[k];
-            /* Step 8.c.ii. */
+            /* Steps 11.c.iii-iv. */
             var selected = callContentFunction(callbackfn, T, kValue, k, O);
-            /* Step 8.c.iii. */
+            /* Step 11.c.v. */
             if (selected)
                 _DefineDataProperty(A, to++, kValue);
         }
     }
 
-    /* Step 9. */
+    /* Step 12. */
     return A;
 }
 
 function ArrayStaticFilter(list, callbackfn/*, thisArg*/) {
     if (arguments.length < 2)
         ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'Array.filter');
     if (!IsCallable(callbackfn))
         ThrowTypeError(JSMSG_NOT_FUNCTION, DecompileArg(1, callbackfn));