We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df5242d commit 2dfd397Copy full SHA for 2dfd397
lib/_stream_writable.js
@@ -179,6 +179,8 @@ if (typeof Symbol === 'function' && Symbol.hasInstance) {
179
value: function(object) {
180
if (realHasInstance.call(this, object))
181
return true;
182
+ if (this !== Writable)
183
+ return false;
184
185
return object && object._writableState instanceof WritableState;
186
}
test/parallel/test-stream-inheritance.js
@@ -56,3 +56,8 @@ common.expectsError(
56
message: 'undefined does not inherit from CustomWritable'
57
58
);
59
+
60
+class OtherCustomWritable extends Writable {}
61
62
+assert(!(new OtherCustomWritable() instanceof CustomWritable));
63
+assert(!(new CustomWritable() instanceof OtherCustomWritable));
0 commit comments