Closed Bug 1651815 Opened 5 years ago Closed 5 years ago

Stop using CallNonGenericMethod for Date methods

Categories

(Core :: JavaScript: Standard Library, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: evilpies, Assigned: evilpies)

References

(Blocks 2 open bugs)

Details

Attachments

(7 files)

Similar to Bug 1651445 we should stop using CallNonGenericMethod here as well.

Compared to the Number functions this a bit more hairy, because we can't just operate on a double.
I think this is still fine, because all uses of the unwrapped Date object are extremely simple and only read/write slots on the NativeObject. We do have unwrapped object roots on the stack across gc-able calls, but from my understanding that is not actually a problem.
I consistently used unwrapped instead of dateObj or something similar to call attention to this potential footgun.

This review isn't urgent, I am going to be away.

Assignee: nobody → evilpies
Status: NEW → ASSIGNED

The spec says that toGMTString is the same function as toUTCString.
This was already the case Date.prototype.toGMTString == "toUTCString",
but the error message and naming was still wrong.

Depends on D82996

Depends on D82999

Severity: -- → N/A
Priority: -- → P2
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/18b15d2d5aae Stop using CallNonGenericMethod for Date get methods. r=anba https://hg.mozilla.org/integration/autoland/rev/a649aaf2bb79 Stop using CallNonGenericMethod for Date toString methods. r=anba https://hg.mozilla.org/integration/autoland/rev/18f9e72363dc Split up getMilliseconds and getUTCMilliseconds to get better error messages. r=anba https://hg.mozilla.org/integration/autoland/rev/55492e3dce5c Make toUTCString the default. r=anba https://hg.mozilla.org/integration/autoland/rev/9f4d1cf2f576 Implement ThisTimeValue for self-hosted Date methods. r=anba https://hg.mozilla.org/integration/autoland/rev/d4dbc509ead5 Stop using CallNonGenericMethod for Date set methods. r=anba https://hg.mozilla.org/integration/autoland/rev/aa80b7de92df Test. r=anba
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: