Skip to content

util: adhere to `noDeprecation` set at runtime

Checklist
  • tests and code linting passes
  • a test and/or benchmark is included
  • documentation is changed or added
  • the commit message follows commit guidelines
Affected core subsystem(s)

process (util?)

Description of change

Until now, the docs stated that process.noDeprecation could be set at runtime, but before any modules were loaded. That was not true, because lib/internal/util.js was loaded during the process startup process, so setting the flag at runtime was always pointless.

Minimal test case:

process.noDeprecation = true;
process.EventEmitter;

This patch moves checking process.noDeprecation to the place where it was actually used.

/cc @jasnell

CI: https://ci.nodejs.org/job/node-test-commit/3263/

Merge request reports

Loading