Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since октябрь 2017 г..
* Some parts of this feature may have varying levels of support.
Функция WebAssembly.compile() компилирует WebAssembly.Module из двоичного кода WebAssembly. Эта функция полезна, если необходимо компилировать модуль до того, как его можно создать (в противном случае следует использовать функцию WebAssembly.instantiate().
Типизированный массив typed array или ArrayBuffer, содержащий двоичный код модуля .wasm, который вы хотите скомпилировать.
Промис (Promise), который разрешает объект WebAssembly.Module, представляющий скомпилированный модуль.
В следующем примере выполняется компиляция загруженного simple.wasm байт-кода с использованием функции compile(), а затем отправляется его worker-работнику, использующему postMessage().
Примечание: Вероятно, вы захотите использовать WebAssembly.compileStreaming() в большинстве случаев, поскольку он более эффективен, чем compile().
| WebAssembly JavaScript Interface # dom-webassembly-compile |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 24 мар. 2025 г. by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.