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:
parent
12cf6f8650
commit
0b086c759a
5 changed files with 58 additions and 35 deletions
|
@ -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);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue