| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1053,8 +1053,8 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) { | |||
| 1053 | 1053 | * @param {{ | |
| 1054 | 1054 | * signal: AbortSignal; | |
| 1055 | 1055 | * close?: string[]; | |
| 1056 | - * highWatermark?: number, | ||
| 1057 | - * lowWatermark?: number | ||
| 1056 | + * highWaterMark?: number, | ||
| 1057 | + * lowWaterMark?: number | ||
| 1058 | 1058 | * }} [options] | |
| 1059 | 1059 | * @returns {AsyncIterator} | |
| 1060 | 1060 | */ | |
@@ -1065,10 +1065,12 @@ function on(emitter, event, options = kEmptyObject) { | |||
| 1065 | 1065 | validateAbortSignal(signal, 'options.signal'); | |
| 1066 | 1066 | if (signal?.aborted) | |
| 1067 | 1067 | throw new AbortError(undefined, { cause: signal?.reason }); | |
| 1068 | - const highWatermark = options.highWatermark ?? NumberMAX_SAFE_INTEGER; | ||
| 1069 | - validateInteger(highWatermark, 'options.highWatermark', 1); | ||
| 1070 | - const lowWatermark = options.lowWatermark ?? 1; | ||
| 1071 | - validateInteger(lowWatermark, 'options.lowWatermark', 1); | ||
| 1068 | + // Support both highWaterMark and highWatermark for backward compatibility | ||
| 1069 | + const highWatermark = options.highWaterMark ?? options.highWatermark ?? NumberMAX_SAFE_INTEGER; | ||
| 1070 | + validateInteger(highWatermark, 'options.highWaterMark', 1); | ||
| 1071 | + // Support both lowWaterMark and lowWatermark for backward compatibility | ||
| 1072 | + const lowWatermark = options.lowWaterMark ?? options.lowWatermark ?? 1; | ||
| 1073 | + validateInteger(lowWatermark, 'options.lowWaterMark', 1); | ||
| 1072 | 1074 | ||
| 1073 | 1075 | // Preparing controlling queues and variables | |
| 1074 | 1076 | FixedQueue ??= require('internal/fixed_queue'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1359,7 +1359,7 @@ class Interface extends InterfaceConstructor { | |||
| 1359 | 1359 | this[kLineObjectStream] = EventEmitter.on( | |
| 1360 | 1360 | this, 'line', { | |
| 1361 | 1361 | close: ['close'], | |
| 1362 | - highWatermark: 1024, | ||
| 1362 | + highWaterMark: 1024, | ||
| 1363 | 1363 | [kFirstEventParam]: true, | |
| 1364 | 1364 | }); | |
| 1365 | 1365 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments