OLD | NEW |
(Empty) | |
| 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 <caitp@igalia.com> |
| 6 esid: 14.4 |
| 7 description: > |
| 8 AwaitExpressions are valid operands to yield expressions. |
| 9 flags: [async] |
| 10 ---*/ |
| 11 |
| 12 var iter = (async function*() { |
| 13 yield await "a"; |
| 14 })(); |
| 15 |
| 16 iter.next().then(function(result) { |
| 17 assert.sameValue(result.value, "a", 'First result `value`'); |
| 18 assert.sameValue(result.done, false, 'First result `done` flag'); |
| 19 }, $DONE); |
| 20 |
| 21 iter.next().then(function(result) { |
| 22 assert.sameValue(result.value, undefined, 'Second result `value`'); |
| 23 assert.sameValue(result.done, true, 'Second result `done` flag'); |
| 24 $DONE(); |
| 25 }, $DONE); |
OLD | NEW |