Skip to content

Commit

Permalink
assert: refactor internal assert.js
Browse files Browse the repository at this point in the history
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: #25956
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
  • Loading branch information
Trott authored and addaleax committed Feb 8, 2019
1 parent 55a313b commit 37d207c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const { codes: {
ERR_INVALID_ARG_VALUE,
ERR_INVALID_RETURN_VALUE
} } = require('internal/errors');
const { AssertionError } = require('internal/assert');
const AssertionError = require('internal/assert/assertion_error');
const { openSync, closeSync, readSync } = require('fs');
const { inspect, types: { isPromise, isRegExp } } = require('util');
const { EOL } = require('internal/constants');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,4 @@ class AssertionError extends Error {
}
}

module.exports = {
AssertionError
};
module.exports = AssertionError;
2 changes: 1 addition & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
'lib/vm.js',
'lib/worker_threads.js',
'lib/zlib.js',
'lib/internal/assert.js',
'lib/internal/assert/assertion_error.js',
'lib/internal/async_hooks.js',
'lib/internal/bash_completion.js',
'lib/internal/buffer.js',
Expand Down

0 comments on commit 37d207c

Please sign in to comment.