Reviewers: Mads Ager, Nebojša Ćirić,
Message:
The CL is not yet ready for the full review.
However, I need some help from Mads. In the current form, it more or less
works
(see http://i18nl10n.com/chrome/coll.html).
However, the following does not work (taken from
http://i18nl10n.com/chrome/coll.js) :
var locale = new v8Locale(lang);
var coll = locale.createCollator(options);
var res = coll.compare("zeus", "Årenius");
var sortedWords = words.sort(coll.compare);
In CollatorCompare() in collator.cc, |UnpackCollator(args.Holder())| returns
NULL. I vaguely remember you mentioned something about a related issue, but
I
didn't quite understand that. Could you enlighten me as to how to make the
above
work?
BTW, if the last line is replaced with the following two lines, it works as
expected.
var compare = function(a, b) { return coll.compare(a, b);};
var sortedWords = words.sort(compare);
Description:
Add v8Locale.Collator.
This is patterned after the current draft proposal at
http://wiki.ecmascript.org/doku.php?id=strawman:i18n_api
I haven't yet implemented 'derive()' in the spec.
Moreover, we don't yet have an agreement on collator options (strength,
case
level, case first, etc). In this CL, I've just added two options with v8
prefix
(v8Strength and v8CaseLevel). I'm also considering v8CaseFirst (upper,
lower or
none).
ChromeOS and Chrome need this feature for M12. This could be added as chrome
extension API. Giiven that we have a rough agreement on the collation part
of
ECMAScript API, we thought it'd save us some duplicated work adding this v8
now
rather that moving it later.
BUG=28604
TEST=http://i18nl10n.com/chrome/coll.html
Please review this at http://codereview.chromium.org/6673011/
SVN Base: http://v8.googlecode.com/svn/trunk/
Affected files:
A src/extensions/experimental/collator.h
A src/extensions/experimental/collator.cc
M src/extensions/experimental/experimental.gyp
M src/extensions/experimental/i18n-extension.cc
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev