[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/WebAssembly/Reference/JavaScript_interface/compile_static [Back]  [Original]

WebAssembly.compile() - WebAssembly | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

WebAssembly.compile()

Baseline Widely available *

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2017 ..

* Some parts of this feature may have varying levels of support.

WebAssembly.compile() WebAssembly.Module WebAssembly. , , ( WebAssembly.instantiate().

In this article

Promise<WebAssembly.Module> WebAssembly.compile(bufferSource);

bufferSource

typed array ArrayBuffer, .wasm, .

(Promise), WebAssembly.Module, .

simple.wasm - compile(), worker-, postMessage().

js
var worker = new Worker("wasm_worker.js");

fetch("simple.wasm")
  .then((response) => response.arrayBuffer())
  .then((bytes) => WebAssembly.compile(bytes))
  .then((mod) => worker.postMessage(mod));

: , WebAssembly.compileStreaming() , , compile().

Specification
WebAssembly JavaScript Interface
# dom-webassembly-compile


Web Proxy Viewer  |  New URL  |  Original Page