Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 11293080: fix stringToCodePoints on VM (Closed)

Created:
8 years, 1 month ago by Jennifer Messerly
Modified:
8 years, 1 month ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : test case #

Total comments: 4

Patch Set 3 : fix expect order #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -10 lines) Patch
M sdk/lib/utf/utf_core.dart View 1 chunk +5 lines, -10 lines 0 comments Download
A tests/utils/utf_test.dart View 1 2 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Jennifer Messerly
8 years, 1 month ago (2012-11-02 23:44:36 UTC) #1
ahe
8 years, 1 month ago (2012-11-03 11:06:50 UTC) #2
Jennifer Messerly
The context behind this: when the Dart VM removed Unicode string support, it broke our ...
8 years, 1 month ago (2012-11-05 18:45:35 UTC) #3
siva
I am not very familiar with this libary. The change looks consistent with how things ...
8 years, 1 month ago (2012-11-05 22:03:57 UTC) #4
Lasse Reichstein Nielsen
LGTM https://codereview.chromium.org/11293080/diff/2001/sdk/lib/utf/utf_core.dart File sdk/lib/utf/utf_core.dart (right): https://codereview.chromium.org/11293080/diff/2001/sdk/lib/utf/utf_core.dart#newcode13 sdk/lib/utf/utf_core.dart:13: return _utf16CodeUnitsToCodepoints(str.charCodes); This seems wasteful since charCodes currently ...
8 years, 1 month ago (2012-11-06 09:57:38 UTC) #5
Jennifer Messerly
8 years, 1 month ago (2012-11-06 18:41:20 UTC) #6
Thanks!

https://codereview.chromium.org/11293080/diff/2001/sdk/lib/utf/utf_core.dart
File sdk/lib/utf/utf_core.dart (right):

https://codereview.chromium.org/11293080/diff/2001/sdk/lib/utf/utf_core.dart#...
sdk/lib/utf/utf_core.dart:13: return _utf16CodeUnitsToCodepoints(str.charCodes);
On 2012/11/06 09:57:38, Lasse Reichstein Nielsen wrote:
> This seems wasteful since charCodes currently creates a new list, and not just
a
> thin wrapper around a String.
> We should probably both change that, and make this function return an
> unmodifiable list (so that it can return the same list if the code units
contain
> no surrogates, which will *often* be the case).
> I'll file bugs for that, this is OK for now.

Yeah, that sounds good. Thanks!

https://codereview.chromium.org/11293080/diff/2001/tests/utils/utf_test.dart
File tests/utils/utf_test.dart (right):

https://codereview.chromium.org/11293080/diff/2001/tests/utils/utf_test.dart#...
tests/utils/utf_test.dart:12: Expect.listEquals(str.charCodes, [0xd835,
0xdd37]);
On 2012/11/06 09:57:38, Lasse Reichstein Nielsen wrote:
> Expected values should be first argument.

Good catch. Done. I've been using the unittest "expect" for a while, which for
some reason has the opposite order.

Powered by Google App Engine
This is Rietveld 408576698