Skip to content

http: _http_common.js (and associated) cleanup

There are 4 smaller commits here:

  1. Remove constant deep property access by storing a reference, use more const, make some conditionals stricter.

  2. A comment explaining kOnHeaders function of the parser was duplicated in two places but the second instance was more confusing than helpful.

  3. Cleanup constructor and freeParser to manage all existing parser properties, not just some.

  4. 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), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading