Movatterモバイル変換


[0]ホーム

URL:


  1. WebAssembly
  2. Reference
  3. WebAssembly
  4. WebAssembly.CompileError

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。

View in EnglishAlways switch to English

WebAssembly.CompileError

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月⁩.

WebAssembly.CompileError オブジェクトは、 WebAssembly のデコードや検証の間のエラーを示します。

コンストラクター

WebAssembly.CompileError()

新しいWebAssembly.CompileError オブジェクトを生成します。

インスタンスプロパティ

WebAssembly.CompileError.prototype.message

エラーメッセージ。Error から継承しています。

WebAssembly.CompileError.prototype.name

エラー名。Error から継承しています。

WebAssembly.CompileError.prototype.fileName

このエラーを発生させたファイルのパス。Error から継承しています。

WebAssembly.CompileError.prototype.lineNumber

このエラーを発生させたファイルの行番号。Error から継承しています。

WebAssembly.CompileError.prototype.columnNumber

このエラーが発生した行の列番号。Error から継承しています。

WebAssembly.CompileError.prototype.stack

スタックトレース。Error から継承しています。

インスタンスメソッド

WebAssembly.CompileError.prototype.toSource()

同じエラーを評価できるコードを返します。Error から継承しています。

WebAssembly.CompileError.prototype.toString()

指定されたError オブジェクトを表す文字列を返します。Error から継承しています。

新しい CompileError のインスタンスの作成

以下のスニペットでは、新しいCompileError インスタンスを生成して、詳細をコンソールに記録します。

js
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); // コードが実行されていた位置を返す}

仕様書

Specification
WebAssembly JavaScript Interface
# exceptiondef-compileerror
ECMAScript® 2026 Language Specification
# sec-native-error-types-used-in-this-standard

ブラウザーの互換性

関連情報

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp