Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix isInteger for IE11 #389

Merged
merged 1 commit into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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