Skip to content

Commit a2009a9

Browse files
JMouniermcollina
authored andcommitted
Add build regexp IE11 (isInteger) (#389)
1 parent 09a71b1 commit a2009a9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

build/build.js

100644100755
File mode changed.

build/files.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,13 @@ function CorkedRequest(state) {
193193
'const { emitExperimentalWarning } = require(\'../experimentalWarning\');'
194194
]
195195
, numberIE11 = [
196-
/Number.isNaN\(n\)/g
196+
/Number\.isNaN\(n\)/g
197197
, 'n !== n'
198198
]
199+
, integerIE11 = [
200+
/Number\.isInteger\(hwm\)/g
201+
, '(isFinite(hwm) && Math.floor(hwm) === hwm)'
202+
]
199203
, noAsyncIterators1 = [
200204
/Readable\.prototype\[Symbol\.asyncIterator\] = function\(\) \{/g
201205
, 'if (typeof Symbol === \'function\' ) {\nReadable.prototype[Symbol.asyncIterator] = function () {'
@@ -313,6 +317,7 @@ module.exports['internal/streams/destroy.js'] = [
313317

314318
module.exports['internal/streams/state.js'] = [
315319
, errorsTwoLevel
320+
, integerIE11
316321
]
317322

318323
module.exports['internal/streams/async_iterator.js'] = [

lib/internal/streams/state.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function highWaterMarkFrom(options, isDuplex, duplexKey) {
99
function getHighWaterMark(state, options, duplexKey, isDuplex) {
1010
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
1111
if (hwm != null) {
12-
if (!Number.isInteger(hwm) || hwm < 0) {
12+
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
1313
var name = isDuplex ? duplexKey : 'highWaterMark';
1414
throw new ERR_INVALID_OPT_VALUE(name, hwm);
1515
}

0 commit comments

Comments
 (0)