mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +00:00
LibJS: Move TypedArray length getter to prototype
This commit is contained in:
parent
12cf6f8650
commit
0b086c759a
Notes:
sideshowbarker
2024-07-19 01:05:42 +09:00
Author: https://github.com/linusg
Commit: 0b086c759a
Pull-request: https://github.com/SerenityOS/serenity/pull/4305
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