Niestandardowy
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.
Właściwość lineNumber
zawiera numer linii w pliku, gdzie pojawił się błąd.
Przykłady
Użycie lineNumber
var e = new Error('Błąd przy parsowaniu wejścia');
throw e;
console.log(e.lineNumber) // 2
Alternatywny przykład użycia zdarzenia error
window.addEventListener('error', function(e) {
console.log(e.lineNumber); // 5
});
var e = new Error('Błąd przy parsowaniu wejścia');
throw e;
Własność lineNumber
jest niestandardowa i nie posiada szerokiego wsparcia – zobacz tabelę opisującą wsparcie przeglądarek dla tej własności.
Specyfikacje
Nie jest częścią żadnego standardu.
Wsparcie przeglądarek
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.