http: _http_common.js (and associated) cleanup
There are 4 smaller commits here:
-
Remove constant deep property access by storing a reference, use more const, make some conditionals stricter.
-
A comment explaining kOnHeaders function of the parser was duplicated in two places but the second instance was more confusing than helpful.
-
Cleanup constructor and freeParser to manage all existing parser properties, not just some.
-
freeParser already unsets parser property of socket if socket is passed in specifically. There's no need to do this twice.
This is a part of an upcoming deep dive into cleaning up some internals of the http
module.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines