Debian Codegraph @

js/src/tests/test262/language/statements/for/dstr/var-obj-ptrn-list-err.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/obj-ptrn-list-err.case
3 // - src/dstr-binding/error/for-var.template
4 /*---
5 description: Binding property list evaluation is interrupted by an abrupt completion (for statement)
6 esid: sec-for-statement-runtime-semantics-labelledevaluation
7 features: [destructuring-binding]
8 flags: [generated]
9 info: |
10 IterationStatement :
11 for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
12
13 1. Let varDcl be the result of evaluating VariableDeclarationList.
14 [...]
15
16 13.3.2.4 Runtime Semantics: Evaluation
17
18 VariableDeclarationList : VariableDeclarationList , VariableDeclaration
19
20 1. Let next be the result of evaluating VariableDeclarationList.
21 2. ReturnIfAbrupt(next).
22 3. Return the result of evaluating VariableDeclaration.
23
24 VariableDeclaration : BindingPattern Initializer
25
26 1. Let rhs be the result of evaluating Initializer.
27 2. Let rval be GetValue(rhs).
28 3. ReturnIfAbrupt(rval).
29 4. Return the result of performing BindingInitialization for BindingPattern
30 passing rval and undefined as arguments.
31
32 13.3.3.5 Runtime Semantics: BindingInitialization
33
34 BindingPropertyList : BindingPropertyList , BindingProperty
35
36 1. Let status be the result of performing BindingInitialization for
37 BindingPropertyList using value and environment as arguments.
38 2. ReturnIfAbrupt(status).
39 ---*/
40 var initCount = 0;
41 function thrower() {
42 throw new Test262Error();
43 }
44
45 assert.throws(Test262Error, function() {
46 for (var { a, b = thrower(), c = ++initCount } = {}; iterCount < 1; ) {
47 return;
48 }
49 });
50
51 assert.sameValue(initCount, 0);
52
53 reportCompare(0, 0);