aboutsummaryrefslogtreecommitdiffstats
path: root/src/generators/yield-spread-arr-multiple.case
blob: 9d38f78979e24699fe2c0fdad2e3b9b5653df785 (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
// Copyright (C) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: Use yield value in a array spread position
template: default
info: |
  Array Initializer

  SpreadElement[Yield, Await]:
    ...AssignmentExpression[+In, ?Yield, ?Await]
includes:
  - compareArray.js
---*/

//- setup
var arr = ['a', 'b', 'c'];
var item;
//- body
  yield [...yield yield];
//- assertions
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item = iter.next(item.value);

assert(compareArray(item.value, arr));
assert.sameValue(item.done, false);