Skip to content

assert: make a small internal assert module for built-in use

First commit:

assert: refactor internal assert.js

Move lib/internal/assert.js to lib/internal/assert/assertion_error.js.
This is in preparation for making lib/internal/assert.js a tiny module
for use in Node.js built-ins so that we can use `assert()` without
having to load the entire ~1200 line `assert` module.

Second commit:

assert: create internal/assert micro-module

For use in built-in modules that could benefit from `assert()` without
having to load the entire module (unless an AssertionError actually
occurs): lib/internal/assert.js.

Third commit:

lib: replace 'assert' with 'internal/assert' for many built-ins

Replace large 'assert' module with tiny 'internal/assert' module for
many built-in uses.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading