Closed Bug 1382656 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: JavaScript: Internationalization API, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

Language tags cannot contain duplicate singletons, so don't need to search for multiple Unicode extension sequences in removeUnicodeExtensions().
Attached patch bug1382656.patchSplinter Review
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+
(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. :-)
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
https://hg.mozilla.org/mozilla-central/rev/820435b85836
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.