aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlarissayvette <larissayvette55@gmail.com>2017-02-21 17:43:26 +0100
committerRich Trott <rtrott@gmail.com>2017-05-06 15:54:26 -0700
commit1c834e78ff4b1b194c07e27a479a76e6ead301ae (patch)
treeb5bc943063588222b4c75903a28d646b8e18acd3 /lib
parentd74a545535868380b028c27dfcdf54e2d5f7c563 (diff)
downloadandroid-node-v8-1c834e78ff4b1b194c07e27a479a76e6ead301ae.tar.gz
android-node-v8-1c834e78ff4b1b194c07e27a479a76e6ead301ae.tar.bz2
android-node-v8-1c834e78ff4b1b194c07e27a479a76e6ead301ae.zip
errors,test: migrating error to internal/errors
PR-URL: https://github.com/nodejs/node/pull/11505 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/assert.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/assert.js b/lib/assert.js
index 64b02edb57..28eb2fcf20 100644
--- a/lib/assert.js
+++ b/lib/assert.js
@@ -513,7 +513,9 @@ function _throws(shouldThrow, block, expected, message) {
var actual;
if (typeof block !== 'function') {
- throw new TypeError('"block" argument must be a function');
+ const errors = lazyErrors();
+ throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'block', 'function',
+ typeof block);
}
if (typeof expected === 'string') {