-
Notifications
You must be signed in to change notification settings - Fork 2
/
spec.emu
69 lines (56 loc) · 3.1 KB
/
spec.emu
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
<!doctype html>
<meta charset="utf8">
<pre class="metadata">
title: Error.isError
stage: 3
contributors: Jordan Harband
</pre>
<emu-clause id="sec-fundamental-objects" number="20">
<h1>Fundamental Objects</h1>
<emu-clause id="sec-error-objects" number="5">
<h1>Error Objects</h1>
<emu-clause id="sec-properties-of-the-error-constructor" number="2">
<h1>Properties of the Error Constructor</h1>
<emu-clause id="sec-error.iserror">
<h1>Error.isError ( _arg_ )</h1>
<emu-alg>
1. Return IsError(_arg_).
</emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-error-instances">
<h1>Properties of Error Instances</h1>
<p>Error instances are ordinary objects that inherit properties from the Error prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified uses of [[ErrorData]] is to identify Error, AggregateError, and _NativeError_ instances as Error objects within `Object.prototype.toString`<ins> and `Error.isError`</ins>.</p>
</emu-clause>
<emu-clause id="sec-properties-of-nativeerror-instances" number="6">
<h1>Properties of _NativeError_ Instances</h1>
<p>_NativeError_ instances are ordinary objects that inherit properties from their _NativeError_ prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified use of [[ErrorData]] is by `Object.prototype.toString` (<emu-xref href="#sec-object.prototype.tostring"></emu-xref>) <ins> and `Error.isError` (<emu-xref href="#sec-error.iserror"></emu-xref>) </ins>to identify Error, AggregateError, or _NativeError_ instances.</p>
</emu-clause>
<emu-clause id="sec-aggregate-error-objects" number="7">
<h1>AggregateError Objects</h1>
<emu-clause id="sec-properties-of-aggregate-error-instances" number="3">
<h1>Properties of AggregateError Instances</h1>
<p>AggregateError instances are ordinary objects that inherit properties from their AggregateError prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified use of [[ErrorData]] is by `Object.prototype.toString` (<emu-xref href="#sec-object.prototype.tostring"></emu-xref>) <ins> and `Error.isError` (<emu-xref href="#sec-error.iserror"></emu-xref>) </ins>to identify Error, AggregateError, or _NativeError_ instances.</p>
</emu-clause>
</emu-clause>
<emu-clause id="sec-abstract-operations-for-error-objects" number="8">
<h1>Abstract Operations for Error Objects</h1>
<emu-clause id="sec-iserror" type="abstract operation" number="2" class="ins">
<h1>
IsError(
_argument_: an Ecmascript language value,
): a Boolean
</h1>
<dl class="header">
<dt>description</dt>
<dd>It returns a boolean indicating whether the argument is a built-in Error instance or not.</dd>
</dl>
<emu-alg>
1. If _argument_ is not an Object, return *false*.
1. If _argument_ has an [[ErrorData]] internal slot, return *true*.
1. Return *false*.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
</emu-clause>