@@ -1051,8 +1051,8 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
1051
1051
* @param {{
1052
1052
* signal: AbortSignal;
1053
1053
* close?: string[];
1054
- * highWatermark ?: number,
1055
- * lowWatermark ?: number
1054
+ * highWaterMark ?: number,
1055
+ * lowWaterMark ?: number
1056
1056
* }} [options]
1057
1057
* @returns {AsyncIterator }
1058
1058
*/
@@ -1062,10 +1062,12 @@ function on(emitter, event, options = kEmptyObject) {
1062
1062
validateAbortSignal ( signal , 'options.signal' ) ;
1063
1063
if ( signal ?. aborted )
1064
1064
throw new AbortError ( undefined , { cause : signal ?. reason } ) ;
1065
- const highWatermark = options . highWatermark ?? NumberMAX_SAFE_INTEGER ;
1066
- validateInteger ( highWatermark , 'options.highWatermark' , 1 ) ;
1067
- const lowWatermark = options . lowWatermark ?? 1 ;
1068
- validateInteger ( lowWatermark , 'options.lowWatermark' , 1 ) ;
1065
+ // Support both highWaterMark and highWatermark for backward compatibility
1066
+ const highWatermark = options . highWaterMark ?? options . highWatermark ?? NumberMAX_SAFE_INTEGER ;
1067
+ validateInteger ( highWatermark , 'options.highWaterMark' , 1 ) ;
1068
+ // Support both lowWaterMark and lowWatermark for backward compatibility
1069
+ const lowWatermark = options . lowWaterMark ?? options . lowWatermark ?? 1 ;
1070
+ validateInteger ( lowWatermark , 'options.lowWaterMark' , 1 ) ;
1069
1071
1070
1072
// Preparing controlling queues and variables
1071
1073
FixedQueue ??= require ( 'internal/fixed_queue' ) ;
0 commit comments