Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use a symbol instead of an underscore prefix
  • Loading branch information
akukas authored May 30, 2019
commit 2cf97f23e808077c2bad12e48ef49ff373163d5b
11 changes: 6 additions & 5 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ const kLocalSettings = Symbol('local-settings');
const kOptions = Symbol('options');
const kOwner = owner_symbol;
const kOrigin = Symbol('origin');
const kPendingRequestCalls = Symbol('pending-request-calls');
Comment thread
akukas marked this conversation as resolved.
Outdated
const kProceed = Symbol('proceed');
const kProtocol = Symbol('protocol');
const kRemoteSettings = Symbol('remote-settings');
Expand Down Expand Up @@ -1479,13 +1480,13 @@ class ClientHttp2Session extends Http2Session {

const onConnect = requestOnConnect.bind(stream, headersList, options);
if (this.connecting) {
if (this._pendingRequestCalls) {
this._pendingRequestCalls.push(onConnect);
if (this[kPendingRequestCalls]) {
Comment thread
akukas marked this conversation as resolved.
Outdated
this[kPendingRequestCalls].push(onConnect);
} else {
this._pendingRequestCalls = [onConnect];
this[kPendingRequestCalls] = [onConnect];
this.once('connect', () => {
this._pendingRequestCalls.forEach(f => f());
delete this._pendingRequestCalls;
this[kPendingRequestCalls].forEach(f => f());
delete this[kPendingRequestCalls];
Comment thread
akukas marked this conversation as resolved.
Outdated
});
}
} else {
Expand Down