WebAssembly.LinkError()
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์โฉ.
The WebAssembly.LinkError()
constructor creates a new WebAssembly LinkError
object, which indicates an error during module instantiation (besides traps from the start function).
WebAssembly.LinkError()
์์ฑ์๋ ์ WebAssembly LinkError
๊ฐ์ฒด๋ฅผ ๋ง๋ญ๋๋ค. ์ด ๊ฐ์ฒด๋ ๋ชจ๋ ์ธ์คํด์คํ ์ค์ ์ค๋ฅ๋ฅผ ๋ํ๋
๋๋ค (์์ ํจ์์ traps์ ํจ๊ป).
Syntax
new WebAssembly.LinkError(message, fileName, lineNumber);
Parameters
message
Optional-
์ฌ๋์ด ์ฝ์ ์ ์๋ ์ค๋ฅ ์ค๋ช .
fileName
Optional ๋นํ์ค-
์์ธ์ ์์ธ์ด ๋ ์ฝ๋๊ฐ ๋ค์ด์๋ ํ์ผ์ ์ด๋ฆ์ ๋๋ค.
lineNumber
Optional ๋นํ์ค-
์์ธ์ ์์ธ์ด ๋ ์ฝ๋์ ํ ๋ฒํธ์ ๋๋ค.
Properties
LinkError
์์ฑ์์๋ ๊ณ ์ ํ ๊ณ ์ ์์ฑ์ด ์์ง๋ง ํ๋กํ ํ์
์ฒด์ธ์ ํตํด ์ผ๋ถ ์์ฑ์ ์์ํฉ๋๋ค.
WebAssembly.LinkError.prototype.constructor
-
์ธ์คํด์ค์ ํ๋กํ ํ์ ์ ์์ฑํ ํจ์๋ฅผ ์ง์ ํฉ๋๋ค.
WebAssembly.LinkError.prototype.message
-
์๋ฌ ๋ฉ์์ง. ECMA-262๋
URIError
๊ฐ SpiderMonkey์์ ์์ฒดmessage
์์ฑ์ ์ ๊ณตํ๋๋ก ์ง์ ํ์ง๋งError.prototype.message
๋ฅผ ์์๋ฐ์ต๋๋ค. WebAssembly.LinkError.prototype.name
-
์๋ฌ ์ด๋ฆ.
Error
๋ฅผ ์์๋ฐ์ต๋๋ค. WebAssembly.LinkError.prototype.fileName
-
ํด๋น ์๋ฌ๊ฐ ๋ฐ์ํ ํ์ผ์ ๊ฒฝ๋ก.
Error
๋ฅผ ์์๋ฐ์ต๋๋ค. WebAssembly.LinkError.prototype.lineNumber
-
์๋ฌ๊ฐ ๋ฐ์ํ ํ์ผ์ ํ ๋ฒํธ.
Error
๋ฅผ ์์๋ฐ์ต๋๋ค. WebAssembly.LinkError.prototype.columnNumber
-
์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ ํ์ ์ด ๋ฒํธ์ ๋๋ค..
Error
๋ฅผ ์์๋ฐ์ต๋๋ค. WebAssembly.LinkError.prototype.stack
-
์คํ ์ถ์ .
Error
๋ฅผ ์์๋ฐ์ต๋๋ค.
Methods
LinkError
์์ฑ์์๋ ์์ฒด ๋ฉ์๋๊ฐ ์์ง๋ง ํ๋กํ ํ์
์ฒด์ธ์ ํตํด ์ผ๋ถ ๋ฉ์๋๋ฅผ ์์ํฉ๋๋ค.
WebAssembly.LinkError.prototype.toSource()
-
๋์ผํ ์ค๋ฅ๋ก ํ๊ฐ ๋ ์์๋ ์ฝ๋๋ฅผ ๋ฐํํฉ๋๋ค.
Error
๋ฅผ ์์๋ฐ์ต๋๋ค. WebAssembly.LinkError.prototype.toString()
-
์ง์ ๋ Error ๊ฐ์ฒด๋ฅผ ๋ํ๋ด๋ ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค.
Error
๋ฅผ ์์๋ฐ์ต๋๋ค.
Examples
๋ค์ snippet์ ์ LinkError
์ธ์คํด์ค๋ฅผ ๋ง๋ค๊ณ ์ฝ์์ ์ธ๋ถ ์ ๋ณด๋ฅผ ๊ธฐ๋กํฉ๋๋ค.
try {
throw new WebAssembly.LinkError("Hello", "someFile", 10);
} catch (e) {
console.log(e instanceof LinkError); // true
console.log(e.message); // "Hello"
console.log(e.name); // "LinkError"
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-linkerror |
ECMAScriptยฎ 2026 Language Specification # sec-native-error-types-used-in-this-standard |
๋ธ๋ผ์ฐ์ ํธํ์ฑ
Loadingโฆ