Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
* Some parts of this feature may have varying levels of support.
SyntaxError オブジェクトは、構文的に不正なコードを解釈しようとした場合のエラーを表します。これは、 JavaScript エンジンが、コードを解析中に言語の構文に従わないトークンまたはトークンの順序に遭遇した場合に発生します。
新しい SyntaxError オブジェクトを生成します。
エラーメッセージです。 ECMA-262 において SyntaxError は自身の message プロパティを提供するべきとされていますが、 SpiderMonkey では Error.prototype.message を継承しています。
SyntaxError.prototype.nameエラー名です。 Error から継承しています。
SyntaxError.prototype.fileNameこのエラーが発生したファイルのパスです。 Error から継承しています。
SyntaxError.prototype.lineNumberこのエラーが発生したファイル内の行番号です。 Error から継承しています。
SyntaxError.prototype.columnNumberこのエラーが発生した行内の桁数です。 Error から継承しています。
SyntaxError.prototype.stackスタックトレースです。 Error から継承しています。
| ECMAScript® 2027 Language Specification # sec-native-error-types-used-in-this-standard-syntaxerror |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023年11月8日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.