Skip to content

Commit 81c01bb

Browse files
committed
quic: use a getter for stream options
Doesn't need to be a function PR-URL: #34283 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent b8945ba commit 81c01bb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/internal/quic/core.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ const kContinueBind = Symbol('kContinueBind');
214214
const kDestroy = Symbol('kDestroy');
215215
const kEndpointBound = Symbol('kEndpointBound');
216216
const kEndpointClose = Symbol('kEndpointClose');
217-
const kGetStreamOptions = Symbol('kGetStreamOptions');
218217
const kHandshake = Symbol('kHandshake');
219218
const kHandshakePost = Symbol('kHandshakePost');
220219
const kHeaders = Symbol('kHeaders');
@@ -237,6 +236,7 @@ const kSetSocket = Symbol('kSetSocket');
237236
const kSetSocketAfterBind = Symbol('kSetSocketAfterBind');
238237
const kStartFilePipe = Symbol('kStartFilePipe');
239238
const kStreamClose = Symbol('kStreamClose');
239+
const kStreamOptions = Symbol('kStreamOptions');
240240
const kStreamReset = Symbol('kStreamReset');
241241
const kTrackWriteState = Symbol('kTrackWriteState');
242242
const kUDPHandleForTesting = Symbol('kUDPHandleForTesting');
@@ -277,7 +277,7 @@ function onSessionReady(handle) {
277277
new QuicServerSession(
278278
socket,
279279
handle,
280-
socket[kGetStreamOptions]());
280+
socket[kStreamOptions]);
281281
try {
282282
socket.emit('session', session);
283283
} catch (error) {
@@ -475,7 +475,7 @@ function onStreamReady(streamHandle, id, push_id) {
475475
const {
476476
highWaterMark,
477477
defaultEncoding,
478-
} = session[kGetStreamOptions]();
478+
} = session[kStreamOptions];
479479
const stream = new QuicStream({
480480
writable: !uni,
481481
highWaterMark,
@@ -965,7 +965,7 @@ class QuicSocket extends EventEmitter {
965965
// Returns the default QuicStream options for peer-initiated
966966
// streams. These are passed on to new client and server
967967
// QuicSession instances when they are created.
968-
[kGetStreamOptions]() {
968+
get [kStreamOptions]() {
969969
const state = this[kInternalState];
970970
return {
971971
highWaterMark: state.highWaterMark,
@@ -1685,9 +1685,9 @@ class QuicSession extends EventEmitter {
16851685
socket[kAddSession](this);
16861686
}
16871687

1688-
// kGetStreamOptions is called to get the configured options
1689-
// for peer initiated QuicStream instances.
1690-
[kGetStreamOptions]() {
1688+
// Used to get the configured options for peer initiated QuicStream
1689+
// instances.
1690+
get [kStreamOptions]() {
16911691
const state = this[kInternalState];
16921692
return {
16931693
highWaterMark: state.highWaterMark,

0 commit comments

Comments
 (0)