summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2017-02-16 16:55:56 +0200
committerGitHub <noreply@github.com>2017-02-16 16:55:56 +0200
commit00c86cc8e9b5172372571cc122ebeb6d5a7e5e93 (patch)
tree647429bd4077c6fe04b3c3b0a50c21e99299bed2 /test
parentbd07c8fc12e88746b1da93aeecc8562faa14be2f (diff)
downloadandroid-node-v8-00c86cc8e9b5172372571cc122ebeb6d5a7e5e93.tar.gz
android-node-v8-00c86cc8e9b5172372571cc122ebeb6d5a7e5e93.tar.bz2
android-node-v8-00c86cc8e9b5172372571cc122ebeb6d5a7e5e93.zip
buffer: remove Uint8Array check
This makes write[U]Int* operations on Buffer with `noAssert=false` about 3 times faster. PR-URL: https://github.com/nodejs/node/pull/11324 Refs: https://github.com/nodejs/node/issues/11245 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-buffer-write-noassert.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/parallel/test-buffer-write-noassert.js b/test/parallel/test-buffer-write-noassert.js
index ea5ca923f0..7423e462ca 100644
--- a/test/parallel/test-buffer-write-noassert.js
+++ b/test/parallel/test-buffer-write-noassert.js
@@ -20,14 +20,10 @@ function write(funx, args, result, res) {
);
}
- {
- const error = /Int/.test(funx) ?
- /^TypeError: "buffer" argument must be a Buffer or Uint8Array$/ :
- /^TypeError: argument should be a Buffer$/;
-
+ if (!/Int/.test(funx)) {
assert.throws(
() => Buffer.alloc(9)[funx].apply(new Uint32Array(1), args),
- error
+ /^TypeError: argument should be a Buffer$/
);
}