mirror of
https://github.com/tc39/test262.git
synced 2025-07-14 01:24:39 +02:00
30 lines
671 B
Plaintext
30 lines
671 B
Plaintext
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-async-arrow-function-definitions
|
|
desc: >
|
|
Async function returns an async function.
|
|
templates:
|
|
- evaluation/async-class-*.template
|
|
- evaluation/async-declaration.template
|
|
- evaluation/async-expression-*.template
|
|
- evaluation/async-obj-method.template
|
|
flags: [async]
|
|
---*/
|
|
|
|
//- setup
|
|
let count = 0;
|
|
//- params
|
|
x
|
|
//- body
|
|
return async () => x;
|
|
//- teardown
|
|
asyncFn(1).then(retFn => {
|
|
count++;
|
|
return retFn();
|
|
}).then(result => {
|
|
assert.sameValue(result, 1);
|
|
assert.sameValue(count, 1);
|
|
}).then($DONE, $DONE);
|