Skip to content

Commit

Permalink
Add build regexp IE11 (isInteger) (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
JMounier authored and mcollina committed Dec 13, 2018
1 parent 09a71b1 commit a2009a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Empty file modified build/build.js
100644 → 100755
Empty file.
7 changes: 6 additions & 1 deletion build/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {'
Expand Down Expand Up @@ -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'] = [
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/streams/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a2009a9

Please sign in to comment.