diff --git a/build/build.js b/build/build.js old mode 100644 new mode 100755 diff --git a/build/files.js b/build/files.js index 0577621df6..f9a670e6a8 100644 --- a/build/files.js +++ b/build/files.js @@ -193,9 +193,13 @@ function CorkedRequest(state) { 'const { emitExperimentalWarning } = require(\'../experimentalWarning\');' ] , numberIE11 = [ - /Number.isNaN\(n\)/g + /Number\.isNaN\(n\)/g , 'n !== n' ] + , integerIE11 = [ + /Number\.isInteger\(hwm\)/g + , '(isFinite(hwm) && Math.floor(hwm) === hwm)' + ] , noAsyncIterators1 = [ /Readable\.prototype\[Symbol\.asyncIterator\] = function\(\) \{/g , 'if (typeof Symbol === \'function\' ) {\nReadable.prototype[Symbol.asyncIterator] = function () {' @@ -313,6 +317,7 @@ module.exports['internal/streams/destroy.js'] = [ module.exports['internal/streams/state.js'] = [ , errorsTwoLevel + , integerIE11 ] module.exports['internal/streams/async_iterator.js'] = [ diff --git a/lib/internal/streams/state.js b/lib/internal/streams/state.js index 66131e4632..a0aea6fc23 100644 --- a/lib/internal/streams/state.js +++ b/lib/internal/streams/state.js @@ -9,7 +9,7 @@ function highWaterMarkFrom(options, isDuplex, duplexKey) { function getHighWaterMark(state, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { - if (!Number.isInteger(hwm) || hwm < 0) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name = isDuplex ? duplexKey : 'highWaterMark'; throw new ERR_INVALID_OPT_VALUE(name, hwm); }