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: https://github.com/nodejs/node/pull/25956 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
This commit is contained in:
parent
7182aca108
commit
64745c3ade
@ -27,7 +27,7 @@ const { codes: {
|
|||||||
ERR_INVALID_ARG_VALUE,
|
ERR_INVALID_ARG_VALUE,
|
||||||
ERR_INVALID_RETURN_VALUE
|
ERR_INVALID_RETURN_VALUE
|
||||||
} } = require('internal/errors');
|
} } = require('internal/errors');
|
||||||
const { AssertionError } = require('internal/assert');
|
const AssertionError = require('internal/assert/assertion_error');
|
||||||
const { openSync, closeSync, readSync } = require('fs');
|
const { openSync, closeSync, readSync } = require('fs');
|
||||||
const { inspect, types: { isPromise, isRegExp } } = require('util');
|
const { inspect, types: { isPromise, isRegExp } } = require('util');
|
||||||
const { EOL } = require('internal/constants');
|
const { EOL } = require('internal/constants');
|
||||||
|
@ -405,6 +405,4 @@ class AssertionError extends Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = AssertionError;
|
||||||
AssertionError
|
|
||||||
};
|
|
2
node.gyp
2
node.gyp
@ -85,7 +85,7 @@
|
|||||||
'lib/vm.js',
|
'lib/vm.js',
|
||||||
'lib/worker_threads.js',
|
'lib/worker_threads.js',
|
||||||
'lib/zlib.js',
|
'lib/zlib.js',
|
||||||
'lib/internal/assert.js',
|
'lib/internal/assert/assertion_error.js',
|
||||||
'lib/internal/async_hooks.js',
|
'lib/internal/async_hooks.js',
|
||||||
'lib/internal/buffer.js',
|
'lib/internal/buffer.js',
|
||||||
'lib/internal/cli_table.js',
|
'lib/internal/cli_table.js',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user