0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib
Joyee Cheung 2e4ceb5747
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: https://github.com/nodejs/node/pull/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>
2019-04-20 00:30:38 +08:00
..
internal util: access process states lazily in debuglog 2019-04-20 00:30:38 +08:00
_http_agent.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_http_client.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_http_common.js lib: require globals instead of using the global proxy 2019-04-16 04:24:26 +08:00
_http_incoming.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_http_outgoing.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_http_server.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_stream_duplex.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_stream_passthrough.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_stream_readable.js util: access process states lazily in debuglog 2019-04-20 00:30:38 +08:00
_stream_transform.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_stream_wrap.js lib: assign missed deprecation code 2019-03-07 15:48:55 +01:00
_stream_writable.js stream: inline onwriteStateUpdate() 2019-04-16 05:35:26 +02:00
_tls_common.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
_tls_wrap.js lib: require globals instead of using the global proxy 2019-04-16 04:24:26 +08:00
.eslintrc.yaml lib: require globals instead of using the global proxy 2019-04-16 04:24:26 +08:00
assert.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
async_hooks.js async_hooks: improve AsyncResource performance 2019-04-05 05:37:01 +02:00
buffer.js buffer: use stricter range checks 2019-04-15 17:21:34 +02:00
child_process.js child_process: change the defaults maxBuffer size 2019-04-17 14:05:15 -07:00
cluster.js
console.js console: split console into global.js and constructor.js 2018-12-02 04:51:18 +08:00
constants.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
crypto.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
dgram.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
dns.js dns: do not indicate invalid IPs are IPv6 2019-04-16 16:19:17 -07:00
domain.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
events.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
fs.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
http2.js http2: order declarations in http2.js 2018-11-20 10:42:31 -08:00
http.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
https.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
inspector.js errors: add more information in case of invalid callbacks 2019-04-04 12:51:03 +02:00
module.js lib: add back lib/module.js redirection 2018-03-15 20:50:35 +08:00
net.js lib: require globals instead of using the global proxy 2019-04-16 04:24:26 +08:00
os.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
path.js path: simplify normalizeString 2019-04-18 05:32:10 +02:00
perf_hooks.js lib: require globals instead of using the global proxy 2019-04-16 04:24:26 +08:00
process.js
punycode.js lib: update punycode to 2.1.1 2018-07-16 15:55:15 -07:00
querystring.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
readline.js lib: require globals instead of using the global proxy 2019-04-16 04:24:26 +08:00
repl.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
stream.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
string_decoder.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
sys.js benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
timers.js util: access process states lazily in debuglog 2019-04-20 00:30:38 +08:00
tls.js benchmark,lib: change var to const 2019-03-30 13:16:39 +01:00
trace_events.js trace_events: remove usage of require('util') 2019-03-24 18:28:07 +08:00
tty.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
url.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
util.js lib: require globals instead of using the global proxy 2019-04-16 04:24:26 +08:00
v8.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00
vm.js lib: use safe methods from primordials 2019-04-08 11:23:09 +02:00
worker_threads.js worker: use copy of process.env 2019-03-30 22:25:35 +01:00
zlib.js lib: enforce the use of Object from primordials 2019-04-12 05:38:45 +02:00