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

Unified Diff: sdk/lib/utf/utf16.dart

Issue 11418115: Fix Unicode issues in dart2js and dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/utf/utf16.dart
diff --git a/sdk/lib/utf/utf16.dart b/sdk/lib/utf/utf16.dart
index d1bd012fc5992a3d4e33d684ad9515dd897d625f..999a53b39ffa4f998c4bdf6855016ec9b64172ee 100644
--- a/sdk/lib/utf/utf16.dart
+++ b/sdk/lib/utf/utf16.dart
@@ -62,15 +62,8 @@ String decodeUtf16(List<int> bytes, [int offset = 0, int length,
Utf16BytesToCodeUnitsDecoder decoder = new Utf16BytesToCodeUnitsDecoder(bytes,
offset, length, replacementCodepoint);
List<int> codeunits = decoder.decodeRest();
- // TODO is16BitCodeUnit() is used to work around a bug with dart2js
- // (http://code.google.com/p/dart/issues/detail?id=1357). Consider
- // removing after this issue is resolved.
- if (_is16BitCodeUnit()) {
- return new String.fromCharCodes(codeunits);
- } else {
- return new String.fromCharCodes(
- _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
- }
+ return new String.fromCharCodes(
+ _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
}
/**
@@ -88,12 +81,8 @@ String decodeUtf16be(List<int> bytes, [int offset = 0, int length,
// TODO is16BitCodeUnit() is used to work around a bug with dart2js
// (http://code.google.com/p/dart/issues/detail?id=1357). Consider
// removing after this issue is resolved.
- if (_is16BitCodeUnit()) {
- return new String.fromCharCodes(codeunits);
- } else {
- return new String.fromCharCodes(
- _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
- }
+ return new String.fromCharCodes(
+ _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
}
/**
@@ -111,12 +100,8 @@ String decodeUtf16le(List<int> bytes, [int offset = 0, int length,
// TODO is16BitCodeUnit() is used to work around a bug with dart2js
// (http://code.google.com/p/dart/issues/detail?id=1357). Consider
// removing after this issue is resolved.
- if (_is16BitCodeUnit()) {
- return new String.fromCharCodes(codeunits);
- } else {
- return new String.fromCharCodes(
- _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
- }
+ return new String.fromCharCodes(
+ _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
}
/**
@@ -201,11 +186,7 @@ List<int> _stringToUtf16CodeUnits(String str) {
// TODO is16BitCodeUnit() is used to work around a bug with dart2js
// (http://code.google.com/p/dart/issues/detail?id=1357). Consider
// removing after this issue is resolved.
- if (_is16BitCodeUnit()) {
- return str.charCodes;
- } else {
- return _codepointsToUtf16CodeUnits(str.charCodes);
- }
+ return _codepointsToUtf16CodeUnits(str.charCodes);
}
typedef _ListRangeIterator _CodeUnitsProvider();

Powered by Google App Engine
This is Rietveld 408576698