Skip to content

Commit 76977e9

Browse files
committed
remove conditional proto set
1 parent d9a716b commit 76977e9

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

index.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,6 @@ function createClientErrorConstructor (HttpError, name, code) {
137137
// capture a stack trace to the construction point
138138
Error.captureStackTrace(err, ClientError)
139139

140-
// adjust the [[Prototype]] if new.target is not this class
141-
if (new.target && new.target !== ClientError) {
142-
setPrototypeOf(err, new.target.prototype)
143-
}
144-
145140
// redefine the error message
146141
Object.defineProperty(err, 'message', {
147142
enumerable: true,
@@ -208,11 +203,6 @@ function createServerErrorConstructor (HttpError, name, code) {
208203
// capture a stack trace to the construction point
209204
Error.captureStackTrace(err, ServerError)
210205

211-
// adjust the [[Prototype]] if new.target is not this class
212-
if (new.target && new.target !== ServerError) {
213-
setPrototypeOf(err, new.target.prototype)
214-
}
215-
216206
// redefine the error message
217207
Object.defineProperty(err, 'message', {
218208
enumerable: true,

0 commit comments

Comments
 (0)