★ wanayoo — archive 1999 https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Error/lineNumberNouvelle recherche | Portail wanayoo
mozilla
Your Search Results

    Error.prototype.lineNumber

    This translation is in progress.

    非標準
    This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

    Summary

    このエラーを起こしたファイルの行番号を表します。

    例

    例: lineNumberを使う

    var e = new Error('Could not parse input');
    throw e;
    console.log(e.lineNumber) // 2
    

    例: error イベントを使う代りの例

    window.addEventListener('error', function(e) {
      console.log(e.lineno); // 5
    });
    var e = new Error('Could not parse input');
    throw e;
    

    これは標準で、Chrome, Firefox などでサポートされています。

    仕様

    すべての仕様で実装されておりません。 非標準。

    ブラウザ実装状況

    機能 Chrome Firefox (Gecko) Internet Explorer Opera Safari
    基本サポート On error object in handled errors (有) 未サポート 未サポート 未サポート
    機能 Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
    基本サポート 未サポート 未サポート (有) 未サポート 未サポート 未サポート

    関連情報

    ドキュメントのタグと貢献者

    Contributors to this page: shide55
    最終更新者: shide55,