From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../webassembly/compileerror/index.html | 110 +++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/webassembly/compileerror/index.html (limited to 'files/ja/web/javascript/reference/global_objects/webassembly/compileerror') diff --git a/files/ja/web/javascript/reference/global_objects/webassembly/compileerror/index.html b/files/ja/web/javascript/reference/global_objects/webassembly/compileerror/index.html new file mode 100644 index 0000000000..785e7f604e --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/webassembly/compileerror/index.html @@ -0,0 +1,110 @@ +--- +title: WebAssembly.CompileError() +slug: Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError +translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError +--- +
{{JSRef}} {{SeeCompatTable}}
+ +

WebAssembly.CompileError() コンストラクタは WebAssembly CompileError オブジェクトを生成します。WebAssembly のデコードやバリデーション中にエラーが発生したことを示します。

+ +

構文

+ +
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.constructor
+
インスタンスのプロトタイプを生成した関数を示します。
+
{{jsxref("Error.prototype.message", "WebAssembly.CompileError.prototype.message")}}
+
エラーメッセージ。ECMA-262では {{jsxref("URIError")}} は自身の message プロパティを提供する必要がありますが、SpiderMonkey では {{jsxref("Error.prototype.message")}} を継承します。
+
{{jsxref("Error.prototype.name", "WebAssembly.CompileError.prototype.name")}}
+
エラー名。{{jsxref("Error")}} から継承されます。
+
{{jsxref("Error.prototype.fileName", "WebAssembly.CompileError.prototype.fileName")}}
+
このエラーを発生させたファイルのパス。 {{jsxref("Error")}} から継承されます。
+
{{jsxref("Error.prototype.lineNumber", "WebAssembly.CompileError.prototype.lineNumber")}}
+
このエラーを発生させたファイルの行番号。{{jsxref("Error")}} から継承されます。
+
{{jsxref("Error.prototype.columnNumber", "WebAssembly.CompileError.prototype.columnNumber")}}
+
このエラーが発生した行の列番号。{{jsxref("Error")}} から継承されます。
+
{{jsxref("Error.prototype.stack", "WebAssembly.CompileError.prototype.stack")}}
+
スタックトレース。{{jsxref("Error")}} から継承されます。
+
+ +

メソッド

+ +

CompileError コンストラクタは自身のメソッドを持ちませんが、プロトタイプチェーンを通していくつかのメソッドを継承します。

+ +
+
{{jsxref("Error.prototype.toSource", "WebAssembly.CompileError.prototype.toSource()")}}
+
同じエラーを評価できるコードを返します。{{jsxref("Error")}} から継承されます。
+
{{jsxref("Error.prototype.toString", "WebAssembly.CompileError.prototype.toString()")}}
+
指定された Error オブジェクトを表す文字列を返します。{{jsxref("Error")}} から継承されます。
+
+ +

+ +

以下のスニペットで 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);                   // コードが実行された場所を返す
+}
+ +

仕様

+ + + + + + + + + + + + + + + + + + + + + +
仕様策定状況コメント
{{SpecName('WebAssembly JS', '#constructor-properties-of-the-webassembly-object', 'WebAssembly constructors')}}{{Spec2('WebAssembly JS')}}WebAssembly の初回ドラフト定義。
{{SpecName('ESDraft', '#sec-native-error-types-used-in-this-standard', 'NativeError')}}{{Spec2('ESDraft')}}標準の NativeError 型の定義。
+ +

ブラウザ実装状況

+ +
{{Compat("javascript.builtins.WebAssembly.CompileError")}}
+ +

関連情報

+ + + +
+
-- cgit v1.2.3-54-g00ecf