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

LibJS: Change error message for values that must be a SharedArrayBuffer

This error will be used in contexts that apply to more than TypedArrays.
This commit is contained in:
Timothy Flynn 2023-12-28 09:11:48 -05:00 committed by Andreas Kling
parent d4a6564e5a
commit 834ced9ef8
3 changed files with 3 additions and 9 deletions

View file

@ -98,7 +98,7 @@
M(NotAnObjectOfType, "Not an object of type {}") \ M(NotAnObjectOfType, "Not an object of type {}") \
M(NotAnObjectOrNull, "{} is neither an object nor null") \ M(NotAnObjectOrNull, "{} is neither an object nor null") \
M(NotAnObjectOrString, "{} is neither an object nor a string") \ M(NotAnObjectOrString, "{} is neither an object nor a string") \
M(NotASharedArrayBuffer, "The TypedArray's underlying buffer must be a SharedArrayBuffer") \ M(NotASharedArrayBuffer, "The array buffer object must be a SharedArrayBuffer") \
M(NotAString, "{} is not a string") \ M(NotAString, "{} is not a string") \
M(NotASymbol, "{} is not a symbol") \ M(NotASymbol, "{} is not a symbol") \
M(NotImplemented, "TODO({} is not implemented in LibJS)") \ M(NotImplemented, "TODO({} is not implemented in LibJS)") \

View file

@ -31,10 +31,7 @@ describe("errors", () => {
expect(() => { expect(() => {
const typedArray = new Int32Array(4); const typedArray = new Int32Array(4);
Atomics.wait(typedArray, 0, 0, 0); Atomics.wait(typedArray, 0, 0, 0);
}).toThrowWithMessage( }).toThrowWithMessage(TypeError, "The array buffer object must be a SharedArrayBuffer");
TypeError,
"The TypedArray's underlying buffer must be a SharedArrayBuffer"
);
}); });
test("invalid index", () => { test("invalid index", () => {

View file

@ -31,10 +31,7 @@ describe("errors", () => {
expect(() => { expect(() => {
const typedArray = new Int32Array(4); const typedArray = new Int32Array(4);
Atomics.waitAsync(typedArray, 0, 0, 0); Atomics.waitAsync(typedArray, 0, 0, 0);
}).toThrowWithMessage( }).toThrowWithMessage(TypeError, "The array buffer object must be a SharedArrayBuffer");
TypeError,
"The TypedArray's underlying buffer must be a SharedArrayBuffer"
);
}); });
test("invalid index", () => { test("invalid index", () => {