Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer: improve ERR_BUFFER_OUT_OF_BOUNDS default #29098

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ E('ERR_BUFFER_OUT_OF_BOUNDS',
if (name) {
return `"${name}" is outside of buffer bounds`;
}
return 'Attempt to write outside buffer bounds';
return 'Attempt to access memory outside buffer bounds';
}, RangeError);
E('ERR_BUFFER_TOO_LARGE',
`Cannot create a Buffer larger than 0x${kMaxLength.toString(16)} bytes`,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-fill.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ common.expectsError(() => {
}, {
code: 'ERR_BUFFER_OUT_OF_BOUNDS',
type: RangeError,
message: 'Attempt to write outside buffer bounds'
message: 'Attempt to access memory outside buffer bounds'
});

assert.deepStrictEqual(
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const OOR_ERROR =
const OOB_ERROR =
{
name: 'RangeError',
message: 'Attempt to write outside buffer bounds'
message: 'Attempt to access memory outside buffer bounds'
};

// Attempt to overflow buffers, similar to previous bug in array buffers
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-readdouble.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ assert.strictEqual(buffer.readDoubleLE(0), -Infinity);
{
code: 'ERR_BUFFER_OUT_OF_BOUNDS',
name: 'RangeError',
message: 'Attempt to write outside buffer bounds'
message: 'Attempt to access memory outside buffer bounds'
});

[NaN, 1.01].forEach((offset) => {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-readfloat.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ assert.strictEqual(buffer.readFloatLE(0), -Infinity);
{
code: 'ERR_BUFFER_OUT_OF_BOUNDS',
name: 'RangeError',
message: 'Attempt to write outside buffer bounds'
message: 'Attempt to access memory outside buffer bounds'
});

[NaN, 1.01].forEach((offset) => {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-writedouble.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ assert.ok(Number.isNaN(buffer.readDoubleLE(8)));
{
code: 'ERR_BUFFER_OUT_OF_BOUNDS',
name: 'RangeError',
message: 'Attempt to write outside buffer bounds'
message: 'Attempt to access memory outside buffer bounds'
});

['', '0', null, {}, [], () => {}, true, false].forEach((off) => {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-writefloat.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ assert.ok(Number.isNaN(buffer.readFloatLE(4)));
{
code: 'ERR_BUFFER_OUT_OF_BOUNDS',
name: 'RangeError',
message: 'Attempt to write outside buffer bounds'
message: 'Attempt to access memory outside buffer bounds'
});

['', '0', null, {}, [], () => {}, true, false].forEach((off) => {
Expand Down