Skip to content

Commit

Permalink
fix(assert): let assertStrictEquals(-0, +0) pass (#4714)
Browse files Browse the repository at this point in the history
  • Loading branch information
rherrmann committed May 11, 2024
1 parent 6deab72 commit b992aa9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assert/assert_strict_equals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function assertStrictEquals<T>(
expected: T,
msg?: string,
): asserts actual is T {
if (Object.is(actual, expected)) {
if (Object.is(actual, expected) || actual === expected) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions assert/assert_strict_equals_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Deno.test({
assertStrictEquals(10, 10);
assertStrictEquals("abc", "abc");
assertStrictEquals(NaN, NaN);
assertStrictEquals(+0, -0);

const xs = [1, false, "foo"];
const ys = xs;
Expand Down

0 comments on commit b992aa9

Please sign in to comment.