From f873d3213c6be8e041cf4d9de201834110247750 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 8 Jun 2016 12:38:15 -0700 Subject: Added JavaScript conformance tests. All tests pass! --- js/binary/utils.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/binary') diff --git a/js/binary/utils.js b/js/binary/utils.js index bbf99cdf..3ecd08e9 100644 --- a/js/binary/utils.js +++ b/js/binary/utils.js @@ -970,6 +970,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.} */(data); return /** @type {!Uint8Array} */(new Uint8Array(data)); -- cgit v1.2.3