mirror of
https://github.com/tc39/test262.git
synced 2025-10-17 22:09:07 +02:00
35 lines
854 B
Plaintext
35 lines
854 B
Plaintext
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
/*---
|
|
template: default
|
|
desc: Rest element containing a rest element
|
|
info: |
|
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
|
|
|
BindingRestElement : ... BindingPattern
|
|
|
|
1. Let A be ArrayCreate(0).
|
|
[...]
|
|
3. Repeat
|
|
[...]
|
|
b. If iteratorRecord.[[done]] is true, then
|
|
i. Return the result of performing BindingInitialization of
|
|
BindingPattern with A and environment as the arguments.
|
|
[...]
|
|
---*/
|
|
|
|
//- setup
|
|
var values = [1, 2, 3];
|
|
//- elems
|
|
[...[...x]]
|
|
//- vals
|
|
values
|
|
//- body
|
|
assert(Array.isArray(x));
|
|
assert.sameValue(x.length, 3);
|
|
assert.sameValue(x[0], 1);
|
|
assert.sameValue(x[1], 2);
|
|
assert.sameValue(x[2], 3);
|
|
assert.notSameValue(x, values);
|
|
|