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

WebAssembly.compile() - | 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 10.

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

**WebAssembly.compile()** WebAssembly WebAssembly.Module . . WebAssembly.instantiate () .

In this article

Syntax

js
WebAssembly.compile(bufferSource);

Parameters

bufferSource

.wasm typed array ArrayBuffer.

Return value

Promise WebAssembly.Module .

Exceptions

Examples

compile() simple.wasm postMessage() worker .

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));

Specification
WebAssembly JavaScript Interface
# dom-webassembly-compile

See also


Web Proxy Viewer  |  New URL  |  Original Page