Debian Codegraph @

js/src/tests/test262/language/expressions/async-function/forbidden-ext/b1/async-func-expr-named-forbidden-ext-direct-access-prop-arguments.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
4 // - src/function-forms/forbidden-extensions/bullet-one/async-func-expr-named.template
5 /*---
6 description: Forbidden extension, f.arguments (async function named expression)
7 esid: sec-async-function-definitions
8 features: [arrow-function, async-functions]
9 flags: [generated, noStrict, async]
10 info: |
11 AsyncFunctionExpression :
12 async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
13
14
15 ECMAScript function objects defined using syntactic constructors in strict mode code must
16 not be created with own properties named "caller" or "arguments". Such own properties also
17 must not be created for function objects defined using an ArrowFunction, MethodDefinition,
18 GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
19 ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
20 AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
21 Built-in functions, strict functions created using the Function constructor, generator functions
22 created using the Generator constructor, async functions created using the AsyncFunction
23 constructor, and functions created using the bind method also must not be created with such own
24 properties.
25
26 ---*/
27
28
29 var callCount = 0;
30 var f = async function f() {
31 assert.sameValue(f.hasOwnProperty("arguments"), false);
32 callCount++;
33 }
34
35 f()
36 .then(() => {
37 assert.sameValue(callCount, 1, 'function body evaluated');
38 }, $DONE).then($DONE, $DONE);