Closed Bug 1401148 Opened 4 years ago Closed 4 years ago

Same Unicode extension sequence keyword values misreported as duplicate variants

Categories

(Core :: JavaScript: Internationalization API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

STR:
---
Intl.Collator("de-u-kn-false-kf-false")
---

Expected: Creates a collator with numeric=false and caseFirst=false
Actual: Throws a RangeError
Attached patch bug1401148.patchSplinter Review
The RegExp to detect duplicate variants was missing an anchor to start matching at the start of the string.
Attachment #8909737 - Flags: review?(gandalf)
Comment on attachment 8909737 [details] [diff] [review]
bug1401148.patch

So... that's why Igalia people thought we don't support caseFirst... :)
Attachment #8909737 - Flags: review?(gandalf) → review+
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #2)
> Comment on attachment 8909737 [details] [diff] [review]
> bug1401148.patch
> 
> So... that's why Igalia people thought we don't support caseFirst... :)

Only using "kf", like in Intl.Collator("de-u-kf-false"), actually already works without the patch, it's just having "false" in two Unicode extension keywords which triggered a RangeError. Maybe they were testing on an old Firefox version, we only added caseFirst support in Firefox 55 (bug 866473). :-)
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c07a2daeb744
Don't count duplicate extension sequence values as variants in BCP49 language tags. r=gandalf
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c07a2daeb744
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.