blob: d0ca059821c8c31ec9b8957c0864e0762fa2f86e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
template: iter-close
desc: >
The iterator is properly consumed by the destructuring pattern
features: [generators]
---*/
//- setup
const iter = (function* () {
yield;
yield;
})();
//- elems
[...x]
//- iter
iter
//- assertions
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
|