Skip to content

Commit

Permalink
quic: use a getter for stream options
Browse files Browse the repository at this point in the history
Doesn't need to be a function

PR-URL: #34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell committed Jul 16, 2020
1 parent b8945ba commit 81c01bb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/internal/quic/core.js
Expand Up @@ -214,7 +214,6 @@ const kContinueBind = Symbol('kContinueBind');
const kDestroy = Symbol('kDestroy');
const kEndpointBound = Symbol('kEndpointBound');
const kEndpointClose = Symbol('kEndpointClose');
const kGetStreamOptions = Symbol('kGetStreamOptions');
const kHandshake = Symbol('kHandshake');
const kHandshakePost = Symbol('kHandshakePost');
const kHeaders = Symbol('kHeaders');
Expand All @@ -237,6 +236,7 @@ const kSetSocket = Symbol('kSetSocket');
const kSetSocketAfterBind = Symbol('kSetSocketAfterBind');
const kStartFilePipe = Symbol('kStartFilePipe');
const kStreamClose = Symbol('kStreamClose');
const kStreamOptions = Symbol('kStreamOptions');
const kStreamReset = Symbol('kStreamReset');
const kTrackWriteState = Symbol('kTrackWriteState');
const kUDPHandleForTesting = Symbol('kUDPHandleForTesting');
Expand Down Expand Up @@ -277,7 +277,7 @@ function onSessionReady(handle) {
new QuicServerSession(
socket,
handle,
socket[kGetStreamOptions]());
socket[kStreamOptions]);
try {
socket.emit('session', session);
} catch (error) {
Expand Down Expand Up @@ -475,7 +475,7 @@ function onStreamReady(streamHandle, id, push_id) {
const {
highWaterMark,
defaultEncoding,
} = session[kGetStreamOptions]();
} = session[kStreamOptions];
const stream = new QuicStream({
writable: !uni,
highWaterMark,
Expand Down Expand Up @@ -965,7 +965,7 @@ class QuicSocket extends EventEmitter {
// Returns the default QuicStream options for peer-initiated
// streams. These are passed on to new client and server
// QuicSession instances when they are created.
[kGetStreamOptions]() {
get [kStreamOptions]() {
const state = this[kInternalState];
return {
highWaterMark: state.highWaterMark,
Expand Down Expand Up @@ -1685,9 +1685,9 @@ class QuicSession extends EventEmitter {
socket[kAddSession](this);
}

// kGetStreamOptions is called to get the configured options
// for peer initiated QuicStream instances.
[kGetStreamOptions]() {
// Used to get the configured options for peer initiated QuicStream
// instances.
get [kStreamOptions]() {
const state = this[kInternalState];
return {
highWaterMark: state.highWaterMark,
Expand Down

0 comments on commit 81c01bb

Please sign in to comment.