Improve assertion handling when comparison causes failure via coercion

This commit is contained in:
Rick Waldron 2018-10-23 17:25:58 -04:00
parent f247a5fe09
commit ee3715ee56

View File

@ -27,7 +27,12 @@ assert._isSameValue = function (a, b) {
};
assert.sameValue = function (actual, expected, message) {
if (assert._isSameValue(actual, expected)) {
try {
if (assert._isSameValue(actual, expected)) {
return;
}
} catch (error) {
$ERROR(message + ' (_isSameValue operation threw) ' + error);
return;
}