1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

LibJS: Move TypedArray length getter to prototype

This commit is contained in:
Linus Groh 2020-12-02 12:11:21 +00:00 committed by Andreas Kling
parent 12cf6f8650
commit 0b086c759a
5 changed files with 58 additions and 35 deletions

View file

@ -0,0 +1,10 @@
// Update when more typed arrays get added
const TYPED_ARRAYS = [Uint8Array, Uint16Array, Uint32Array, Int8Array, Int16Array, Int32Array];
test("basic functionality", () => {
TYPED_ARRAYS.forEach(T => {
const typedArray = new T(42);
expect(Object.hasOwnProperty(typedArray, "length")).toBeFalse();
expect(typedArray.length).toBe(42);
});
});