Skip to content

Commit ccdde36

Browse files
committed
util: add remaining errors to wellKnownPrototypes
1 parent 59a763e commit ccdde36

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

lib/internal/util/inspect.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,27 @@ const {
3030
DatePrototypeGetTime,
3131
DatePrototypeToISOString,
3232
DatePrototypeToString,
33+
3334
Error,
3435
ErrorPrototype,
3536
ErrorPrototypeToString,
37+
AggregateError,
38+
AggregateErrorPrototype,
39+
EvalError,
40+
EvalErrorPrototype,
41+
RangeError,
42+
RangeErrorPrototype,
43+
ReferenceError,
44+
ReferenceErrorPrototype,
45+
// SuppressedError,
46+
// SuppressedErrorPrototype,
47+
SyntaxError,
48+
SyntaxErrorPrototype,
49+
TypeError,
50+
TypeErrorPrototype,
51+
URIError,
52+
URIErrorPrototype,
53+
3654
Function,
3755
FunctionPrototype,
3856
FunctionPrototypeBind,
@@ -636,7 +654,17 @@ const wellKnownPrototypes = new SafeMap()
636654
.set(RegExpPrototype, { name: 'RegExp', constructor: RegExp })
637655
.set(DatePrototype, { name: 'Date', constructor: Date })
638656
.set(DataViewPrototype, { name: 'DataView', constructor: DataView })
657+
639658
.set(ErrorPrototype, { name: 'Error', constructor: Error })
659+
.set(AggregateErrorPrototype, { name: 'AggregateError', constructor: AggregateError })
660+
.set(EvalErrorPrototype, { name: 'EvalError', constructor: EvalError })
661+
.set(RangeErrorPrototype, { name: 'RangeError', constructor: RangeError })
662+
.set(ReferenceErrorPrototype, { name: 'ReferenceError', constructor: ReferenceError })
663+
// .set(SuppressedErrorPrototype, { name: 'SuppressedError', constructor: SuppressedError })
664+
.set(SyntaxErrorPrototype, { name: 'SyntaxError', constructor: SyntaxError })
665+
.set(TypeErrorPrototype, { name: 'TypeError', constructor: TypeError })
666+
.set(URIErrorPrototype, { name: 'URIError', constructor: URIError })
667+
640668
.set(BooleanPrototype, { name: 'Boolean', constructor: Boolean })
641669
.set(NumberPrototype, { name: 'Number', constructor: Number })
642670
.set(StringPrototype, { name: 'String', constructor: String })

typings/primordials.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ declare namespace primordials {
428428
export const StringPrototypeToWellFormed: UncurryThis<typeof String.prototype.toWellFormed>
429429
export const StringPrototypeValueOf: UncurryThis<typeof String.prototype.valueOf>
430430
export const StringPrototypeReplaceAll: UncurryThis<typeof String.prototype.replaceAll>
431+
// export import SuppressedError = globalThis.SuppressedError;
432+
// export const SuppressedErrorPrototype: typeof SuppressedError.prototype;
431433
export import Symbol = globalThis.Symbol;
432434
export const SymbolPrototype: typeof Symbol.prototype
433435
export const SymbolFor: typeof Symbol.for

0 commit comments

Comments
 (0)