Closed Bug 1973243 Opened 9 months ago Closed 7 months ago

Canonicalize key in Map.prototype.getOrInsertComputed

Categories

(Core :: JavaScript: Standard Library, defect, P3)

defect

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: dminor, Assigned: dminor)

References

Details

Attachments

(2 files)

See this new test, https://github.com/tc39/test262/pull/4522/files, we're not passing the canonicalized key as the argument to Map.prototype.getOrInsertComputed.

Looking at the implementation it looks like the key is never being canonicalized. The existing tests pass because the calls to has and get will do right thing in their implementations.

Canonicalization is defined in the spec here. This should be a matter of adding something like:

if (key === -0) {
  key = 0;
}

This is a good first bug, the main complexity will be getting the SpiderMonkey build working.

Doing key += +0.0; is likely the more efficient way of doing this.

Severity: -- → S3
Priority: -- → P3
Assignee: nobody → dminor
Status: NEW → ASSIGNED
Mentor: dminor
Keywords: good-first-bug
Blocks: 1979917
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
QA Whiteboard: [qa-triage-done-c145/b144]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: