diff options
author | Valerie <spectranaut@gmail.com> | 2018-03-02 09:44:23 -0500 |
---|---|---|
committer | Leo Balter <leonardo.balter@gmail.com> | 2018-03-02 09:44:23 -0500 |
commit | e14a9ad9fefaf94454695e74db9873282ea22880 (patch) | |
tree | e8794a10e3a3f3049c2b1bb1da7ab4afab333efa /test/built-ins/AsyncGeneratorPrototype/return/return-promise.js | |
parent | 4a3e19b3e4f04be2d747ca5d7529115f5cf85169 (diff) | |
download | qtdeclarative-testsuites-e14a9ad9fefaf94454695e74db9873282ea22880.tar.gz |
async-iteration: AsyncGeneratorPrototype tests (#1451)
Diffstat (limited to 'test/built-ins/AsyncGeneratorPrototype/return/return-promise.js')
-rw-r--r-- | test/built-ins/AsyncGeneratorPrototype/return/return-promise.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/built-ins/AsyncGeneratorPrototype/return/return-promise.js b/test/built-ins/AsyncGeneratorPrototype/return/return-promise.js new file mode 100644 index 000000000..07dff9f65 --- /dev/null +++ b/test/built-ins/AsyncGeneratorPrototype/return/return-promise.js @@ -0,0 +1,28 @@ +// Copyright (C) 2018 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-asyncgenerator-prototype-next +description: > + "return" returns a promise +info: | + AsyncGenerator.prototype.return ( value ) + 1. Let generator be the this value. + 2. Let completion be Completion{[[Type]]: return, [[Value]]: value, + [[Target]]: empty}. + 3. Return ! AsyncGeneratorEnqueue(generator, completion). + + AsyncGeneratorEnqueue ( generator, completion ) + ... + 2. Let promiseCapability be ! NewPromiseCapability(%Promise%). + ... + 9. Return promiseCapability.[[Promise]]. + +includes: [propertyHelper.js] +features: [async-iteration] +---*/ + +async function* g() {} +var result = g().return() + +assert(result instanceof Promise) |