From a0c705ef799b06b207d4906030cb6efa589e4487 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 22 Feb 2017 13:49:52 -0800 Subject: [PATCH] assert: apply minor refactoring * Remove comment referring to the CommonJS Unit Testing 1.0 spec. This module is no longer intended to comply with that spec. * Remove puzzling "THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!" comment. No doubt, it made sense at one time. * Favor `===` over `==` in two places. PR-URL: https://github.com/nodejs/node/pull/11511 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Sam Roberts Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca --- lib/assert.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/assert.js b/lib/assert.js index 1dc6e16a13271f..c08f26986431bb 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -1,7 +1,3 @@ -// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 -// -// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! -// // Originally from narwhal.js (http://narwhaljs.org) // Copyright (c) 2009 Thomas Robinson <280north.com> // @@ -214,7 +210,7 @@ function _deepEqual(actual, expected, strict, memos) { } function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; + return Object.prototype.toString.call(object) === '[object Arguments]'; } function objEquiv(a, b, strict, actualVisitedObjects) { @@ -299,7 +295,7 @@ function expectedException(actual, expected) { return false; } - if (Object.prototype.toString.call(expected) == '[object RegExp]') { + if (Object.prototype.toString.call(expected) === '[object RegExp]') { return expected.test(actual); }