Skip to content

Commit

Permalink
pref: improve performance of instanceof (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtx1130 committed Feb 18, 2022
1 parent 4d0e408 commit c5ce37d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function createError (code, message, statusCode = 500, Base = Error) {
code = code.toUpperCase()

function FastifyError (a, b, c) {
if (!(this instanceof FastifyError)) {
if (!new.target) {
return new FastifyError(a, b, c)
}
Error.captureStackTrace(this, FastifyError)
Expand Down

0 comments on commit c5ce37d

Please sign in to comment.