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
Created attachment 262439 [details] Patch
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.
Created attachment 262467 [details] Use the LHS Vector<String> instead of const Vector<String>&
(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.
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>
All reviewed patches have been landed. Closing bug.