[Pkg-javascript-commits] [node-stream-browserify] 20/44: use typedarray in the tests for old browsers
Bastien Roucariès
rouca at moszumanska.debian.org
Sun Aug 13 14:18:42 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-stream-browserify.
commit 0f3a01235844ca1c6eb5fb5014c452fda24345da
Author: James Halliday <mail at substack.net>
Date: Fri Dec 20 00:30:18 2013 -0800
use typedarray in the tests for old browsers
---
package.json | 3 ++-
test/array_buffer.js | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 1477838..7ae1a68 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,8 @@
"process": "~0.5.1"
},
"devDependencies": {
- "tape": "~2.3.2"
+ "tape": "~2.3.2",
+ "typedarray": "0.0.5"
},
"scripts": {
"test": "tape test/*.js"
diff --git a/test/array_buffer.js b/test/array_buffer.js
index 68efa01..fc9bca8 100644
--- a/test/array_buffer.js
+++ b/test/array_buffer.js
@@ -1,5 +1,9 @@
var path = require('path');
var test = require('tape');
+var xUint8Array = typeof Uint8Array === 'undefined'
+ ? require('typedarray').Uint8Array
+ : Uint8Array
+;
var Writable = require('../writable.js');
var inherits = require('inherits');
@@ -18,7 +22,7 @@ TestWritable.prototype._write = function(chunk, encoding, cb) {
cb();
};
-var typedArray = new Uint8Array(1);
+var typedArray = new xUint8Array(1);
typedArray[0] = 88;
test('.writable writing ArrayBuffer', function(t) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-browserify.git
More information about the Pkg-javascript-commits
mailing list