mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
LibJS: Fix small issues in Array.prototype.concat
This commit is contained in:
parent
91de1135a5
commit
9d1fd403af
2 changed files with 12 additions and 2 deletions
|
@ -40,4 +40,14 @@ describe("normal behavior", () => {
|
|||
expect(concatenated[4]).toBe(1);
|
||||
expect(concatenated[5]).toEqual([2, 3]);
|
||||
});
|
||||
|
||||
test("Proxy is concatenated as array", () => {
|
||||
var proxy = new Proxy([9, 8], {});
|
||||
var concatenated = array.concat(proxy);
|
||||
expect(array).toHaveLength(1);
|
||||
expect(concatenated).toHaveLength(3);
|
||||
expect(concatenated[0]).toBe("hello");
|
||||
expect(concatenated[1]).toBe(9);
|
||||
expect(concatenated[2]).toBe(8);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue