Closed Bug 1319464 Opened 5 years ago Closed 5 years ago

Replace flattened strings with linear strings in Intl.cpp


(Core :: JavaScript: Internationalization API, defect)

Not set



Tracking Status
firefox53 --- fixed


(Reporter: anba, Assigned: anba)



(1 file, 1 obsolete file)

Attached patch bug1319464.patch (obsolete) — Splinter Review
We're already explicitly passing uCurrency's length to unum_setTextAttribute, so we don't need to null-terminate uCurrency.

Time zone lookups:
Again no null-termination required because we're always passing the string's length (HashStringIgnoreCaseASCII, EqualCharsIgnoreCaseASCII).

I've changed this method so it matches the normal ICU call pattern. As a side-effect the null-termination is no longer required.

Also changed to the normal ICU call pattern, so we no longer need to null-terminate the strings.

I've also replaced some "int" with "int32_t" and added assertions for consistency with other calls to ICU functions.
Attachment #8813309 - Flags: review?(jwalden+bmo)
Attachment #8813309 - Flags: review?(jwalden+bmo) → review+
Pushed by
Replace flattened with linear strings in Intl.cpp file. r=Waldo
Keywords: checkin-needed
Also backed out (in addition to bug 1319465) for failures in Intl.h in Sm-tc(nu):

Push with failure:
Failure log:

[task 2016-11-23T16:02:36.957660Z] In file included from /home/worker/workspace/build/src/js/src/builtin/Intl.cpp:12:0:
[task 2016-11-23T16:02:36.957731Z] /home/worker/workspace/build/src/js/src/builtin/Intl.h:85:43: error: expected ')' before '*' token
[task 2016-11-23T16:02:36.957756Z]              explicit Lookup(JSLinearString* timeZone);
[task 2016-11-23T16:02:36.957788Z]                                            ^
[task 2016-11-23T16:02:38.971359Z] /home/worker/workspace/build/src/js/src/builtin/Intl.cpp:2045:1: error: prototype for 'js::SharedIntlData::TimeZoneHasher::Lookup::Lookup(JSLinearString*)' does not match any in class 'js::SharedIntlData::TimeZoneHasher::Lookup'
[task 2016-11-23T16:02:38.971428Z]  js::SharedIntlData::TimeZoneHasher::Lookup::Lookup(JSLinearString* timeZone)
[task 2016-11-23T16:02:38.971442Z]  ^
[task 2016-11-23T16:02:38.971473Z] In file included from /home/worker/workspace/build/src/js/src/builtin/Intl.cpp:12:0:
[task 2016-11-23T16:02:38.971542Z] /home/worker/workspace/build/src/js/src/builtin/Intl.h:74:16: error: candidates are: constexpr js::SharedIntlData::TimeZoneHasher::Lookup::Lookup(js::SharedIntlData::TimeZoneHasher::Lookup&&)
[task 2016-11-23T16:02:38.971566Z]          struct Lookup
[task 2016-11-23T16:02:38.971584Z]                 ^
[task 2016-11-23T16:02:38.971633Z] /home/worker/workspace/build/src/js/src/builtin/Intl.h:74:16: error:                 constexpr js::SharedIntlData::TimeZoneHasher::Lookup::Lookup(const js::SharedIntlData::TimeZoneHasher::Lookup&)
[task 2016-11-23T16:02:38.971686Z] /home/worker/workspace/build/src/js/src/builtin/Intl.h:74:16: error:                 js::SharedIntlData::TimeZoneHasher::Lookup::Lookup()
[task 2016-11-23T16:02:38.971746Z] /home/worker/workspace/build/src/js/src/builtin/Intl.h:72:12: error: 'struct js::SharedIntlData::TimeZoneHasher' is private
[task 2016-11-23T16:02:38.971775Z]      struct TimeZoneHasher
[task 2016-11-23T16:02:38.971797Z]             ^
Flags: needinfo?(andrebargull)
Looks like a missing include for vm/String.h.
Flags: needinfo?(andrebargull)
Backout by
Backed out changeset 7251919f6a23 to fix Sm-Tc(nu). r=backout
Attached patch bug1319464.patchSplinter Review
Added forward declaration to fix non-unified build bustage. Carrying r+ from Waldo.
Attachment #8813309 - Attachment is obsolete: true
Attachment #8813795 - Flags: review+
Pushed by
Replace flattened with linear strings in Intl.cpp file. r=Waldo
Keywords: checkin-needed
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.