Skip to content

Commit 64745c3

Browse files
committed
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. PR-URL: nodejs#25956 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
1 parent 7182aca commit 64745c3

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

lib/assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const { codes: {
2727
ERR_INVALID_ARG_VALUE,
2828
ERR_INVALID_RETURN_VALUE
2929
} } = require('internal/errors');
30-
const { AssertionError } = require('internal/assert');
30+
const AssertionError = require('internal/assert/assertion_error');
3131
const { openSync, closeSync, readSync } = require('fs');
3232
const { inspect, types: { isPromise, isRegExp } } = require('util');
3333
const { EOL } = require('internal/constants');
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,4 @@ class AssertionError extends Error {
405405
}
406406
}
407407

408-
module.exports = {
409-
AssertionError
410-
};
408+
module.exports = AssertionError;

node.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
'lib/vm.js',
8686
'lib/worker_threads.js',
8787
'lib/zlib.js',
88-
'lib/internal/assert.js',
88+
'lib/internal/assert/assertion_error.js',
8989
'lib/internal/async_hooks.js',
9090
'lib/internal/buffer.js',
9191
'lib/internal/cli_table.js',

0 commit comments

Comments
 (0)