Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-generator/expression-await-as-yield-operand.js

raw
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 author: Caitlin Potter <[email protected]>
6 esid: sec-generator-function-definitions
7 description: >
8 AwaitExpressions are valid operands to yield expressions.
9 flags: [async]
10 features: [async-iteration]
11 ---*/
12
13 var iter = (async function*() {
14 yield await "a";
15 })();
16
17 iter.next().then(function(result) {
18 assert.sameValue(result.value, "a", 'First result `value`');
19 assert.sameValue(result.done, false, 'First result `done` flag');
20 }).then(undefined, $DONE);
21
22 iter.next().then(function(result) {
23 assert.sameValue(result.value, undefined, 'Second result `value`');
24 assert.sameValue(result.done, true, 'Second result `done` flag');
25 }).then($DONE, $DONE);