Closed Bug 1289934 Opened 8 years ago Closed 8 years ago

Minor Intl code-fixes

Categories

(Core :: JavaScript: Internationalization API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

Attachments

(2 files)

Some little things noticed looking at the code with gandalf today.  Shouldn't require any deep ICU knowledge to understand.
First up, convert a runtime deleter-function into a compile-time template parameter.

We could also use UniquePtr here, but UniquePtr also requires a deleter function be a runtime-provided thing, like the existing class here does.
Attachment #8775356 - Flags: review?(sphink)
It happens that both these issues are only theoretical.  ucal_getType fails only if ucal_open failed, right now, in our in-tree ICU.  And ucal_getType only returns statically-allocated strings, in in-tree ICU.  But better to eliminate risk that this could change in the future.
Attachment #8775358 - Flags: review?(sphink)
Attachment #8775356 - Flags: review?(sphink) → review+
Attachment #8775358 - Flags: review?(sphink) → review+
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c39c56bc1833
Simplify ScopedICUObject to store deleter function as a template parameter, not as a runtime variable.  r=sfink
https://hg.mozilla.org/integration/mozilla-inbound/rev/2251dbd1b3c8
Implement more-correct error handling if ucal_getType fails.  (It can't with current ICU, at least our in-tree copy.  But best be safe for the future.)  Also don't assume ucal_getType's return value on success outlives the corresponding UCalendar*.  (Again, no problem with current ICU, still worth fixing.)  r=sfink
https://hg.mozilla.org/mozilla-central/rev/c39c56bc1833
https://hg.mozilla.org/mozilla-central/rev/2251dbd1b3c8
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: