mirror of
https://github.com/tc39/test262.git
synced 2025-07-30 01:14:56 +02:00
Array binding: add rest element direct binding test case
This commit is contained in:
parent
432f6b4b72
commit
e10392423a
27
src/dstr-binding/ary-ptrn-rest-id-direct.case
Normal file
27
src/dstr-binding/ary-ptrn-rest-id-direct.case
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
desc: Lone rest element (direct binding)
|
||||||
|
template: default
|
||||||
|
info: |
|
||||||
|
Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingRestElement : ... BindingIdentifier
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. Let A be ! ArrayCreate(0).
|
||||||
|
3. Let n be 0.
|
||||||
|
4. Repeat,
|
||||||
|
[...]
|
||||||
|
f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
|
||||||
|
g. Set n to n + 1.
|
||||||
|
includes: [compareArray.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- elems
|
||||||
|
[...x]
|
||||||
|
//- vals
|
||||||
|
[1]
|
||||||
|
//- body
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.compareArray(x, [1]);
|
Loading…
x
Reference in New Issue
Block a user