summaryrefslogtreecommitdiff
path: root/src/node_util.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-12-10 22:28:37 +0100
committerAnna Henningsen <anna@addaleax.net>2016-12-21 07:48:14 +0100
commitbeca3244e2792bc4257f480b138c1b603de3781c (patch)
treef298c9f0deef44b2003f4bc4da1098fef0347d76 /src/node_util.cc
parent6cb33c0764f307e33d29655cd1bac2916656352a (diff)
downloadandroid-node-v8-beca3244e2792bc4257f480b138c1b603de3781c.tar.gz
android-node-v8-beca3244e2792bc4257f480b138c1b603de3781c.tar.bz2
android-node-v8-beca3244e2792bc4257f480b138c1b603de3781c.zip
buffer: allow Uint8Array input to methods
Allow all methods on `buffer` and `Buffer` to take `Uint8Array` arguments where it makes sense. On the native side, there is effectively no difference, and as a bonus the `isUint8Array` check is faster than `instanceof Buffer`. PR-URL: https://github.com/nodejs/node/pull/10236 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Diffstat (limited to 'src/node_util.cc')
-rw-r--r--src/node_util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_util.cc b/src/node_util.cc
index c231983e57..a1387353e3 100644
--- a/src/node_util.cc
+++ b/src/node_util.cc
@@ -29,7 +29,8 @@ using v8::Value;
V(isSet, IsSet) \
V(isSetIterator, IsSetIterator) \
V(isSharedArrayBuffer, IsSharedArrayBuffer) \
- V(isTypedArray, IsTypedArray)
+ V(isTypedArray, IsTypedArray) \
+ V(isUint8Array, IsUint8Array)
#define V(_, ucname) \