WebAssembly.RuntimeError()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since â¨2017ë 10ìâ©.
WebAssembly.RuntimeError() ìì±ìë WebAssemblyìì trapì ì§ì í ëë§ë¤ throwëë ì WebAssembly RuntimeError ê°ì²´ë¥¼ ë§ëëë¤.
Syntax
new WebAssembly.RuntimeError(message, fileName, lineNumber);
Parameters
messageOptional-
ì¸ê°ì´ ì½ì ììë ì¤ë¥ ì¤ëª .
fileNameOptional ë¹íì¤-
ìì¸ì ìì¸ì´ ë ì½ëê° ë¤ì´ìë íì¼ì ì´ë¦ì ëë¤.
lineNumberOptional ë¹íì¤-
ìì¸ì ìì¸ì´ ë ì½ëì í ë²í¸ì ëë¤.
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 ì¸ì¤í´ì¤ë¥¼ ìì±í´, ê·¸ ìì¸ë¥¼ ì½ìì 기ë¡í©ëë¤.
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® 2026 Language Specification > # sec-native-error-types-used-in-this-standard > |