docs.rodeo

MDN Web Docs mirror

WebAssembly.CompileError

The WebAssembly.CompileError object indicates an error during WebAssembly decoding or validation.

Constructor

Instance properties

Instance methods

Examples

Creating a new CompileError instance

The following snippet creates a new CompileError instance, and logs its details to the console:

try {
  throw new WebAssembly.CompileError("Hello", "someFile", 10);
} catch (e) {
  console.log(e instanceof CompileError); // true
  console.log(e.message); // "Hello"
  console.log(e.name); // "CompileError"
  console.log(e.fileName); // "someFile"
  console.log(e.lineNumber); // 10
  console.log(e.columnNumber); // 0
  console.log(e.stack); // returns the location where the code was run
}

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN