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

message Optional
μ‚¬λžŒμ΄ 읽을 수 μžˆλŠ” 였λ₯˜ μ„€λͺ….
fileName Optional This API has not been standardized.
μ˜ˆμ™Έμ˜ 원인이 된 μ½”λ“œκ°€ λ“€μ–΄μžˆλŠ” 파일의 μ΄λ¦„μž…λ‹ˆλ‹€.
lineNumber Optional This API has not been standardized.
μ˜ˆμ™Έμ˜ 원인이 된 μ½”λ“œμ˜ ν–‰ λ²ˆν˜Έμž…λ‹ˆλ‹€.

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
}

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

See also