Permalink
Please
sign in to comment.
Browse files
util: access process states lazily in debuglog
`debuglog()` depends on `process.pid` and `process.env.NODE_DEBUG`, so it needs to be called lazily in top scopes of internal modules that may be loaded before these run time states are allowed to be accessed. This patch makes its implementation lazy by default, the process states are only accessed when the returned debug function is called for the first time. PR-URL: #27281 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
- Loading branch information...
Showing
with
25 additions
and 51 deletions.
- +1 −8 lib/_stream_readable.js
- +1 −2 lib/internal/main/worker_thread.js
- +1 −8 lib/internal/modules/cjs/loader.js
- +1 −1 lib/internal/stream_base_commons.js
- +1 −7 lib/internal/timers.js
- +17 −1 lib/internal/util/debuglog.js
- +1 −8 lib/internal/worker.js
- +1 −8 lib/internal/worker/io.js
- +1 −8 lib/timers.js
0 comments on commit
2e4ceb5