util: add some additional error classes to wellKnownPrototypes

PR-URL: https://github.com/nodejs/node/pull/59456
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Mark S. Miller 2025-08-19 02:00:24 -07:00 committed by GitHub
parent 64355ae97e
commit 3f51cb6229
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,8 @@
'use strict';
const {
AggregateError,
AggregateErrorPrototype,
Array,
ArrayBuffer,
ArrayBufferPrototype,
@ -74,6 +76,8 @@ const {
ObjectSetPrototypeOf,
Promise,
PromisePrototype,
RangeError,
RangeErrorPrototype,
ReflectApply,
ReflectOwnKeys,
RegExp,
@ -114,6 +118,8 @@ const {
SymbolPrototypeValueOf,
SymbolToPrimitive,
SymbolToStringTag,
TypeError,
TypeErrorPrototype,
TypedArray,
TypedArrayPrototype,
TypedArrayPrototypeGetLength,
@ -636,7 +642,12 @@ const wellKnownPrototypes = new SafeMap()
.set(RegExpPrototype, { name: 'RegExp', constructor: RegExp })
.set(DatePrototype, { name: 'Date', constructor: Date })
.set(DataViewPrototype, { name: 'DataView', constructor: DataView })
.set(ErrorPrototype, { name: 'Error', constructor: Error })
.set(AggregateErrorPrototype, { name: 'AggregateError', constructor: AggregateError })
.set(RangeErrorPrototype, { name: 'RangeError', constructor: RangeError })
.set(TypeErrorPrototype, { name: 'TypeError', constructor: TypeError })
.set(BooleanPrototype, { name: 'Boolean', constructor: Boolean })
.set(NumberPrototype, { name: 'Number', constructor: Number })
.set(StringPrototype, { name: 'String', constructor: String })