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
|
---
title: InternalError
slug: Web/JavaScript/Reference/Global_Objects/InternalError
translation_of: Web/JavaScript/Reference/Global_Objects/InternalError
---
<div>{{JSRef}} {{non-standard_header}}</div>
<p>O <strong>objeto</strong> <strong><code>InternalError</code> </strong>indica que um erro ocorreu internamente na engine do JavaScript.</p>
<p>Isso ocorre quando algo é muito grande, por exemplo:</p>
<ul>
<li>"too many switch cases",</li>
<li>"too many parentheses in regular expression",</li>
<li>"array initializer too large",</li>
<li>"too much recursion".</li>
</ul>
<h2 id="Construtor">Construtor</h2>
<dl>
<dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError/InternalError"><code>InternalError()</code></a></dt>
<dd>Cria um um novo objeto <code>InternalError</code>.</dd>
</dl>
<h2 id="Instance_properties">Instance properties</h2>
<dl>
<dt>{{jsxref("Error.prototype.message", "InternalError.prototype.message")}}</dt>
<dd>Error message. Inherited from {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.name", "InternalError.prototype.name")}}</dt>
<dd>Error name. Inherited from {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.fileName", "InternalError.prototype.fileName")}}</dt>
<dd>Path to file that raised this error. Inherited from {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.lineNumber", "InternalError.prototype.lineNumber")}}</dt>
<dd>Line number in file that raised this error. Inherited from {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.columnNumber", "InternalError.prototype.columnNumber")}}</dt>
<dd>Column number in line that raised this error. Inherited from {{jsxref("Error")}}.</dd>
<dt>{{jsxref("Error.prototype.stack", "InternalError.prototype.stack")}}</dt>
<dd>Stack trace. Inherited from {{jsxref("Error")}}.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<h3 id="Too_much_recursion">Too much recursion</h3>
<p>This recursive function runs 10 times, as per the exit condition.</p>
<pre class="brush: js notranslate">function loop(x) {
if (x >= 10) // "x >= 10" is the exit condition
return;
// do stuff
loop(x + 1); // the recursive call
}
loop(0);</pre>
<p>Setting this condition to an extremely high value, won't work:</p>
<pre class="brush: js example-bad notranslate">function loop(x) {
if (x >= 1000000000000)
return;
// do stuff
loop(x + 1);
}
loop(0);
// InternalError: too much recursion</pre>
<p>For more information, see <a href="/en-US/docs/Web/JavaScript/Reference/Errors/Too_much_recursion">InternalError: too much recursion.</a></p>
<h2 id="Specifications">Specifications</h2>
<p><span class="pl-s">Not part of any standard.</span></p>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<div>
<div>
<p>{{Compat("javascript.builtins.InternalError")}}</p>
</div>
</div>
<h2 id="See_also">See also</h2>
<ul>
<li>{{jsxref("Error")}}</li>
<li>
<p><a href="/en-US/docs/Web/JavaScript/Reference/Errors/Too_much_recursion">InternalError: too much recursion</a></p>
</li>
</ul>
|