Skip to content

Commit 170592d

Browse files
authored
chore: call super() after type checks (#4475)
1 parent 5f256af commit 170592d

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

lib/dispatcher/h2c-client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class H2CClient extends DispatcherBase {
1212
#client = null
1313

1414
constructor (origin, clientOpts) {
15-
super()
16-
1715
if (typeof origin === 'string') {
1816
origin = new URL(origin)
1917
}
@@ -47,6 +45,8 @@ class H2CClient extends DispatcherBase {
4745
)
4846
}
4947

48+
super()
49+
5050
this.#client = new Client(origin, {
5151
...opts,
5252
connect: this.#buildConnector(connect),

lib/dispatcher/pool.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class Pool extends PoolBase {
5151
throw new InvalidArgumentError('connect must be a function or an object')
5252
}
5353

54-
super()
55-
5654
if (typeof connect !== 'function') {
5755
connect = buildConnector({
5856
...tls,
@@ -65,6 +63,8 @@ class Pool extends PoolBase {
6563
})
6664
}
6765

66+
super()
67+
6868
this[kConnections] = connections || null
6969
this[kUrl] = util.parseOrigin(origin)
7070
this[kOptions] = { ...util.deepClone(options), connect, allowH2, clientTtl }

lib/dispatcher/proxy-agent.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ class Http1ProxyWrapper extends DispatcherBase {
3737
#client
3838

3939
constructor (proxyUrl, { headers = {}, connect, factory }) {
40-
super()
4140
if (!proxyUrl) {
4241
throw new InvalidArgumentError('Proxy URL is mandatory')
4342
}
4443

44+
super()
45+
4546
this[kProxyHeaders] = headers
4647
if (factory) {
4748
this.#client = factory(proxyUrl, { connect })

0 commit comments

Comments
 (0)