diff options
author | Rich Trott <rtrott@gmail.com> | 2019-02-05 20:46:35 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-02-08 00:01:07 -0800 |
commit | 64745c3ade8bad694fffba06736b461ab9a05a1d (patch) | |
tree | 1f23c20e23b5dceb97eec9cf8b9016201ce6d8e7 /lib | |
parent | 7182aca108fac7a7e464e9450461975e6ef4a4e3 (diff) | |
download | android-node-v8-64745c3ade8bad694fffba06736b461ab9a05a1d.tar.gz android-node-v8-64745c3ade8bad694fffba06736b461ab9a05a1d.tar.bz2 android-node-v8-64745c3ade8bad694fffba06736b461ab9a05a1d.zip |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/assert.js | 2 | ||||
-rw-r--r-- | lib/internal/assert/assertion_error.js (renamed from lib/internal/assert.js) | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/assert.js b/lib/assert.js index 6963ef4130..a37329caf2 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -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'); diff --git a/lib/internal/assert.js b/lib/internal/assert/assertion_error.js index 4e059db6b9..a13a610da1 100644 --- a/lib/internal/assert.js +++ b/lib/internal/assert/assertion_error.js @@ -405,6 +405,4 @@ class AssertionError extends Error { } } -module.exports = { - AssertionError -}; +module.exports = AssertionError; |