| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This change doesn't affect anything, but I found two different ways across the single constructor: self and this. Seems it should be consistent but I don't know the agreement about it.
Sorry, something went wrong.
There was a problem hiding this comment.
@bnoordhuis didn't you mention in another issue recently that we should prefer this and an arrow function over self?
Sorry, something went wrong.
There was a problem hiding this comment.
If we're setting this to zero now, we should both remove ClientRequest.prototype.aborted = undefined; and change the if (this.aborted === undefined) check to if (!this.aborted) below.
Sorry, something went wrong.
There was a problem hiding this comment.
Perhaps we should also change delete req.res later in this file to req.res = null?
Sorry, something went wrong.
|
@mscdex made some fixes after review:
Also, started to use this, not self in the constructor |
Sorry, something went wrong.
Sorry, something went wrong.
|
Guys, why do windows tests fail? Seems it's not the result of this changes, considering it's about JavaScript code, isn't it? |
Sorry, something went wrong.
|
@vitkarpov In this case, the Windows failure is the result of a CI infrastructure issue and is unrelated to this PR. I'm not sure why aix failed though, it seems it couldn't find the built node binary for some reason. /cc @mhdawson ? The ARM failure looks unrelated. |
Sorry, something went wrong.
|
Yep, I've noticed that some other prs behave the same. |
Sorry, something went wrong.
|
Guys, what's gonna happen with this pr? I'm ready to rebase the branch when it will be about to be merged, but I'm not sure about the process (there's not milestone tag or something). |
Sorry, something went wrong.
|
Minimally, this needs a rebase, collaborator approval, and a new CI run. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
@vitkarpov
var called = false;
if (self.socketPath) {
// ...
this.timeoutCb = null;
this.upgradeOrConnect = false; |
Sorry, something went wrong.
Sorry, something went wrong.
|
CI is green, except for an unrelated CI infrastructure failure. LGTM. /cc @nodejs/collaborators |
Sorry, something went wrong.
|
I think there are additional properties to add:
|
Sorry, something went wrong.
There was a problem hiding this comment.
It's usually helpful to add a little comment on these, as it helps in the long run (see _readableState as an example).
Sorry, something went wrong.
There was a problem hiding this comment.
@mcollina I'm sorry, but I'm not sure I get it right, do you mean this comment?
Sorry, something went wrong.
Hm, I greped a bit and found even more fields. Seems this needs to be processed the same way, doesn't it? @jasnell @cjihrig Also, maybe it's a good idea to make some special setter-methods for such cases or it's overkill? (so the outer code doesn't set anything to request instance directly, because it's hard to control beyond) |
Sorry, something went wrong.
|
@targos is right, those additional properties seem to also be used on the ClientRequest object, although I would suggest using null instead of undefined for maxHeadersCount since it makes it look more intentional. |
Sorry, something went wrong.
@vitkarpov socket and connection are already defined in OutgoingMessage's constructor, which is what ClientRequest inherits from. |
Sorry, something went wrong.
|
btw I used Object.seal(this) at the end of the constructor and ran the tests to find the missing properties. |
Sorry, something went wrong.
@mscdex maybe it should be always a number and 2000 by default in constructor? (I'm not sure does this break anything, hope tests illuminate :) |
Sorry, something went wrong.
|
As this has not been backported I'm setting to dont-land |
Sorry, something went wrong.
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: nodejs#9116
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: #9116 PR-URL: #20359 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: #9116 PR-URL: #20359 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: #9116 PR-URL: #20359 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: #9116 PR-URL: #20359 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Description of change
res and abort fields are now defined in the constructor and not suddenly appear during the runtime. This makes hidden class stable and the heap snapshot more verbose.
Ref: #8912
PR-URL: #9116