mirror of
https://github.com/tc39/test262.git
synced 2025-07-30 17:34:51 +02:00
Improve assertion handling when comparison causes failure via coercion
This commit is contained in:
parent
f247a5fe09
commit
ee3715ee56
@ -27,7 +27,12 @@ assert._isSameValue = function (a, b) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert.sameValue = function (actual, expected, message) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user