MCPcopy Create free account
hub / github.com/microsoft/SandDance / typedArraySupport

Function typedArraySupport

docs/tests/v2/es6/js/sanddance.js:78422–78432  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78420exports.kMaxLength = kMaxLength()
78421
78422function typedArraySupport () {
78423 try {
78424 var arr = new Uint8Array(1)
78425 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
78426 return arr.foo() === 42 && // typed array instances can be augmented
78427 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
78428 arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
78429 } catch (e) {
78430 return false
78431 }
78432}
78433
78434function kMaxLength () {
78435 return Buffer.TYPED_ARRAY_SUPPORT

Callers 1

sanddance.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected