mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
This matches our coding style recommendation in CodingStyle.md, and matches our python formatting.
21 lines
932 B
JavaScript
21 lines
932 B
JavaScript
test("Issue #9336, integer overflow in get_view_value", () => {
|
|
const dataView = new DataView(new ArrayBuffer(16));
|
|
expect(() => {
|
|
dataView.getUint32(0xfffffffc);
|
|
}).toThrowWithMessage(RangeError, "Data view byte offset 4294967292 is out of range for buffer with length 16");
|
|
});
|
|
|
|
test("Issue #9338, integer overflow in set_view_value", () => {
|
|
const dataView = new DataView(new ArrayBuffer(16));
|
|
expect(() => {
|
|
dataView.setUint32(0xfffffffc, 0);
|
|
}).toThrowWithMessage(RangeError, "Data view byte offset 4294967292 is out of range for buffer with length 16");
|
|
});
|
|
|
|
test("Issue #9338, integer overflow in set_view_value - zero-length DataView", () => {
|
|
const dataView = new DataView(new ArrayBuffer(4), 4);
|
|
expect(() => {
|
|
dataView.setUint32(0xfffffffc, 0);
|
|
}).toThrowWithMessage(RangeError, "Data view byte offset 4294967292 is out of range for buffer with length 0");
|
|
});
|