RESOLVED FIXED 149807
[Intl] Change the return type of canonicalizeLocaleList() from JSArray* to Vector<String>
https://bugs.webkit.org/show_bug.cgi?id=149807
Summary [Intl] Change the return type of canonicalizeLocaleList() from JSArray* to Ve...
Sukolsak Sakshuwong
Reported 2015-10-05 08:18:11 PDT
From ECMA-402, 9.2.1, the abstract operation CanonicalizeLocaleList returns a List of Strings. From the spec, we never modify the result from CanonicalizeLocaleList(). We never expose it to the user either. This patch changes the return type of canonicalizeLocaleList() from JSArray* to Vector<String>. This should ease the workload of the GC and make the code a bit easier to read. http://www.ecma-international.org/ecma-402/1.0/ECMA-402.pdf
Attachments
Patch (11.97 KB, patch)
2015-10-05 08:26 PDT, Sukolsak Sakshuwong
no flags
Use the LHS Vector<String> instead of const Vector<String>& (11.95 KB, patch)
2015-10-05 15:05 PDT, Sukolsak Sakshuwong
no flags
Sukolsak Sakshuwong
Comment 1 2015-10-05 08:26:49 PDT
Benjamin Poulain
Comment 2 2015-10-05 14:44:12 PDT
Comment on attachment 262439 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=262439&action=review Ok > Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp:152 > + const Vector<String>& requestedLocales = canonicalizeLocaleList(exec, exec->argument(0)); IMHO, using Vector<String> makes the lifetime clearer.
Sukolsak Sakshuwong
Comment 3 2015-10-05 15:05:24 PDT
Created attachment 262467 [details] Use the LHS Vector<String> instead of const Vector<String>&
Sukolsak Sakshuwong
Comment 4 2015-10-05 15:18:47 PDT
(In reply to comment #2) > Comment on attachment 262439 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=262439&action=review > > Ok > > > Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp:152 > > + const Vector<String>& requestedLocales = canonicalizeLocaleList(exec, exec->argument(0)); > > IMHO, using Vector<String> makes the lifetime clearer. Thanks! Fixed.
WebKit Commit Bot
Comment 5 2015-10-05 16:37:42 PDT
Comment on attachment 262467 [details] Use the LHS Vector<String> instead of const Vector<String>& Clearing flags on attachment: 262467 Committed r190591: <http://trac.webkit.org/changeset/190591>
WebKit Commit Bot
Comment 6 2015-10-05 16:37:45 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.