Defer initialization of Intl prototypes until called as Intl object instances

RESOLVED INVALID

Status

()

defect
RESOLVED INVALID
2 years ago
2 years ago

People

(Reporter: anba, Assigned: anba)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox53 affected)

Details

Attachments

(1 attachment)

Assignee

Description

2 years ago
As explained in bug 1314354, comment #10. This depends on bug 1328386.
Assignee

Comment 1

2 years ago
Attachment #8827422 - Flags: review?(jwalden+bmo)
Comment on attachment 8827422 [details] [diff] [review]
bug1331474.patch

Review of attachment 8827422 [details] [diff] [review]:
-----------------------------------------------------------------

Ugh.  Why don't we try getting the spec changed to make these plain objects, rather than deferring logic and violating the spec?
Attachment #8827422 - Flags: review?(jwalden+bmo)
Incidentally, just hacking LoginMumble.jsm is more and more looking like probably the fastest bandaid, and we can do the spec stuff with somewhat more leisure than trying to just shoehorn in something without experience in the field to say it's good.
Assignee

Comment 4

2 years ago
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #2)
> Ugh.  Why don't we try getting the spec changed to make these plain objects,
> rather than deferring logic and violating the spec?

As mentioned in the other bug, we may already violate the Intl spec due the lazy initialization of the Intl object itself. The main spec doesn't even specify whether or not LocalTZA can change at runtime [1]. :-/

[1] https://tc39.github.io/ecma262/#sec-local-time-zone-adjustment

Later: I was worried user code might call "Intl.DateTimeFormat.prototype.resolvedOptions()" to get the default options (same for Intl.NumberFormat.prototype and Intl.Collator.prototype), which could result in web-compat issues when we try to change the Intl prototype objects to be no longer Intl object instances. But then I found out that Chrome/V8 already treats the prototype objects as plain objects instead of Intl object instances. So changing the spec seems to be feasible! \o/
Assignee

Comment 5

2 years ago
Filed bug 1332604 for the Intl prototype change.
Assignee

Comment 6

2 years ago
Superseded by bug 1332604.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INVALID
No longer depends on: 1328386
You need to log in before you can comment on or make changes to this bug.