Skip to content

process: add the optional `once` to `emitWarning`

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

process

Description of change

Improves the method process.emitWarning() to simplify the avoiding duplicate warnings.

This also introduces a new property warnings on the process object.

What's the reason to this pull-request? Recently I did find some pull-requests which hard-deprecates functions which always needs another variable to avoid duplicating warnings as https://nodejs.org/dist/latest-v6.x/docs/api/process.html#process_avoiding_duplicate_warnings. This patch simplifies the above progress.

If this change is acceptable widely, I'm also able to gonna update relevant calls in other modules.

Merge request reports

Loading