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

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

Baseline Widely available

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

WebAssembly.RuntimeError() WebAssembly trap throw WebAssembly RuntimeError .

In this article

Syntax

js
new WebAssembly.RuntimeError(message, fileName, lineNumber);

Parameters

message Optional

.

fileName Optional

.

lineNumber Optional

.

Properties

RuntimeError .

WebAssembly.RuntimeError.prototype.constructor

.

WebAssembly.RuntimeError.prototype.message

. ECMA-262 URIError SpiderMonkey message Error.prototype.message .

WebAssembly.RuntimeError.prototype.name

. Error .

WebAssembly.RuntimeError.prototype.fileName

. Error .

WebAssembly.RuntimeError.prototype.lineNumber

. Error .

WebAssembly.RuntimeError.prototype.columnNumber

. Error .

WebAssembly.RuntimeError.prototype.stack

. Error .

Methods

RuntimeError .

WebAssembly.RuntimeError.prototype.toSource()

. Error .

WebAssembly.RuntimeError.prototype.toString()

Error . Error .

Examples

, RuntimeError , .

js
try {
  throw new WebAssembly.RuntimeError("Hello", "someFile", 10);
} catch (e) {
  console.log(e instanceof RuntimeError); // true
  console.log(e.message); // "Hello"
  console.log(e.name); // "RuntimeError"
  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
}

Specification
WebAssembly JavaScript Interface
# exceptiondef-runtimeerror
ECMAScript 2027 LanguageSpecification
# sec-native-error-types-used-in-this-standard

See also


Web Proxy Viewer  |  New URL  |  Original Page