1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibJS: Remove String.prototype.length

A string's length property is supposed to be a regular non-writable,
non-enumerable, non-configurable property on the StringObject instead.
This commit is contained in:
Linus Groh 2021-06-06 16:46:14 +01:00 committed by Andreas Kling
parent fc2673d111
commit 8d7ec28924
5 changed files with 11 additions and 12 deletions

View file

@ -62,6 +62,7 @@ describe("normal behavior", () => {
});
test("native getter function", () => {
expect(Reflect.get(String.prototype, "length", "foo")).toBe(3);
const typedArray = new Uint8Array(3);
expect(Reflect.get(Uint8Array.prototype, "length", typedArray)).toBe(3);
});
});