Better pretty printing for typed arrays

This commit is contained in:
ksvitkovsky
2017-08-01 23:58:33 +04:00
committed by Gregg Van Hove
parent acc8c23bf4
commit 4fc177d5ae
6 changed files with 61 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
(function(env) {
function hasFunctioningTypedArrays() {
if (typeof Uint32Array === 'undefined') { return false; }
try {
var a = new Uint32Array([1, 2, 3]);
if (a.length !== 3) { return false; }
return true;
} catch(e) {
return false;
}
}
env.requireFunctioningTypedArrays = function() {
if (!hasFunctioningTypedArrays()) {
env.pending("Browser has incomplete or missing support for typed arrays");
}
};
})(jasmine.getEnv());