mirror of https://github.com/tc39/test262.git
Generate tests
This commit is contained in:
parent
3291704eb2
commit
883db87a51
|
@ -179,45 +179,42 @@ iter.next("next-arg-1").then(v => {
|
|||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (1)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[10].name, "get next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
assert.sameValue(log[9].name, "get next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next");
|
||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
||||
assert.sameValue(log[10].name, "call next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
assert.sameValue(log[11].name, "get next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "call next then (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
||||
assert.sameValue(log[12].name, "call next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[14].name, "get next done (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
assert.sameValue(log[13].name, "get next done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "get next value (2)");
|
||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
assert.sameValue(log[14].name, "get next value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[16].name, "after yield*");
|
||||
assert.sameValue(log[16].value, "next-value-2");
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 17, "log.length");
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
|
|
|
@ -23,25 +23,20 @@ info: |
|
|||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -199,42 +194,39 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call return");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call return then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get return done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get return value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -23,22 +23,20 @@ info: |
|
|||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -201,45 +199,42 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call throw");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call throw then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get throw value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "throw-value-2");
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -179,45 +179,42 @@ iter.next("next-arg-1").then(v => {
|
|||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (1)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[10].name, "get next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
assert.sameValue(log[9].name, "get next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next");
|
||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
||||
assert.sameValue(log[10].name, "call next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
assert.sameValue(log[11].name, "get next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "call next then (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
||||
assert.sameValue(log[12].name, "call next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[14].name, "get next done (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
assert.sameValue(log[13].name, "get next done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "get next value (2)");
|
||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
assert.sameValue(log[14].name, "get next value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[16].name, "after yield*");
|
||||
assert.sameValue(log[16].value, "next-value-2");
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 17, "log.length");
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
|
|
|
@ -23,25 +23,20 @@ info: |
|
|||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -199,42 +194,39 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call return");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call return then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get return done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get return value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -23,22 +23,20 @@ info: |
|
|||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -201,45 +199,42 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call throw");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call throw then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get throw value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "throw-value-2");
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -186,45 +186,42 @@ iter.next("next-arg-1").then(v => {
|
|||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (1)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[10].name, "get next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
assert.sameValue(log[9].name, "get next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next");
|
||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
||||
assert.sameValue(log[10].name, "call next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
assert.sameValue(log[11].name, "get next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "call next then (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
||||
assert.sameValue(log[12].name, "call next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[14].name, "get next done (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
assert.sameValue(log[13].name, "get next done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "get next value (2)");
|
||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
assert.sameValue(log[14].name, "get next value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[16].name, "after yield*");
|
||||
assert.sameValue(log[16].value, "next-value-2");
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 17, "log.length");
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
|
|
|
@ -28,25 +28,20 @@ info: |
|
|||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -206,42 +201,39 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call return");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call return then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get return done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get return value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -28,22 +28,20 @@ info: |
|
|||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -208,45 +206,42 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call throw");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call throw then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get throw value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "throw-value-2");
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -186,45 +186,42 @@ iter.next("next-arg-1").then(v => {
|
|||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (1)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[10].name, "get next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
assert.sameValue(log[9].name, "get next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next");
|
||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
||||
assert.sameValue(log[10].name, "call next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
assert.sameValue(log[11].name, "get next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "call next then (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
||||
assert.sameValue(log[12].name, "call next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[14].name, "get next done (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
assert.sameValue(log[13].name, "get next done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "get next value (2)");
|
||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
assert.sameValue(log[14].name, "get next value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[16].name, "after yield*");
|
||||
assert.sameValue(log[16].value, "next-value-2");
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 17, "log.length");
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
|
|
|
@ -28,25 +28,20 @@ info: |
|
|||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -206,42 +201,39 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call return");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call return then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get return done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get return value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -28,22 +28,20 @@ info: |
|
|||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -208,45 +206,42 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call throw");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call throw then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get throw value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "throw-value-2");
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -179,45 +179,42 @@ iter.next("next-arg-1").then(v => {
|
|||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (1)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[10].name, "get next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
assert.sameValue(log[9].name, "get next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next");
|
||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
||||
assert.sameValue(log[10].name, "call next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
assert.sameValue(log[11].name, "get next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "call next then (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
||||
assert.sameValue(log[12].name, "call next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[14].name, "get next done (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
assert.sameValue(log[13].name, "get next done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "get next value (2)");
|
||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
assert.sameValue(log[14].name, "get next value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[16].name, "after yield*");
|
||||
assert.sameValue(log[16].value, "next-value-2");
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 17, "log.length");
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
|
|
|
@ -22,25 +22,20 @@ info: |
|
|||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -199,42 +194,39 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call return");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call return then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get return done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get return value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -22,22 +22,20 @@ info: |
|
|||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -201,45 +199,42 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call throw");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call throw then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get throw value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "throw-value-2");
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -179,45 +179,42 @@ iter.next("next-arg-1").then(v => {
|
|||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (1)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[10].name, "get next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
assert.sameValue(log[9].name, "get next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next");
|
||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
||||
assert.sameValue(log[10].name, "call next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
assert.sameValue(log[11].name, "get next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "call next then (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
||||
assert.sameValue(log[12].name, "call next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[14].name, "get next done (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
assert.sameValue(log[13].name, "get next done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "get next value (2)");
|
||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
assert.sameValue(log[14].name, "get next value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[16].name, "after yield*");
|
||||
assert.sameValue(log[16].value, "next-value-2");
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 17, "log.length");
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
|
|
|
@ -23,25 +23,20 @@ info: |
|
|||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -199,42 +194,39 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call return");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call return then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get return done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get return value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -23,22 +23,20 @@ info: |
|
|||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -201,45 +199,42 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call throw");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call throw then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get throw value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "throw-value-2");
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -186,45 +186,42 @@ iter.next("next-arg-1").then(v => {
|
|||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (1)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[10].name, "get next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
assert.sameValue(log[9].name, "get next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next");
|
||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
||||
assert.sameValue(log[10].name, "call next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
assert.sameValue(log[11].name, "get next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "call next then (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
||||
assert.sameValue(log[12].name, "call next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[14].name, "get next done (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
assert.sameValue(log[13].name, "get next done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "get next value (2)");
|
||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
assert.sameValue(log[14].name, "get next value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[16].name, "after yield*");
|
||||
assert.sameValue(log[16].value, "next-value-2");
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 17, "log.length");
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
|
|
|
@ -28,25 +28,20 @@ info: |
|
|||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -206,42 +201,39 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call return");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call return then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get return done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get return value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -28,22 +28,20 @@ info: |
|
|||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -208,45 +206,42 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call throw");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call throw then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get throw value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "throw-value-2");
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -186,45 +186,42 @@ iter.next("next-arg-1").then(v => {
|
|||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (1)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[10].name, "get next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
assert.sameValue(log[9].name, "get next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next");
|
||||
assert.sameValue(log[11].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[11].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[11].args[0], "next-arg-2", "next args[0]");
|
||||
assert.sameValue(log[10].name, "call next");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[10].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
assert.sameValue(log[11].name, "get next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "call next then (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[13].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[13].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[13].args[1], "function", "next then args[1]");
|
||||
assert.sameValue(log[12].name, "call next then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[14].name, "get next done (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
assert.sameValue(log[13].name, "get next done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "get next value (2)");
|
||||
assert.sameValue(log[15].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
assert.sameValue(log[14].name, "get next value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[16].name, "after yield*");
|
||||
assert.sameValue(log[16].value, "next-value-2");
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 17, "log.length");
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
|
|
|
@ -28,25 +28,20 @@ info: |
|
|||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -206,42 +201,39 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call return");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[10].args[0], "return-arg-2", "return args[0]");
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call return then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "return then args[1]");
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get return done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get return value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
|
@ -28,22 +28,20 @@ info: |
|
|||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
GeneratorYield ( iterNextObj )
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
10. If generatorKind is async,
|
||||
a. Let value be IteratorValue(iterNextObj).
|
||||
b. Let done be IteratorComplete(iterNextObj).
|
||||
c. Return ! AsyncGeneratorResolve(generator, value, done).
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
|
@ -208,45 +206,42 @@ iter.next().then(v => {
|
|||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "get throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "call throw");
|
||||
assert.sameValue(log[10].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[10].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[10].args[0], "throw-arg-2", "throw args[0]");
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[11].name, "get throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[12].name, "call throw then (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[12].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[12].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[12].args[1], "function", "throw then args[1]");
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw done (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "get throw value (2)");
|
||||
assert.sameValue(log[14].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[15].name, "after yield*");
|
||||
assert.sameValue(log[15].value, "throw-value-2");
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 16, "log.length");
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
|
Loading…
Reference in New Issue