azu / immutable-array-prototype

A collection of Immutable Array prototype methods(Per method packages).
MIT License
59 stars 3 forks source link

copyWithIn() with Array-like #20

Open azu opened 7 years ago

azu commented 7 years ago

Currently, following behavior.

import { copyWithin } from "@immutable-array/copyWithin";
const arrayLike = { length: 5, 3: 1 };
let actual = copyWithin(arrayLike, 0, 3);
assert.deepStrictEqual(actual, [1, , , 1,]);

Native Array#copyWithIn() work following:

[].copyWithin.call({length: 5, 3: 1}, 0, 3);
// {0: 1, 3: 1, length: 5}

It return just array-like object.

Is this no problem?