Closed
Bug 1973243
Opened 9 months ago
Closed 7 months ago
Canonicalize key in Map.prototype.getOrInsertComputed
Categories
(Core :: JavaScript: Standard Library, defect, P3)
Core
JavaScript: Standard Library
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.
- Make sure you can build SpiderMonkey. You can find instructions on building here: https://firefox-source-docs.mozilla.org/js/build.html.
- Import the new test. This is a little complicated, but you can find instructions here: https://searchfox.org/mozilla-central/source/js/src/tests/README.txt#32. In this case, you don't need to file a new bug, but please do make a separate commit for updating the tests. Your commit message should look like: Bug X - Update test262; r=dminor!, where X is the number for this bug.
- Run the tests. Make sure the new test is failing :)
- Now make the fix, and check that the test passes. Make a separate commit for your fix. Your commit message should look like: Bug X - Canonicalize key in Map.prototype.getOrInsertComputed; r=dminor!, where X is the number for this bug.
- Once you have your changes committed, request review. There are instructions here: https://firefox-source-docs.mozilla.org/setup/contributing_code.html#getting-your-code-reviewed
| Assignee | ||
Comment 1•9 months ago
|
||
Doing key += +0.0; is likely the more efficient way of doing this.
Updated•9 months ago
|
Severity: -- → S3
Priority: -- → P3
| Assignee | ||
Updated•7 months ago
|
Assignee: nobody → dminor
Status: NEW → ASSIGNED
| Assignee | ||
Comment 2•7 months ago
|
||
| Assignee | ||
Comment 3•7 months ago
|
||
| Assignee | ||
Updated•7 months ago
|
Mentor: dminor
Keywords: good-first-bug
Pushed by dminor@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/1fbda06ba3d1
https://hg.mozilla.org/integration/autoland/rev/61120b58cefb
Update test262 from upstream; r=spidermonkey-reviewers,bthrall
https://github.com/mozilla-firefox/firefox/commit/3a197130bc00
https://hg.mozilla.org/integration/autoland/rev/ae12de45b44b
Canonicalize key in MapGetOrInsertComputed; r=spidermonkey-reviewers,bthrall
Comment 5•7 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/61120b58cefb
https://hg.mozilla.org/mozilla-central/rev/ae12de45b44b
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
status-firefox144:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
Updated•7 months ago
|
QA Whiteboard: [qa-triage-done-c145/b144]
You need to log in
before you can comment on or make changes to this bug.
Description
•