Don't search for multiple Unicode extension sequences in a single language tag

RESOLVED FIXED in Firefox 56

Status

()

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: anba, Assigned: anba)

Tracking

Trunk
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

a year ago
Language tags cannot contain duplicate singletons, so don't need to search for multiple Unicode extension sequences in removeUnicodeExtensions().
(Assignee)

Comment 1

a year ago
Created attachment 8888305 [details] [diff] [review]
bug1382656.patch

When validating a language tag, we ensure that the language tag doesn't contain multiple singletons [1]. And given that a Unicode extension sequence is a singleton, we don't need to search for multiple Unicode extension sequences in the removeUnicodeExtensions() function. And we also don't need to reset |unicodeLocaleExtensionSequenceRE.lastIndex| to zero, because unicodeLocaleExtensionSequenceRE hasn't the global RegExp flag set.


[1] http://searchfox.org/mozilla-central/rev/3a3af33f513071ea829debdfbc628caebcdf6996/js/src/builtin/Intl.js#340,342
Attachment #8888305 - Flags: review?(till)
Comment on attachment 8888305 [details] [diff] [review]
bug1382656.patch

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

r=me
Attachment #8888305 - Flags: review?(till) → review+
(Assignee)

Comment 3

a year ago
(In reply to Till Schneidereit [:till] from comment #2)
> Comment on attachment 8888305 [details] [diff] [review]
> bug1382656.patch
> 
> Review of attachment 8888305 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> r=me

Thanks for the super-fast review! (TBH I didn't expect to get such a quick review given that Unicode extension sequences in language tags is a rather niche topic. :-)

Comment 5

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/820435b85836
Don't search for multiple Unicode extension sequences in a single language tag. r=till
Keywords: checkin-needed

Comment 6

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/820435b85836
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.