denoland / denoland/std

Should `bidirectionalMap.set(-0, -0).entries().next().value` be `[0, -0]` (current behavior) or `[0, 0]`?

Open
#6,753 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

Should `bidirectionalMap.set(-0, -0).entries().next().value` give `[0, -0]` (the current behavior) or `[0, 0]`?

Assuming `BidirectionalMap` is supposed to be "symmetrical" and that `values()` can logically be understood as getting the keys of the internal reverse-map, presumably `-0` values should be normalized to `0` upon setting, as `-0` can't exist as a key due to [`CanonicalizeKeyedCollectionKey`](https://tc39.es/ecma262/multipage/keyed-collections.html#sec-canonicalizekeyedcollectionkey).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.