GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — WebAssembly.CompileError - WebAssembly | MDN

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

View in English Always switch to English

WebAssembly.CompileError

Baseline
広く利用可能

この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。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); // コードが実行されていた位置を返す
}

仕様書

仕様書
WebAssembly JavaScript Interface
# exceptiondef-compileerror
ECMAScript® 2027 Language Specification
# sec-native-error-types-used-in-this-standard

ブラウザーの互換性

関連情報

  • WebAssembly 概要ページ
  • WebAssembly の概念
  • WebAssembly JavaScript API の使用

MDN の改良に協力

協力方法を知る

このページは 2026年5月23日 に MDN の貢献者によって最終更新されました。

GitHub でこのページを表示 • このコンテンツに関する問題を報告
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.