aboutsummaryrefslogtreecommitdiffstats
path: root/src/dstr-assignment-for-await/array-rest-elision.case
blob: 17f9c868c8c5487ef51fb51df9d716d77e23642c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: >
    ArrayAssignmentPattern may include elisions at any position preceeding a
    AssignmentRestElement in a AssignmentElementList.
template: default
---*/

//- setup
let x, y;
//- elems
[, , x, , ...y]
//- vals
[1, 2, 3, 4, 5, 6]
//- body
assert.sameValue(x, 3);
assert.sameValue(y.length, 2);
assert.sameValue(y[0], 5);
assert.sameValue(y[1], 6);



//- teardown
promise
  .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
  .then($DONE, $DONE);