Skip to content

Commit

Permalink
fix gulp weirdness
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmetcalf committed Nov 14, 2016
1 parent 8f97e1d commit 289786a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion build/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ const headRegexp = /(^module.exports = \w+;?)/m
/require\('internal\/streams\/BufferList'\)/,
'require(\'./internal/streams/BufferList\')'
]

, fixInstanceCheck = [
/if \(typeof Symbol === 'function' && Symbol\.hasInstance\) \{/,
`if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {`
]

module.exports['_stream_duplex.js'] = [
requireReplacement
Expand Down Expand Up @@ -257,6 +260,7 @@ module.exports['_stream_writable.js'] = [
, fixSyncWrite
, bufferShimFix
, bufferStaticMethods
, fixInstanceCheck
]
module.exports['internal/streams/BufferList.js'] = [
bufferShimFix
Expand Down
2 changes: 1 addition & 1 deletion lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ WritableState.prototype.getBuffer = function getBuffer() {
// Test _writableState for inheritance to account for Duplex streams,
// whose prototype chain only points to Readable.
var realHasInstance;
if (typeof Symbol === 'function' && Symbol.hasInstance) {
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
realHasInstance = Function.prototype[Symbol.hasInstance];
Object.defineProperty(Writable, Symbol.hasInstance, {
value: function (object) {
Expand Down

0 comments on commit 289786a

Please sign in to comment.