summaryrefslogtreecommitdiff
path: root/test/built-ins/AsyncFromSyncIteratorPrototype/next/return-promise.js
blob: f4daeb01bceb4cd8ec048d7ff507c18ad149387a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (C) 2018 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-%asyncfromsynciteratorprototype%.next
description: >
  "next" returns a promise for an IteratorResult object
info: |
  %AsyncFromSyncIteratorPrototype%.next ( value )
  ...
  2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
  ...
  18. Return promiseCapability.[[Promise]].

features: [async-iteration]
---*/

function* g() {
}

async function* asyncg() {
  yield* g();
}

var result = asyncg().next();
assert(result instanceof Promise)