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
|
---
title: SyntaxError.prototype
slug: conflicting/Web/JavaScript/Reference/Global_Objects/SyntaxError
tags:
- Error
- JavaScript
- Propriété
- Prototype
- Reference
- SyntaxError
translation_of: Web/JavaScript/Reference/Global_Objects/SyntaxError
translation_of_original: Web/JavaScript/Reference/Global_Objects/SyntaxError/prototype
original_slug: Web/JavaScript/Reference/Objets_globaux/SyntaxError/prototype
---
<div>{{JSRef}}</div>
<p>La propriété <code><strong>SyntaxError.prototype</strong></code> représente le prototype du constructeur {{jsxref("SyntaxError")}}.</p>
<h2 id="Description">Description</h2>
<p>Toutes les instances de {{jsxref("SyntaxError")}} héritent de <code>SyntaxError.prototype</code>. Le prototype peut être utilisé afin d'ajouter des propriétés ou des méthodes à toutes les instances.</p>
<h2 id="Propriétés">Propriétés</h2>
<dl>
<dt><code>SyntaxError.prototype.constructor</code></dt>
<dd>Définit la fonction qui a créé le prototype d'une instance.</dd>
<dt>{{jsxref("Error.prototype.message", "SyntaxError.prototype.message")}}</dt>
<dd>Un message d'erreur. Bien que ECMA-262 définisse que {{jsxref("SyntaxError")}} doit avoir une propriété <code>message</code> en propre, dans <a href="/fr/docs/SpiderMonkey">SpiderMonkey</a>, elle est héritée depuis {{jsxref("Error.prototype.message")}}.</dd>
<dt>{{jsxref("Error.prototype.name", "SyntaxError.prototype.name")}}</dt>
<dd>Un nom d'erreur. Propriété héritée depuis {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.fileName", "SyntaxError.prototype.fileName")}}</dt>
<dd>Le chemin du fichier qui a causé l'erreur. Propriété héritée depuis {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.lineNumber", "SyntaxError.prototype.lineNumber")}}</dt>
<dd>Le numéro de la ligne du fichier qui a causé l'erreur. Propriété héritée depuis {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.columnNumber", "SyntaxError.prototype.columnNumber")}}</dt>
<dd>Le numéro de la colonne dans la ligne qui a causé l'erreur. Propriété héritée depuis {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.stack", "SyntaxError.prototype.stack")}}</dt>
<dd>La pile d'appels (<em>stack trace</em>). Propriété héritée depuis {{jsxref("Error")}}.</dd>
</dl>
<h2 id="Méthodes">Méthodes</h2>
<p>Bien que le prototype de {{jsxref("SyntaxError")}} ne possède pas de méthodes directes, les instances de {{jsxref("SyntaxError")}} héritent de certaines méthodes via la chaîne de prototypes.</p>
<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('ES3')}}</td>
<td>{{Spec2('ES3')}}</td>
<td>Définition initiale.</td>
</tr>
<tr>
<td>{{SpecName('ES5.1', '#sec-15.11.7.6', 'NativeError.prototype')}}</td>
<td>{{Spec2('ES5.1')}}</td>
<td>Définie comme <code><em>NativeError</em>.prototype</code>.</td>
</tr>
<tr>
<td>{{SpecName('ES6', '#sec-nativeerror.prototype', 'NativeError.prototype')}}</td>
<td>{{Spec2('ES6')}}</td>
<td>Définie comme <code><em>NativeError</em>.prototype</code>.</td>
</tr>
<tr>
<td>{{SpecName('ESDraft', '#sec-nativeerror.prototype', 'NativeError.prototype')}}</td>
<td>{{Spec2('ESDraft')}}</td>
<td>Définie comme <code><em>NativeError</em>.prototype</code>.</td>
</tr>
</tbody>
</table>
<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
<p>{{Compat("javascript.builtins.SyntaxError")}}</p>
<h2 id="Voir_aussi">Voir aussi</h2>
<ul>
<li>{{jsxref("Error.prototype")}}</li>
<li>{{jsxref("Function.prototype")}}</li>
</ul>
|