File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,10 @@ const headRegexp = /(^module.exports = \w+;?)/m
179
179
/ r e q u i r e \( ' i n t e r n a l \/ s t r e a m s \/ B u f f e r L i s t ' \) / ,
180
180
'require(\'./internal/streams/BufferList\')'
181
181
]
182
-
182
+ , fixInstanceCheck = [
183
+ / i f \( t y p e o f S y m b o l = = = ' f u n c t i o n ' & & S y m b o l \. h a s I n s t a n c e \) \{ / ,
184
+ `if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {`
185
+ ]
183
186
184
187
module . exports [ '_stream_duplex.js' ] = [
185
188
requireReplacement
@@ -257,6 +260,7 @@ module.exports['_stream_writable.js'] = [
257
260
, fixSyncWrite
258
261
, bufferShimFix
259
262
, bufferStaticMethods
263
+ , fixInstanceCheck
260
264
]
261
265
module . exports [ 'internal/streams/BufferList.js' ] = [
262
266
bufferShimFix
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ WritableState.prototype.getBuffer = function getBuffer() {
177
177
// Test _writableState for inheritance to account for Duplex streams,
178
178
// whose prototype chain only points to Readable.
179
179
var realHasInstance ;
180
- if ( typeof Symbol === 'function' && Symbol . hasInstance ) {
180
+ if ( typeof Symbol === 'function' && Symbol . hasInstance && typeof Function . prototype [ Symbol . hasInstance ] === 'function' ) {
181
181
realHasInstance = Function . prototype [ Symbol . hasInstance ] ;
182
182
Object . defineProperty ( Writable , Symbol . hasInstance , {
183
183
value : function ( object ) {
You can’t perform that action at this time.
0 commit comments