test262/src/generators/yield-spread-arr-multiple.case

28 lines
614 B
Plaintext

// 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);