aboutsummaryrefslogtreecommitdiffhomepage
path: root/js
diff options
context:
space:
mode:
authorGravatar Joshua Haberman <jhaberman@gmail.com>2017-03-27 12:03:09 -0700
committerGravatar GitHub <noreply@github.com>2017-03-27 12:03:09 -0700
commitc565e25c7d5f2265b103d78b3796bb8822d6c1b5 (patch)
tree5deafe0ddfc42660f0ea0f965cbb7ced2b01f8b7 /js
parent7610f101e89f72357646aad0f9c5e8025de8cb84 (diff)
parent1b0db1cb83f09794632e8c24a1d0d1f0ca5b2365 (diff)
Merge pull request #1662 from haberman/jsconformance
Conformance tests for JavaScript (Node.js). 15 tests are failing.
Diffstat (limited to 'js')
-rw-r--r--js/binary/utils.js4
-rw-r--r--js/message.js2
2 files changed, 5 insertions, 1 deletions
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.<number>} */(data);
return /** @type {!Uint8Array} */(new Uint8Array(data));
diff --git a/js/message.js b/js/message.js
index 4e2517d3..220a5bdb 100644
--- a/js/message.js
+++ b/js/message.js
@@ -202,7 +202,7 @@ goog.define('jspb.Message.MINIMIZE_MEMORY_ALLOCATIONS', COMPILED);
/**
- * Does this browser support Uint8Aray typed arrays?
+ * Does this JavaScript environment support Uint8Aray typed arrays?
* @type {boolean}
* @private
*/