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

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

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.validate() wasm (true) (false) WebAssembly typed array .

In this article

Syntax

WebAssembly.validate(bufferSource);

Parameters

bufferSource

WebAssembly typed array ArrayBuffer.

Return value

bufferSource wasm (true) (false) .

Exceptions

bufferSource typed array ArrayBuffer TypeError .

Examples

(validate.html source code see it live) .wasm . validate() .

js
fetch("simple.wasm")
  .then((response) => response.arrayBuffer())
  .then(function (bytes) {
    var valid = WebAssembly.validate(bytes);
    console.log(
      "The given bytes are " + (valid ? "" : "not ") + "a valid wasm module",
    );
  });

Specification
WebAssembly JavaScript Interface
# dom-webassembly-validate

See also


Web Proxy Viewer  |  New URL  |  Original Page