mirror of
https://github.com/tc39/test262.git
synced 2025-05-20 14:50:28 +02:00
28 lines
614 B
Plaintext
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);
|