-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
81 lines (59 loc) · 2.63 KB
/
index.md
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
---
title: InternalError
slug: Web/JavaScript/Reference/Global_Objects/InternalError
---
{{JSRef}} {{non-standard_header}}
**`InternalError` オブジェクト** は、 JavaScript エンジンで内部的に発生したエラーを示します。
これは、以下のように何かが大きすぎる時に発生します。
- "switch case が多すぎる"、
- "正規表現内の括弧が多すぎる"、
- "配列の初期化子が大きすぎる"、
- "再帰が深すぎる"。
## コンストラクター
- {{jsxref("InternalError/InternalError", "InternalError()")}}
- : 新しい `InternalError` オブジェクトを生成します。
## インスタンスプロパティ
- {{jsxref("Error.prototype.message", "InternalError.prototype.message")}}
- : エラーメッセージです。 {{jsxref("Error.prototype.message")}} から継承しています。
- {{jsxref("Error.prototype.name", "InternalError.prototype.name")}}
- : エラー名です。 {{jsxref("Error")}} から継承しています。
- {{jsxref("Error.prototype.fileName", "InternalError.prototype.fileName")}}
- : このエラーが発生したファイルのパスです。 {{jsxref("Error")}} から継承しています。
- {{jsxref("Error.prototype.lineNumber", "InternalError.prototype.lineNumber")}}
- : このエラーが発生したファイル内の行番号です。 {{jsxref("Error")}} から継承しています。
- {{jsxref("Error.prototype.columnNumber", "InternalError.prototype.columnNumber")}}
- : このエラーが発生した行内の桁番号です。 {{jsxref("Error")}} から継承しています。
- {{jsxref("Error.prototype.stack", "InternalError.prototype.stack")}}
- : スタックトレースです。 {{jsxref("Error")}} から継承しています。
## 例
### 深すぎる再帰
この再帰関数は終了条件によって、10 回実行されます。
```js
function loop(x) {
if (x >= 10) {
// "x >= 10" is the exit condition
return;
}
// do stuff
loop(x + 1); // the recursive call
}
loop(0);
```
この条件を非常に大きな値に設定した場合、動作しなくなります。
```js example-bad
function loop(x) {
if (x >= 1000000000000) return;
// do stuff
loop(x + 1);
}
loop(0);
// InternalError: too much recursion
```
詳しくは、 [InternalError: too much recursion.](/ja/docs/Web/JavaScript/Reference/Errors/Too_much_recursion) を参照してください。
## 仕様書
仕様の一部ではありません。
## ブラウザーの互換性
{{Compat}}
## 関連情報
- {{jsxref("Error")}}
- [InternalError: too much recursion](/ja/docs/Web/JavaScript/Reference/Errors/Too_much_recursion)