src: improve module loader readability
Various improvements on readability, performance and conformity to the Node core coding style in the ESM loader C++ code:
-
isolate
for theIsolate*
,context
for theLocal<Context>
- Less reliance on
auto
where it’s unnecessary/increases cognitive overhead - Shorter paths to failure via
.ToLocal()
& co - Do not keep pending exceptions around e.g. for failed
JSON
parsing - Use
Maybe
types to get explicit error status forwarding - Remove an unnecessary handle scope
- Add
nullptr
checks for unwrapped host objects - Remove unused code
- Use
CamelCase
for function names - Use
const Foo&
instead of copying values whenever possible - Pass along the
Environment*
explicitly
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
src