mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
LibJS: Implement Symbol.toStringTag
This commit is contained in:
parent
5ecd504f4e
commit
43d955014d
Notes:
sideshowbarker
2024-07-19 04:56:14 +09:00
Author: https://github.com/mattco98
Commit: 43d955014d
Pull-request: https://github.com/SerenityOS/serenity/pull/2765
11 changed files with 55 additions and 0 deletions
|
@ -2,6 +2,11 @@ test("length", () => {
|
|||
expect(Array.prototype[Symbol.iterator].length).toBe(0);
|
||||
});
|
||||
|
||||
test("@@toStringTag", () => {
|
||||
expect([].values()[Symbol.toStringTag]).toBe("Array Iterator");
|
||||
expect([].values().toString()).toBe("[object Array Iterator]");
|
||||
});
|
||||
|
||||
test("same function as Array.prototype.values", () => {
|
||||
expect(Array.prototype[Symbol.iterator]).toBe(Array.prototype.values);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue