aboutsummaryrefslogtreecommitdiff
path: root/files/fr/conflicting/web/javascript/reference/global_objects/error/index.html
blob: 38dac1de3d5e14c569e95277797aea9c41461596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
title: Error.prototype
slug: conflicting/Web/JavaScript/Reference/Global_Objects/Error
tags:
  - Error
  - JavaScript
  - Propriété
  - Reference
translation_of: Web/JavaScript/Reference/Global_Objects/Error
translation_of_original: Web/JavaScript/Reference/Global_Objects/Error/prototype
original_slug: Web/JavaScript/Reference/Objets_globaux/Error/prototype
---
<div>{{JSRef}}</div>

<p>La propriété <code><strong>Error.prototype</strong></code> représente le prototype du constructeur {{jsxref("Error")}}.</p>

<div>{{js_property_attributes(0,0,0)}}</div>

<h2 id="Description">Description</h2>

<p>Toutes les instances d'{{jsxref("Error")}} et les instances des {{jsxref("Error", "erreurs non-génériques", "#Types_d'erreur_personnalis.C3.A9s", 1)}} héritent de {{jsxref("Error.prototype")}}. Comme pour tous les constructeurs, on pouvez utiliser le prototype du constructeur pour ajouter des propriétés ou méthodes à l'ensemble des instances créées avec ce constructeur.</p>

<h2 id="Propriétés">Propriétés</h2>

<h3 id="Propriétés_standard">Propriétés standard</h3>

<dl>
 <dt>Error.prototype.constructor</dt>
 <dd>La fonction créeant une instance du prototype.</dd>
 <dt>{{jsxref("Error.prototype.message")}}</dt>
 <dd>Le message de l'erreur.</dd>
 <dt>{{jsxref("Error.prototype.name")}}</dt>
 <dd>Le nom de l'erreur.</dd>
</dl>

<h3 id="Extensions_spécifiques_à_une_implémentation">Extensions spécifiques à une implémentation</h3>

<div>{{Non-standard_header}}</div>

<h4 id="Microsoft">Microsoft</h4>

<dl>
 <dt>{{jsxref("Error.prototype.description")}}</dt>
 <dd>Description de l'erreur. Similaire à {{jsxref("Error.message", "message")}}.</dd>
 <dt>{{jsxref("Error.prototype.number")}}</dt>
 <dd>Numéro de l'erreur.</dd>
</dl>

<h4 id="Mozilla">Mozilla</h4>

<dl>
 <dt>{{jsxref("Error.prototype.fileName")}}</dt>
 <dd>Chemin vers le fichier qui a déclenché l'erreur.</dd>
 <dt>{{jsxref("Error.prototype.lineNumber")}}</dt>
 <dd>Numéro de la ligne qui a déclenché l'erreur dans le fichier.</dd>
 <dt>{{jsxref("Error.prototype.columnNumber")}}</dt>
 <dd>Numéro de la colonne qui a déclenché l'erreur dans le fichier.</dd>
 <dt>{{jsxref("Error.prototype.stack")}}</dt>
 <dd>Pile d'appels.</dd>
</dl>

<h2 id="Méthodes">Méthodes</h2>

<dl>
 <dt>{{jsxref("Error.prototype.toSource()")}} {{Non-standard_inline}}</dt>
 <dd>Renvoie une chaine de caractères contenant le code source de l'objet <code>Error</code> ; cette valeur peut être utilisée pour créer un nouvel objet. Elle remplace la méthode {{jsxref("Object.prototype.toSource()")}}.</dd>
 <dt>{{jsxref("Error.prototype.toString()")}}</dt>
 <dd>Renvoie une chaine de caractères représentant l'objet. Elle remplace la méthode {{jsxref("Object.prototype.toString()")}}.</dd>
</dl>

<h2 id="Spécifications">Spécifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Spécification</th>
   <th scope="col">Statut</th>
   <th scope="col">Commentaires</th>
  </tr>
  <tr>
   <td>{{SpecName('ES1')}}</td>
   <td>{{Spec2('ES1')}}</td>
   <td>Définition initiale. Implémentée avec JavaScript 1.1.</td>
  </tr>
  <tr>
   <td>{{SpecName('ES5.1', '#sec-15.11.3.1', 'Error')}}</td>
   <td>{{Spec2('ES5.1')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('ES6', '#sec-error.prototype', 'Error')}}</td>
   <td>{{Spec2('ES6')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('ESDraft', '#sec-error.prototype', 'Error')}}</td>
   <td>{{Spec2('ESDraft')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>

<p>{{Compat("javascript.builtins.Error.prototype")}}</p>

<h2 id="Voir_aussi">Voir aussi</h2>

<ul>
 <li>{{jsxref("Error")}}</li>
 <li>{{jsxref("Object.prototype")}}</li>
</ul>