--- title: WebAssembly.CompileError() slug: Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError ---
WebAssembly.CompileError()생성자는 WebAssembly 디코딩 또는 유효성 검사 중에 발생한 오류를 나타내는 WebAssembly CompileError 객체를 새로 만듭니다.
new WebAssembly.CompileError(message, fileName, lineNumber)
message {{optional_inline}}fileName {{optional_inline}}{{non-standard_inline}}lineNumber {{optional_inline}}{{non-standard_inline}}CompileError 생성자에는 고유 한 고유 속성이 없지만 프로토 타입 체인을 통해 일부 속성을 상속합니다.
WebAssembly.CompileError.prototype.constructormessage 속성을 제공하도록 지정했지만 {{jsxref ( "Error.prototype.message")}}를 상속받습니다.CompileError 생성자에는 자체 메서드가 없지만 프로토 타입 체인을 통해 일부 메서드를 상속합니다.
다음 스 니펫은 새 CompileError 인스턴스를 만들고 콘솔에 세부 정보를 기록합니다.
try {
throw new WebAssembly.CompileError('Hello', 'someFile', 10);
} catch (e) {
console.log(e instanceof CompileError); // true
console.log(e.message); // "Hello"
console.log(e.name); // "CompileError"
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 | Status | Comment |
|---|---|---|
| {{SpecName('WebAssembly JS', '#constructor-properties-of-the-webassembly-object', 'WebAssembly constructors')}} | {{Spec2('WebAssembly JS')}} | Initial WebAssembly draft definition. |
| {{SpecName('ESDraft', '#sec-native-error-types-used-in-this-standard', 'NativeError')}} | {{Spec2('ESDraft')}} | Definition of standard NativeError types. |
{{Compat("javascript.builtins.WebAssembly.CompileError")}}