Skip to content

Commit 15ae21b

Browse files
erightstargos
authored andcommitted
util: add some additional error classes to wellKnownPrototypes
PR-URL: #59456 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent e076f78 commit 15ae21b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/internal/util/inspect.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const {
4+
AggregateError,
5+
AggregateErrorPrototype,
46
Array,
57
ArrayBuffer,
68
ArrayBufferPrototype,
@@ -74,6 +76,8 @@ const {
7476
ObjectSetPrototypeOf,
7577
Promise,
7678
PromisePrototype,
79+
RangeError,
80+
RangeErrorPrototype,
7781
ReflectApply,
7882
ReflectOwnKeys,
7983
RegExp,
@@ -114,6 +118,8 @@ const {
114118
SymbolPrototypeValueOf,
115119
SymbolToPrimitive,
116120
SymbolToStringTag,
121+
TypeError,
122+
TypeErrorPrototype,
117123
TypedArray,
118124
TypedArrayPrototype,
119125
TypedArrayPrototypeGetLength,
@@ -636,7 +642,12 @@ const wellKnownPrototypes = new SafeMap()
636642
.set(RegExpPrototype, { name: 'RegExp', constructor: RegExp })
637643
.set(DatePrototype, { name: 'Date', constructor: Date })
638644
.set(DataViewPrototype, { name: 'DataView', constructor: DataView })
645+
639646
.set(ErrorPrototype, { name: 'Error', constructor: Error })
647+
.set(AggregateErrorPrototype, { name: 'AggregateError', constructor: AggregateError })
648+
.set(RangeErrorPrototype, { name: 'RangeError', constructor: RangeError })
649+
.set(TypeErrorPrototype, { name: 'TypeError', constructor: TypeError })
650+
640651
.set(BooleanPrototype, { name: 'Boolean', constructor: Boolean })
641652
.set(NumberPrototype, { name: 'Number', constructor: Number })
642653
.set(StringPrototype, { name: 'String', constructor: String })

0 commit comments

Comments
 (0)