Właściwość Error.prototype
reprezentuje prototyp dla konstruktora Error
.
Property attributes of Error.prototype |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Opis
Wszystkie instancje klasy Error
oraz instancje non-generic errors dziedziczą po Error.prototype
. As with all constructor functions, you can use the prototype of the constructor to add properties or methods to all instances created with that constructor.
Właściwości
Właściwości standardowe
Error.prototype.constructor
- Określa funkcję tworzącą instancję prototypu.
Error.prototype.message
- Wiadomość błędu.
Error.prototype.name
- Nazwa błędu.
Rozszerzenia zależne od dostawcy
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.
Microsoft
Error.prototype.description
- Opis błędu. Podobne do
message
. Error.prototype.number
- Numer błędu.
Mozilla
Error.prototype.fileName
- Ścieżka do pliku, w którym wywołany został wyjątek.
Error.prototype.lineNumber
- Numer linijki w pliku, która wywołała wyjątek.
Error.prototype.columnNumber
- Numer znaku w wierszu, w którym został wywołany wyjątek.
Error.prototype.stack
- Stack trace.
Metody
Error.prototype.toSource()
- Zwraca łańcuch znaków zawierający źródło wybranego obiektu
Error
; możesz użyć tej. Overrides theObject.prototype.toSource()
method. Error.prototype.toString()
- Zwraca ciąg znaków reprezentujący wybrany obiekt. Nadpisuje metodę
Object.prototype.toString()
.
Specyfikacja
Specification | Status | Comment |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Początkowa definicja. Zaimplementowana w JavaScript 1.1. |
ECMAScript 5.1 (ECMA-262) The definition of 'Error' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Error' in that specification. |
Standard | |
ECMAScript (ECMA-262) The definition of 'Error' in that specification. |
Living Standard |
Kompatybilność
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.
No compatibility data found. Please contribute data for "javascript.builtins.Error.prototype" (depth: 1) to the MDN compatibility data repository.