Skip to content

Commit 0820c3d

Browse files
committed
Normative: add Error.isError
1 parent c404297 commit 0820c3d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

spec.html

+13-3
Original file line numberDiff line numberDiff line change
@@ -31214,6 +31214,16 @@ <h1>Properties of the Error Constructor</h1>
3121431214
<li>has the following properties:</li>
3121531215
</ul>
3121631216

31217+
<emu-clause id="sec-error.iserror">
31218+
<h1>Error.isError ( _arg_ )</h1>
31219+
<p>This function performs the following steps when called:</p>
31220+
<emu-alg>
31221+
1. If _arg_ is not an Object, return *false*.
31222+
1. If _arg_ does not have an [[ErrorData]] internal slot, return *false*.
31223+
1. Return *true*.
31224+
</emu-alg>
31225+
</emu-clause>
31226+
3121731227
<emu-clause id="sec-error.prototype">
3121831228
<h1>Error.prototype</h1>
3121931229
<p>The initial value of `Error.prototype` is the Error prototype object.</p>
@@ -31265,7 +31275,7 @@ <h1>Error.prototype.toString ( )</h1>
3126531275

3126631276
<emu-clause id="sec-properties-of-error-instances">
3126731277
<h1>Properties of Error Instances</h1>
31268-
<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`.</p>
31278+
<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` and `Error.isError`.</p>
3126931279
</emu-clause>
3127031280

3127131281
<emu-clause id="sec-native-error-types-used-in-this-standard">
@@ -31381,7 +31391,7 @@ <h1>_NativeError_.prototype.name</h1>
3138131391

3138231392
<emu-clause id="sec-properties-of-nativeerror-instances">
3138331393
<h1>Properties of _NativeError_ Instances</h1>
31384-
<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>) to identify Error, AggregateError, or _NativeError_ instances.</p>
31394+
<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>) and `Error.isError` (<emu-xref href="#sec-error.iserror"></emu-xref>) to identify Error, AggregateError, or _NativeError_ instances.</p>
3138531395
</emu-clause>
3138631396
</emu-clause>
3138731397

@@ -31458,7 +31468,7 @@ <h1>AggregateError.prototype.name</h1>
3145831468

3145931469
<emu-clause id="sec-properties-of-aggregate-error-instances">
3146031470
<h1>Properties of AggregateError Instances</h1>
31461-
<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>) to identify Error, AggregateError, or _NativeError_ instances.</p>
31471+
<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>) and `Error.isError` (<emu-xref href="#sec-error.iserror"></emu-xref>) to identify Error, AggregateError, or _NativeError_ instances.</p>
3146231472
</emu-clause>
3146331473
</emu-clause>
3146431474

0 commit comments

Comments
 (0)