aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAdam Cozzette <acozzette@google.com>2018-03-13 16:54:31 -0700
committerAdam Cozzette <acozzette@google.com>2018-03-13 16:54:31 -0700
commitafe96b6d4235b9d9fbfce2465f5c6d82c2611f48 (patch)
treed509cb3cc3f2b25b58a75563758d2092103ca19a /js
parent0400cca3236de1ca303af38bf81eab332d042b7c (diff)
parent89b5333ad0f10058d5af62701c5ebea0db376c5b (diff)
downloadprotobuf-afe96b6d4235b9d9fbfce2465f5c6d82c2611f48.tar.gz
protobuf-afe96b6d4235b9d9fbfce2465f5c6d82c2611f48.tar.bz2
protobuf-afe96b6d4235b9d9fbfce2465f5c6d82c2611f48.zip
Merge branch 'master' into down-integrate
Diffstat (limited to 'js')
-rw-r--r--js/binary/utils.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/binary/utils.js b/js/binary/utils.js
index 87570ff8..55a9ccd4 100644
--- a/js/binary/utils.js
+++ b/js/binary/utils.js
@@ -971,6 +971,10 @@ jspb.utils.byteSourceToUint8Array = function(data) {
return /** @type {!Uint8Array} */(new Uint8Array(data));
}
+ if (data.constructor === Buffer) {
+ return /** @type {!Uint8Array} */(new Uint8Array(data));
+ }
+
if (data.constructor === Array) {
data = /** @type {!Array<number>} */(data);
return /** @type {!Uint8Array} */(new Uint8Array(data));