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: EvalError
slug: Web/JavaScript/Reference/Global_Objects/EvalError
tags:
- Error
- EvalError
- JavaScript
- Reference
translation_of: Web/JavaScript/Reference/Global_Objects/EvalError
---
<div>{{JSRef}}</div>
<p><strong><code>EvalError</code></strong> 객체는 전역 {{jsxref("Global_Objects/eval", "eval()")}} 함수에 관한 오류를 나타냅니다. 이 예외는 JavaScript에 의해 더 이상 발생하지 않지만 <code>EvalError</code> 객체는 하위 호환성을 위해 남아있습니다.</p>
<h2 id="구문">구문</h2>
<pre class="syntaxbox"><code>new EvalError([<var>message</var>[, <var>fileName</var>[, <var>lineNumber</var>]]])</code></pre>
<h3 id="매개변수">매개변수</h3>
<dl>
<dt><code>message</code> {{optional_inline}}</dt>
<dd>인간이 읽을 수 있는 오류 설명.</dd>
<dt><code>fileName</code> {{optional_inline}} {{non-standard_inline}}</dt>
<dd>예외의 원인이 된 코드를 포함하는 파일의 이름.</dd>
<dt><code>lineNumber</code> {{optional_inline}} {{non-standard_inline}}</dt>
<dd>예외를 발생시킨 코드의 행 번호.</dd>
</dl>
<h2 id="속성">속성</h2>
<dl>
<dt>{{jsxref("EvalError.prototype")}}</dt>
<dd>EvalError 객체에 속성을 추가할 수 있습니다.</dd>
</dl>
<h2 id="메서드">메서드</h2>
<p>전역 EvalError에는 자체 메서드가 없지만 프로토 타입 체인을 통해 일부 메서드를 상속받습니다.</p>
<h2 id="EvalError_인스턴스"><code>EvalError</code> 인스턴스</h2>
<h3 id="Properties">Properties</h3>
<div>{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError/prototype', 'Properties')}}</div>
<h3 id="Methods">Methods</h3>
<div>{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError/prototype', 'Methods')}}</div>
<h2 id="예제">예제</h2>
<p><code>EvalError</code>는 현재 ECMAScript 사양에서 사용되지 않으므로 런타임에 의해 throw되지 않습니다. 그러나 개체 자체는 이전 버전의 사양과의 하위 호환성을 유지합니다.</p>
<h3 id="Creating_an_EvalError">Creating an <code>EvalError</code></h3>
<pre class="brush: js">try {
throw new EvalError('Hello', 'someFile.js', 10);
} catch (e) {
console.log(e instanceof EvalError); // true
console.log(e.message); // "Hello"
console.log(e.name); // "EvalError"
console.log(e.fileName); // "someFile.js"
console.log(e.lineNumber); // 10
console.log(e.columnNumber); // 0
console.log(e.stack); // "@Scratchpad/2:2:9\n"
}
</pre>
<h2 id="명세">명세</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('ES3')}}</td>
<td>{{Spec2('ES3')}}</td>
<td>Initial definition.</td>
</tr>
<tr>
<td>{{SpecName('ES5.1', '#sec-15.11.6.1', 'EvalError')}}</td>
<td>{{Spec2('ES5.1')}}</td>
<td>Not used in this specification. Present for backward compatibility.</td>
</tr>
<tr>
<td>{{SpecName('ES6', '#sec-native-error-types-used-in-this-standard-evalerror', 'EvalError')}}</td>
<td>{{Spec2('ES6')}}</td>
<td>Not used in this specification. Present for backward compatibility.</td>
</tr>
<tr>
<td>{{SpecName('ESDraft', '#sec-native-error-types-used-in-this-standard-evalerror', 'EvalError')}}</td>
<td>{{Spec2('ESDraft')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<div>{{Compat("javascript.builtins.EvalError")}}</div>
<h2 id="같이_보기">같이 보기</h2>
<ul>
<li>{{jsxref("Error")}}</li>
<li>{{jsxref("EvalError.prototype")}}</li>
<li>{{jsxref("Global_Objects/eval", "eval()")}}</li>
</ul>
|