Closed Bug 1617586 Opened 5 years ago Closed 5 years ago

ToInteger normalizes -0 to +0

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: yulia, Assigned: anba)

Details

Attachments

(3 files)

As discussed in: (https://github.com/tc39/ecma262/pull/1827

change ToInteger(-0) to return +0 instead of -0, because in all but one case, the result of ToInteger(-0) is either explicitly or implicitly changed from -0 to +0 anyway.

André -- if this is already done, please feel free to close this.

Flags: needinfo?(andrebargull)

This isn't yet (completely) done. I already have a patch, but didn't yet found the time to request review for it.

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Flags: needinfo?(andrebargull)

Changes ToInteger to return +0 instead of -0 and updates two callers which were
already performing the -0 to +0 conversion. Also changes NumberIsInt32 to
NumberEqualsInt32 in atomics_isLockFree, because we no longer need to care
about handling -0 in this function.

More or less undo bug 1383436 - part 4, now that ToInteger matches
ToIntegerPositiveZero.

Depends on D64027

Use C++11's trunc() function instead of manually branching for negative values.

Depends on D64028

Priority: -- → P2
Pushed by nerli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/43a19073c67f Part 1: Don't return -0 from ToInteger. r=jwalden https://hg.mozilla.org/integration/autoland/rev/251650c4e157 Part 2: Rename ToIntegerPositiveZero to ToInteger. r=jwalden https://hg.mozilla.org/integration/autoland/rev/bd1e456b48ac Part 3: Use trunc instead of branching to use either floor or ceil. r=jwalden
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: