Skip to content

Commit

Permalink
Normative: add Error.isError
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 9, 2024
1 parent c404297 commit e12b48d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -31214,6 +31214,16 @@ <h1>Properties of the Error Constructor</h1>
<li>has the following properties:</li>
</ul>

<emu-clause id="sec-error.iserror">
<h1>Error.isError ( _arg_ )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. If _arg_ is not an Object, return *false*.
1. If _arg_ does not have an [[ErrorData]] internal slot, return *false*.
1. Return *true*.
</emu-alg>
</emu-clause>

<emu-clause id="sec-error.prototype">
<h1>Error.prototype</h1>
<p>The initial value of `Error.prototype` is the Error prototype object.</p>
Expand Down Expand Up @@ -31265,7 +31275,7 @@ <h1>Error.prototype.toString ( )</h1>

<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`.</p>
<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>
</emu-clause>

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

<emu-clause id="sec-properties-of-nativeerror-instances">
<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>) to identify Error, AggregateError, or _NativeError_ instances.</p>
<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>
</emu-clause>
</emu-clause>

Expand Down Expand Up @@ -31458,7 +31468,7 @@ <h1>AggregateError.prototype.name</h1>

<emu-clause id="sec-properties-of-aggregate-error-instances">
<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>) to identify Error, AggregateError, or _NativeError_ instances.</p>
<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>
</emu-clause>
</emu-clause>

Expand Down

0 comments on commit e12b48d

Please sign in to comment.