Closed Bug 1446051 Opened 7 years ago Closed 7 years ago

Use CallICU for str_normalize

Categories

(Core :: JavaScript: Standard Library, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Priority: -- → P3
Attached patch bug1446051.patch (obsolete) — Splinter Review
Use |intl::CallICU| for str_normalize, so we don't need to handle |U_BUFFER_OVERFLOW_ERROR| manually in str_normalize. I've moved |remainingStart| and |remainingLength| into the lambda, because otherwise the capture list gets too large and can no longer be properly formatted.
Attachment #8959223 - Flags: review?(jwalden+bmo)
...we have proper formatting for lambdas, particularly those with lengthy capture lists?
Comment on attachment 8959223 [details] [diff] [review] bug1446051.patch Review of attachment 8959223 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/builtin/String.cpp @@ +1644,5 @@ > + intl::CallICU(cx, [normalizer, &srcChars, spanLength](UChar* chars, uint32_t size, > + UErrorCode* status) > + { > + mozilla::RangedPtr<const char16_t> remainingStart = srcChars.begin() + spanLength; > + size_t remainingLength = srcChars.length() - size_t(spanLength); All these size_t(spanLength) in this function overall are a bit silly. We probably should get a size_t local going after we've passed the unorm2_spanQuickCheckYes status-check. Maybe in a followup patch, rs=me on that if you want.
Attachment #8959223 - Flags: review?(jwalden+bmo) → review+
(In reply to Jeff Walden [:Waldo] from comment #3) > All these size_t(spanLength) in this function overall are a bit silly. We > probably should get a size_t local going after we've passed the > unorm2_spanQuickCheckYes status-check. Maybe in a followup patch, rs=me on > that if you want. I'll need to update intl::CallICU() for this patch, because I forgot that intl::CallICU() asserts that the input chars-vector is empty. And as part of that update, I'll also add a local variable for size_t(spanLength).
Attached patch bug1446051.patchSplinter Review
Updated patch to change |intl::CallICU()| assertions to allow non-empty chars-vector. Tentatively carrying r+.
Attachment #8959223 - Attachment is obsolete: true
Attachment #8960193 - Flags: review+
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/2356a4fada56 Use CallICU helper for str_normalize. r=Waldo
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: