diff options
author | Linus Groh <mail@linusgroh.de> | 2020-12-02 12:11:21 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-02 14:39:53 +0100 |
commit | 0b086c759a658a02cf7edb05e74ffac1d0a8b41d (patch) | |
tree | aad942d9189e7fdfd1011ee03cd132a9228df41b /Libraries/LibJS/Tests | |
parent | 12cf6f86503cee499d093b7accebe6ad11bc1dae (diff) | |
download | serenity-0b086c759a658a02cf7edb05e74ffac1d0a8b41d.zip |
LibJS: Move TypedArray length getter to prototype
Diffstat (limited to 'Libraries/LibJS/Tests')
-rw-r--r-- | Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.length.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.length.js b/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.length.js new file mode 100644 index 0000000000..bbe85a2bf1 --- /dev/null +++ b/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.length.js @@ -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); + }); +}); |