Skip to content

util: runtime deprecation for util._extend()

The util._extend() method was previously docs-only deprecated in Node.js 6.0.0. This PR moves the implementation of _extend() into internal/util and runtime-deprecates the util._extend() as the next step in the deprecation process.

(Note: I'm not necessarily advocating that we definitely should runtime deprecate this, only that this is the next logical step in the deprecation process if we want to discourage users from using it).

The PR also adds a new benchmark comparing util._extend() and Object.assign(). The benchmark shows that util._extend() is still currently significantly faster than Object.assign() so we don't want to yet switch our own internal uses.

For background, util._extend() was never intended to be a public API but users found it anyway and used it.

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

util

Merge request reports

Loading