Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-arrow-function/dflt-params-abrupt.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/function-forms/dflt-params-abrupt.case
3 // - src/function-forms/error/async-arrow-function.template
4 /*---
5 description: Abrupt completion returned by evaluation of initializer (async arrow function expression)
6 esid: sec-async-arrow-function-definitions
7 features: [default-parameters]
8 flags: [generated, async]
9 info: |
10 14.7 Async Arrow Function Definitions
11
12 AsyncArrowFunction :
13 ...
14 CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
15
16 AsyncConciseBody :
17 { AsyncFunctionBody }
18
19 ...
20
21 Supplemental Syntax
22
23 When processing an instance of the production AsyncArrowFunction :
24 CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody the interpretation of
25 CoverCallExpressionAndAsyncArrowHead is refined using the following grammar:
26
27 AsyncArrowHead :
28 async ArrowFormalParameters
29
30
31 14.1.19 Runtime Semantics: IteratorBindingInitialization
32
33 FormalsList : FormalsList , FormalParameter
34
35 1. Let status be the result of performing IteratorBindingInitialization for
36 FormalsList using iteratorRecord and environment as the arguments.
37 2. ReturnIfAbrupt(status).
38 3. Return the result of performing IteratorBindingInitialization for
39 FormalParameter using iteratorRecord and environment as the arguments.
40
41 ---*/
42
43
44 var callCount = 0;
45 var f;
46 f = async (_ = (function() { throw new Test262Error(); }())) => {
47
48 callCount = callCount + 1;
49 };
50
51 f()
52 .then(_ => {
53 throw new Test262Error('function should not be resolved');
54 }, error => assert.sameValue(error.constructor, Test262Error))
55 .then(() => {
56 assert.sameValue(callCount, 0, 'function body is not evaluated');
57 }, $DONE)
58 .then($DONE, $DONE);