MCPcopy Create free account
hub / github.com/GoogleChrome/samples / instantiateArrayBuffer

Function instantiateArrayBuffer

mkbitmap/mkbitmap.js:803–817  ·  view source on GitHub ↗
(binaryFile, imports, receiver)

Source from the content-addressed store, hash-verified

801}
802
803function instantiateArrayBuffer(binaryFile, imports, receiver) {
804 return getBinaryPromise(binaryFile).then(function(binary) {
805 return WebAssembly.instantiate(binary, imports);
806 }).then(function (instance) {
807 return instance;
808 }).then(receiver, function(reason) {
809 err('failed to asynchronously prepare wasm: ' + reason);
810
811 // Warn on some common problems.
812 if (isFileURI(wasmBinaryFile)) {
813 err('warning: Loading from a file URI (' + wasmBinaryFile + ') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing');
814 }
815 abort(reason);
816 });
817}
818
819function instantiateAsync(binary, binaryFile, imports, callback) {
820 if (!binary &&

Callers 1

instantiateAsyncFunction · 0.70

Calls 3

getBinaryPromiseFunction · 0.70
isFileURIFunction · 0.70
abortFunction · 0.70

Tested by

no test coverage detected