diff options
author | larissayvette <larissayvette55@gmail.com> | 2017-02-10 15:31:14 +0100 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-05-27 21:11:26 -0700 |
commit | 234353a1b81a474ef93e1039afc2441ca81810d5 (patch) | |
tree | b48a63d36993d67e6af67f8d1b81876358137df1 /test/parallel/test-buffer-compare-offset.js | |
parent | 1474b7a0328350670e7351096c72a280ed9140ea (diff) | |
download | android-node-v8-234353a1b81a474ef93e1039afc2441ca81810d5.tar.gz android-node-v8-234353a1b81a474ef93e1039afc2441ca81810d5.tar.bz2 android-node-v8-234353a1b81a474ef93e1039afc2441ca81810d5.zip |
lib,src: refactor buffer out of range index
PR-URL: https://github.com/nodejs/node/pull/11296
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-buffer-compare-offset.js')
-rw-r--r-- | test/parallel/test-buffer-compare-offset.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-buffer-compare-offset.js b/test/parallel/test-buffer-compare-offset.js index 037e82e055..e5c7a69110 100644 --- a/test/parallel/test-buffer-compare-offset.js +++ b/test/parallel/test-buffer-compare-offset.js @@ -1,6 +1,6 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const a = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]); @@ -57,7 +57,7 @@ assert.strictEqual(1, a.compare(b, Infinity, -Infinity)); // zero length target because default for targetEnd <= targetSource assert.strictEqual(1, a.compare(b, '0xff')); -const oor = /out of range index/; +const oor = common.expectsError({code: 'ERR_INDEX_OUT_OF_RANGE'}); assert.throws(() => a.compare(b, 0, 100, 0), oor); assert.throws(() => a.compare(b, 0, 1, 0, 100), oor); |