From 651becbfb1c4abf43c93fb2520ca62a54c1e6f24 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 6 Jul 2021 02:27:09 +0100 Subject: [PATCH] LibJS: Use Number instead of parseInt in TypedArray forEach BigInt tests The Number constructor previously didn't support converting BigInts to regular numbers, so I used parseInt as a workaround. Since it now supports this, this workaround is no longer needed. --- .../Tests/builtins/TypedArray/TypedArray.prototype.forEach.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.forEach.js b/Userland/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.forEach.js index 03384d6d87..ea2e19c9ac 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.forEach.js +++ b/Userland/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.forEach.js @@ -95,7 +95,7 @@ describe("normal behaviour", () => { const typedArray = new T([1n, 2n, 3n]); typedArray.forEach((value, index) => { expect(value).toBe(typedArray[index]); - expect(index).toBe(parseInt(typedArray[index] - 1n)); + expect(index).toBe(Number(typedArray[index] - 1n)); }); }); });