summaryrefslogtreecommitdiff
path: root/lib/assert.js
diff options
context:
space:
mode:
authorZYSzys <zyszys98@gmail.com>2019-10-04 00:35:41 +0800
committerRich Trott <rtrott@gmail.com>2019-10-05 13:59:32 -0700
commit739f113ba63367a93e1567032d85573a079b97b5 (patch)
treefcb0a5be64a307f530024d0a192ec97580971cc5 /lib/assert.js
parentf0bee9b490e55ae93da1d1f8a485a4a432e61575 (diff)
downloadandroid-node-v8-739f113ba63367a93e1567032d85573a079b97b5.tar.gz
android-node-v8-739f113ba63367a93e1567032d85573a079b97b5.tar.bz2
android-node-v8-739f113ba63367a93e1567032d85573a079b97b5.zip
lib: introduce no-mixed-operators eslint rule to lib
PR-URL: https://github.com/nodejs/node/pull/29834 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'lib/assert.js')
-rw-r--r--lib/assert.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/assert.js b/lib/assert.js
index 5f9a39abf0..a83dba770e 100644
--- a/lib/assert.js
+++ b/lib/assert.js
@@ -622,7 +622,7 @@ function expectedException(actual, expected, message, fn) {
message = 'The error is expected to be an instance of ' +
`"${expected.name}". Received `;
if (isError(actual)) {
- const name = actual.constructor && actual.constructor.name ||
+ const name = (actual.constructor && actual.constructor.name) ||
actual.name;
if (expected.name === name) {
message += 'an error with identical name but a different prototype.';
@@ -685,9 +685,9 @@ function checkIsPromise(obj) {
// way. Do not accept thenables that use a function as `obj` and that have no
// `catch` handler.
return isPromise(obj) ||
- obj !== null && typeof obj === 'object' &&
+ (obj !== null && typeof obj === 'object' &&
typeof obj.then === 'function' &&
- typeof obj.catch === 'function';
+ typeof obj.catch === 'function');
}
async function waitForActual(promiseFn) {