1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:27:35 +00:00

LibJS: Add content type check to InitializeTypedArrayFromTypedArray()

Resolves a FIXME.
This commit is contained in:
Linus Groh 2021-06-27 20:58:43 +01:00
parent d7750999b3
commit e08702a235
3 changed files with 7 additions and 2 deletions

View file

@ -158,7 +158,7 @@ test("typed array from TypedArray", () => {
BIGINT_TYPED_ARRAYS.forEach(T => {
expect(() => {
const newTypedArray = new T(u8Array);
}).toThrowWithMessage(TypeError, "Cannot convert number to BigInt");
}).toThrowWithMessage(TypeError, `Can't create ${T.name} from Uint8Array`);
const newBigIntTypedArray = new T(bigU64Array);
expect(newBigIntTypedArray[0]).toBe(1n);