Bug 924318 - Clean up ecma_6/Generators iterator tests. r=jwalden
authorAndy Wingo <wingo@igalia.com>
Thu, 17 Oct 2013 12:56:03 +0200
changeset 165886 4d45af314d05377a5da7550b8cd25ae9163a0c98
parent 165885 60f90ee1eb33c28e3f62f8616619971191668e7e
child 165887 68149d83be3a99b09cebb690eb4377d01fa832ce
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs924318
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 924318 - Clean up ecma_6/Generators iterator tests. r=jwalden
js/src/tests/ecma_6/Generators/delegating-yield-12.js
js/src/tests/ecma_6/Generators/delegating-yield-2.js
js/src/tests/ecma_6/Generators/delegating-yield-3.js
js/src/tests/ecma_6/Generators/delegating-yield-4.js
js/src/tests/ecma_6/Generators/iteration.js
js/src/tests/ecma_6/Generators/shell.js
--- a/js/src/tests/ecma_6/Generators/delegating-yield-12.js
+++ b/js/src/tests/ecma_6/Generators/delegating-yield-12.js
@@ -25,25 +25,25 @@ function IterableWrapper(iterable) {
     }
 
     return ret;
 }
 
 function* delegate(iter) { return yield* iter; }
 
 var iter = delegate(IterableWrapper([1, 2, 3]));
-assertIteratorResult(1, false, iter.next());
-assertIteratorResult(2, false, iter.next());
-assertIteratorResult(3, false, iter.next());
-assertIteratorResult(undefined, true, iter.next());
+assertIteratorResult(iter.next(), 1, false);
+assertIteratorResult(iter.next(), 2, false);
+assertIteratorResult(iter.next(), 3, false);
+assertIteratorResult(iter.next(), undefined, true);
 
 assertEq(log, 'innnn');
 
 iter = delegate([1, 2, 3]);
-assertIteratorResult(1, false, iter.next());
-assertIteratorResult(2, false, iter.next());
-assertIteratorResult(3, false, iter.next());
-assertIteratorResult(undefined, true, iter.next());
+assertIteratorResult(iter.next(), 1, false);
+assertIteratorResult(iter.next(), 2, false);
+assertIteratorResult(iter.next(), 3, false);
+assertIteratorResult(iter.next(), undefined, true);
 
 assertEq(log, 'innnn');
 
 if (typeof reportCompare == "function")
     reportCompare(true, true);
--- a/js/src/tests/ecma_6/Generators/delegating-yield-2.js
+++ b/js/src/tests/ecma_6/Generators/delegating-yield-2.js
@@ -4,68 +4,68 @@ function* g1() { return (yield 1); }
 function* g2() { try { yield 1; } catch (e) { yield e; } }
 function* delegate(iter) { return yield* iter; }
 var GeneratorObjectPrototype = Object.getPrototypeOf(g1).prototype;
 var GeneratorObjectPrototype_throw = GeneratorObjectPrototype.throw;
 
 // An uncaught delegated throw.
 var inner = g1();
 var outer = delegate(inner);
-assertIteratorResult(1, false, outer.next());
+assertIteratorResult(outer.next(), 1, false);
 assertThrowsValue(function () { outer.throw(42) }, 42);
 assertThrowsInstanceOf(function () { outer.throw(42) }, TypeError);
 
 // A caught delegated throw.
 inner = g2();
 outer = delegate(inner);
-assertIteratorResult(1, false, outer.next());
-assertIteratorResult(42, false, outer.throw(42));
+assertIteratorResult(outer.next(), 1, false);
+assertIteratorResult(outer.throw(42), 42, false);
 assertThrowsValue(function () { outer.throw(42) }, 42);
 assertThrowsInstanceOf(function () { outer.throw(42) }, TypeError);
 
 // What would be an uncaught delegated throw, but with a monkeypatched iterator.
 inner = g1();
 outer = delegate(inner);
-assertIteratorResult(1, false, outer.next());
+assertIteratorResult(outer.next(), 1, false);
 inner.throw = function(e) { return e*2; };
 assertEq(84, outer.throw(42));
-assertIteratorResult(undefined, true, outer.next());
+assertIteratorResult(outer.next(), undefined, true);
 
 // Monkeypatching inner.next.
 inner = g1();
 outer = delegate(inner);
 inner.next = function() { return { value: 13, done: true } };
-assertIteratorResult(13, true, outer.next());
+assertIteratorResult(outer.next(), 13, true);
 
 // What would be a caught delegated throw, but with a monkeypunched prototype.
 inner = g2();
 outer = delegate(inner);
-assertIteratorResult(1, false, outer.next());
+assertIteratorResult(outer.next(), 1, false);
 delete GeneratorObjectPrototype.throw;
 var outer_throw_42 = GeneratorObjectPrototype_throw.bind(outer, 42);
 assertThrowsValue(outer_throw_42, 42);
 assertThrowsInstanceOf(outer_throw_42, TypeError);
 
 // Monkeypunch a different throw handler.
 inner = g2();
 outer = delegate(inner);
 outer_throw_42 = GeneratorObjectPrototype_throw.bind(outer, 42);
-assertIteratorResult(1, false, outer.next());
+assertIteratorResult(outer.next(), 1, false);
 GeneratorObjectPrototype.throw = function(e) { return e*2; }
 assertEq(84, outer_throw_42());
 assertEq(84, outer_throw_42());
 // This continues indefinitely.
 assertEq(84, outer_throw_42());
-assertIteratorResult(undefined, true, outer.next());
+assertIteratorResult(outer.next(), undefined, true);
 
 // The same, but restoring the original pre-monkey throw.
 inner = g2();
 outer = delegate(inner);
 outer_throw_42 = GeneratorObjectPrototype_throw.bind(outer, 42);
-assertIteratorResult(1, false, outer.next());
+assertIteratorResult(outer.next(), 1, false);
 assertEq(84, outer_throw_42());
 assertEq(84, outer_throw_42());
 GeneratorObjectPrototype.throw = GeneratorObjectPrototype_throw;
-assertIteratorResult(42, false, outer_throw_42());
-assertIteratorResult(undefined, true, outer.next());
+assertIteratorResult(outer_throw_42(), 42, false);
+assertIteratorResult(outer.next(), undefined, true);
 
 if (typeof reportCompare == "function")
     reportCompare(true, true);
--- a/js/src/tests/ecma_6/Generators/delegating-yield-3.js
+++ b/js/src/tests/ecma_6/Generators/delegating-yield-3.js
@@ -3,38 +3,38 @@
 function* g(n) { for (var i=0; i<n; i++) yield i; }
 function* delegate(iter) { return yield* iter; }
 var GeneratorObjectPrototype = Object.getPrototypeOf(g).prototype;
 var GeneratorObjectPrototype_next = GeneratorObjectPrototype.next;
 
 // Monkeypatch next on an iterator.
 var inner = g(20);
 var outer = delegate(inner);
-assertIteratorResult(0, false, outer.next());
-assertIteratorResult(1, false, outer.next());
+assertIteratorResult(outer.next(), 0, false);
+assertIteratorResult(outer.next(), 1, false);
 inner.next = function() { return 0; };
 // 42 yielded directly without re-boxing.
 assertEq(0, outer.next());
 // Outer generator not terminated.
 assertEq(0, outer.next());
 // Restore.
 inner.next = GeneratorObjectPrototype_next;
-assertIteratorResult(2, false, outer.next());
+assertIteratorResult(outer.next(), 2, false);
 // Repatch.
 inner.next = function() { return { value: 42, done: true }; };
-assertIteratorResult(42, true, outer.next());
+assertIteratorResult(outer.next(), 42, true);
 
 // Monkeypunch next on the prototype.
 var inner = g(20);
 var outer = delegate(inner);
-assertIteratorResult(0, false, outer.next());
-assertIteratorResult(1, false, outer.next());
+assertIteratorResult(outer.next(), 0, false);
+assertIteratorResult(outer.next(), 1, false);
 GeneratorObjectPrototype.next = function() { return 0; };
 // 42 yielded directly without re-boxing.
 assertEq(0, GeneratorObjectPrototype_next.call(outer));
 // Outer generator not terminated.
 assertEq(0, GeneratorObjectPrototype_next.call(outer));
 // Restore.
 GeneratorObjectPrototype.next = GeneratorObjectPrototype_next;
-assertIteratorResult(2, false, outer.next());
+assertIteratorResult(outer.next(), 2, false);
 
 if (typeof reportCompare == "function")
     reportCompare(true, true);
--- a/js/src/tests/ecma_6/Generators/delegating-yield-4.js
+++ b/js/src/tests/ecma_6/Generators/delegating-yield-4.js
@@ -2,17 +2,17 @@
 
 function* g(n) { for (var i=0; i<n; i++) yield i; }
 function* delegate(iter) { return yield* iter; }
 
 var inner = g(20);
 var outer1 = delegate(inner);
 var outer2 = delegate(inner);
 
-assertIteratorResult(0, false, outer1.next());
-assertIteratorResult(1, false, outer2.next());
-assertIteratorResult(2, false, inner.next());
-assertIteratorResult(3, false, outer1.next());
-assertIteratorResult(4, false, outer2.next());
-assertIteratorResult(5, false, inner.next());
+assertIteratorResult(outer1.next(), 0, false);
+assertIteratorResult(outer2.next(), 1, false);
+assertIteratorResult(inner.next(), 2, false);
+assertIteratorResult(outer1.next(), 3, false);
+assertIteratorResult(outer2.next(), 4, false);
+assertIteratorResult(inner.next(), 5, false);
 
 if (typeof reportCompare == "function")
     reportCompare(true, true);
--- a/js/src/tests/ecma_6/Generators/iteration.js
+++ b/js/src/tests/ecma_6/Generators/iteration.js
@@ -8,50 +8,49 @@
 
 var GeneratorFunction = (function*(){yield 1;}).constructor;
 
 
 function TestGeneratorResultPrototype() {
     function* g() { yield 1; }
     var iter = g();
     var result = iter.next();
-    assertIteratorResult(1, false, result);
+    assertIteratorResult(result, 1, false);
     result = iter.next();
-    assertIteratorResult(undefined, true, result);
+    assertIteratorResult(result, undefined, true);
     assertThrowsInstanceOf(function() { iter.next() }, TypeError);
 }
 TestGeneratorResultPrototype();
 
 function TestGenerator(g, expected_values_for_next,
                        send_val, expected_values_for_send) {
     function testNext(thunk) {
         var iter = thunk();
         for (var i = 0; i < expected_values_for_next.length; i++) {
-            assertIteratorResult(expected_values_for_next[i],
-                                 i == expected_values_for_next.length - 1,
-                                 iter.next());
+            assertIteratorResult(iter.next(), expected_values_for_next[i],
+                                 i == expected_values_for_next.length - 1);
         }
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     function testSend(thunk) {
         var iter = thunk();
         for (var i = 0; i < expected_values_for_send.length; i++) {
-            assertIteratorResult(expected_values_for_send[i],
-                                 i == expected_values_for_send.length - 1,
-                                 i ? iter.next(send_val) : iter.next());
+            assertIteratorResult(i ? iter.next(send_val) : iter.next(),
+                                 expected_values_for_send[i],
+                                 i == expected_values_for_send.length - 1);
         }
         assertThrowsInstanceOf(function() { iter.next(send_val); }, TypeError);
     }
     function testThrow(thunk) {
         for (var i = 0; i < expected_values_for_next.length; i++) {
             var iter = thunk();
             for (var j = 0; j < i; j++) {
-                assertIteratorResult(expected_values_for_next[j],
-                                     j == expected_values_for_next.length - 1,
-                                     iter.next());
+                assertIteratorResult(iter.next(),
+                                     expected_values_for_next[j],
+                                     j == expected_values_for_next.length - 1);
             }
             var Sentinel = function () {}
             assertThrowsInstanceOf(function () { iter.throw(new Sentinel); }, Sentinel);
             assertThrowsInstanceOf(function () { iter.next(); }, TypeError);
         }
     }
 
     testNext(g);
@@ -330,134 +329,134 @@ TestGenerator(
     "foo",
     [42, undefined]);
 
 function TestTryCatch(instantiate) {
     function* g() { yield 1; try { yield 2; } catch (e) { yield e; } yield 3; }
     function Sentinel() {}
 
     function Test1(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
-        assertIteratorResult(3, false, iter.next());
-        assertIteratorResult(undefined, true, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
+        assertIteratorResult(iter.next(), 3, false);
+        assertIteratorResult(iter.next(), undefined, true);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test1(instantiate(g));
 
     function Test2(iter) {
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test2(instantiate(g));
 
     function Test3(iter) {
-        assertIteratorResult(1, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test3(instantiate(g));
 
     function Test4(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
         var exn = new Sentinel;
-        assertIteratorResult(exn, false, iter.throw(exn));
-        assertIteratorResult(3, false, iter.next());
-        assertIteratorResult(undefined, true, iter.next());
+        assertIteratorResult(iter.throw(exn), exn, false);
+        assertIteratorResult(iter.next(), 3, false);
+        assertIteratorResult(iter.next(), undefined, true);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test4(instantiate(g));
 
     function Test5(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
         var exn = new Sentinel;
-        assertIteratorResult(exn, false, iter.throw(exn));
-        assertIteratorResult(3, false, iter.next());
+        assertIteratorResult(iter.throw(exn), exn, false);
+        assertIteratorResult(iter.next(), 3, false);
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
 
     }
     Test5(instantiate(g));
 
     function Test6(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
         var exn = new Sentinel;
-        assertIteratorResult(exn, false, iter.throw(exn));
+        assertIteratorResult(iter.throw(exn), exn, false);
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test6(instantiate(g));
 }
 TestTryCatch(function (g) { return g(); });
 TestTryCatch(function* (g) { return yield* g(); });
 
 function TestTryFinally(instantiate) {
     function* g() { yield 1; try { yield 2; } finally { yield 3; } yield 4; }
     function Sentinel() {}
     function Sentinel2() {}
 
     function Test1(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
-        assertIteratorResult(3, false, iter.next());
-        assertIteratorResult(4, false, iter.next());
-        assertIteratorResult(undefined, true, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
+        assertIteratorResult(iter.next(), 3, false);
+        assertIteratorResult(iter.next(), 4, false);
+        assertIteratorResult(iter.next(), undefined, true);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test1(instantiate(g));
 
     function Test2(iter) {
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test2(instantiate(g));
 
     function Test3(iter) {
-        assertIteratorResult(1, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test3(instantiate(g));
 
     function Test4(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
-        assertIteratorResult(3, false, iter.throw(new Sentinel));
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
+        assertIteratorResult(iter.throw(new Sentinel), 3, false);
         assertThrowsInstanceOf(function() { iter.next(); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
 
     }
     Test4(instantiate(g));
 
     function Test5(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
-        assertIteratorResult(3, false, iter.throw(new Sentinel));
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
+        assertIteratorResult(iter.throw(new Sentinel), 3, false);
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel2); }, Sentinel2);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test5(instantiate(g));
 
     function Test6(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
-        assertIteratorResult(3, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
+        assertIteratorResult(iter.next(), 3, false);
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test6(instantiate(g));
 
     function Test7(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
-        assertIteratorResult(3, false, iter.next());
-        assertIteratorResult(4, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
+        assertIteratorResult(iter.next(), 3, false);
+        assertIteratorResult(iter.next(), 4, false);
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test7(instantiate(g));
 }
 TestTryFinally(function (g) { return g(); });
 TestTryFinally(function* (g) { return yield* g(); });
 
@@ -471,80 +470,80 @@ function TestNestedTry(instantiate) {
             yield 4;
         }
         yield 5;
     }
     function Sentinel() {}
     function Sentinel2() {}
 
     function Test1(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
-        assertIteratorResult(3, false, iter.next());
-        assertIteratorResult(4, false, iter.next());
-        assertIteratorResult(5, false, iter.next());
-        assertIteratorResult(undefined, true, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
+        assertIteratorResult(iter.next(), 3, false);
+        assertIteratorResult(iter.next(), 4, false);
+        assertIteratorResult(iter.next(), 5, false);
+        assertIteratorResult(iter.next(), undefined, true);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test1(instantiate(g));
 
     function Test2(iter) {
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test2(instantiate(g));
 
     function Test3(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(4, false, iter.throw(new Sentinel));
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.throw(new Sentinel), 4, false);
         assertThrowsInstanceOf(function() { iter.next(); }, Sentinel);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test3(instantiate(g));
 
     function Test4(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(4, false, iter.throw(new Sentinel));
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.throw(new Sentinel), 4, false);
         assertThrowsInstanceOf(function() { iter.throw(new Sentinel2); }, Sentinel2);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test4(instantiate(g));
 
     function Test5(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
         var exn = new Sentinel;
-        assertIteratorResult(exn, false, iter.throw(exn));
-        assertIteratorResult(3, false, iter.next());
-        assertIteratorResult(4, false, iter.next());
-        assertIteratorResult(5, false, iter.next());
-        assertIteratorResult(undefined, true, iter.next());
+        assertIteratorResult(iter.throw(exn), exn, false);
+        assertIteratorResult(iter.next(), 3, false);
+        assertIteratorResult(iter.next(), 4, false);
+        assertIteratorResult(iter.next(), 5, false);
+        assertIteratorResult(iter.next(), undefined, true);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
 
     }
     Test5(instantiate(g));
 
     function Test6(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
         var exn = new Sentinel;
-        assertIteratorResult(exn, false, iter.throw(exn));
-        assertIteratorResult(4, false, iter.throw(new Sentinel2));
+        assertIteratorResult(iter.throw(exn), exn, false);
+        assertIteratorResult(iter.throw(new Sentinel2), 4, false);
         assertThrowsInstanceOf(function() { iter.next(); }, Sentinel2);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
     }
     Test6(instantiate(g));
 
     function Test7(iter) {
-        assertIteratorResult(1, false, iter.next());
-        assertIteratorResult(2, false, iter.next());
+        assertIteratorResult(iter.next(), 1, false);
+        assertIteratorResult(iter.next(), 2, false);
         var exn = new Sentinel;
-        assertIteratorResult(exn, false, iter.throw(exn));
-        assertIteratorResult(3, false, iter.next());
-        assertIteratorResult(4, false, iter.throw(new Sentinel2));
+        assertIteratorResult(iter.throw(exn), exn, false);
+        assertIteratorResult(iter.next(), 3, false);
+        assertIteratorResult(iter.throw(new Sentinel2), 4, false);
         assertThrowsInstanceOf(function() { iter.next(); }, Sentinel2);
         assertThrowsInstanceOf(function() { iter.next(); }, TypeError);
 
     }
     Test7(instantiate(g));
 
     // That's probably enough.
 }
--- a/js/src/tests/ecma_6/Generators/shell.js
+++ b/js/src/tests/ecma_6/Generators/shell.js
@@ -11,12 +11,12 @@ var std_iterator = (function() {
         return name;
     }
     throw 'wat';
 })();
 
 function assertFalse(a) { assertEq(a, false) }
 function assertTrue(a) { assertEq(a, true) }
 function assertNotEq(found, not_expected) { assertFalse(found === expected) }
-function assertIteratorResult(value, done, result) {
+function assertIteratorResult(result, value, done) {
     assertDeepEq(result.value, value);
     assertEq(result.done, done);
 }