summaryrefslogtreecommitdiff
path: root/test/parallel/test-buffer-alloc.js
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-04-16 22:25:11 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-04-19 12:09:24 +0800
commit7e269f52667104c94dcf65e527b04c2632d701bb (patch)
tree666f38bae7f287432d4caa2bdd3d8a2c2c4933c2 /test/parallel/test-buffer-alloc.js
parent0f16528247b2b1dee1e5825d3fee17f0c00bd5e6 (diff)
downloadandroid-node-v8-7e269f52667104c94dcf65e527b04c2632d701bb.tar.gz
android-node-v8-7e269f52667104c94dcf65e527b04c2632d701bb.tar.bz2
android-node-v8-7e269f52667104c94dcf65e527b04c2632d701bb.zip
src: migrate ERR_INDEX_OUT_OF_RANGE in C++
This patch migrates the "Index out of range" errors in C++ to errors with the code `ERR_INDEX_OUT_OF_RANGE` which have equivalents in JavaScript. PR-URL: https://github.com/nodejs/node/pull/20121 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'test/parallel/test-buffer-alloc.js')
-rw-r--r--test/parallel/test-buffer-alloc.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js
index bce0ad8381..b06ca2a68c 100644
--- a/test/parallel/test-buffer-alloc.js
+++ b/test/parallel/test-buffer-alloc.js
@@ -982,7 +982,11 @@ common.expectsError(() => {
const a = Buffer.alloc(1);
const b = Buffer.alloc(1);
a.copy(b, 0, 0x100000000, 0x100000001);
-}, { code: undefined, type: RangeError, message: 'Index out of range' });
+}, {
+ code: 'ERR_INDEX_OUT_OF_RANGE',
+ type: RangeError,
+ message: 'Index out of range'
+});
// Unpooled buffer (replaces SlowBuffer)
{