WebAssembly.LinkError()
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
messageOptional- ์ฌ๋์ด ์ฝ์ ์ ์๋ ์ค๋ฅ ์ค๋ช .
fileNameOptional- ์์ธ์ ์์ธ์ด ๋ ์ฝ๋๊ฐ ๋ค์ด์๋ ํ์ผ์ ์ด๋ฆ์ ๋๋ค.
lineNumberOptional- ์์ธ์ ์์ธ์ด ๋ ์ฝ๋์ ํ ๋ฒํธ์ ๋๋ค.
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(en-US)- ์คํ
์ถ์ .
Error๋ฅผ ์์๋ฐ์ต๋๋ค.
Methods
LinkError ์์ฑ์์๋ ์์ฒด ๋ฉ์๋๊ฐ ์์ง๋ง ํ๋กํ ํ์
์ฒด์ธ์ ํตํด ์ผ๋ถ ๋ฉ์๋๋ฅผ ์์ํฉ๋๋ค.
WebAssembly.LinkError.prototype.toSource()(en-US)- ๋์ผํ ์ค๋ฅ๋ก ํ๊ฐ ๋ ์์๋ ์ฝ๋๋ฅผ ๋ฐํํฉ๋๋ค.
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
}Specifications
| Specification | Status | Comment |
|---|---|---|
| WebAssembly JavaScript Interface The definition of 'WebAssembly constructors' in that specification. |
Working Draft | Initial WebAssembly draft definition. |
| ECMAScript (ECMA-262) The definition of 'NativeError' in that specification. |
Living Standard | Definition of standard NativeError types. |
Browser compatibility
BCD tables only load in the browser