Skip to content

Commit d2fe4f3

Browse files
committed
Improved interoperability with ES6 classes
1 parent 206aa2c commit d2fe4f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ function createError () {
111111

112112
function createHttpErrorConstructor () {
113113
function HttpError () {
114-
throw new TypeError('cannot construct abstract class')
114+
if (this.constructor === HttpError) {
115+
throw new TypeError('cannot construct abstract class')
116+
}
115117
}
116118

117119
inherits(HttpError, Error)

0 commit comments

Comments
 (0)