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

Function typedArraySupport

docs/app/js/sanddance-app.js:112884–112899  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112882 */ Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();
112883if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
112884function typedArraySupport() {
112885 // Can typed array instances can be augmented?
112886 try {
112887 var arr = new Uint8Array(1);
112888 var proto = {
112889 foo: function() {
112890 return 42;
112891 }
112892 };
112893 Object.setPrototypeOf(proto, Uint8Array.prototype);
112894 Object.setPrototypeOf(arr, proto);
112895 return arr.foo() === 42;
112896 } catch (e) {
112897 return false;
112898 }
112899}
112900Object.defineProperty(Buffer.prototype, "parent", {
112901 enumerable: true,
112902 get: function() {

Callers 1

sanddance-app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected