Debian Codegraph @

js/src/tests/test262/language/expressions/async-function/named-reassign-fn-name-in-body.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/function-forms/reassign-fn-name-in-body.case
4 // - src/function-forms/expr-named/async-func-expr-named-no-strict.template
5 /*---
6 description: Reassignment of function name is silently ignored in non-strict mode code. (async function named expression in non-strict mode code)
7 esid: sec-async-function-definitions
8 features: [async-functions]
9 flags: [generated, async, noStrict]
10 includes: [asyncHelpers.js]
11 info: |
12 Async Function Definitions
13
14 AsyncFunctionExpression :
15 async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
16
17 ---*/
18
19 // increment callCount in case "body"
20 let callCount = 0;
21 let ref = async function BindingIdentifier() {
22 callCount++;
23 BindingIdentifier = 1;
24 return BindingIdentifier;
25 };
26
27 asyncTest(async () => {
28 assert.sameValue(await ref(), ref);
29 assert.sameValue(callCount, 1, 'function invoked exactly once');
30 });
31