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

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

Issue 791323003: - Allow implementations to hook into the Utf8Decoder.convert method. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/convert_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/utf.dart
===================================================================
--- sdk/lib/convert/utf.dart (revision 43026)
+++ sdk/lib/convert/utf.dart (working copy)
@@ -331,6 +331,13 @@
* character is discarded.
*/
String convert(List<int> codeUnits, [int start = 0, int end]) {
+ // Allow the implementation to intercept and specialize based on the type
+ // of codeUnits.
+ String result = _convertIntercepted(_allowMalformed, codeUnits, start, end);
+ if (result != null) {
+ return null;
+ }
+
int length = codeUnits.length;
RangeError.checkValidRange(start, end, length);
if (end == null) end = length;
@@ -361,6 +368,9 @@
Stream<String> bind(Stream<List<int>> stream) => super.bind(stream);
external Converter<List<int>,dynamic> fuse(Converter<String, dynamic> next);
+
+ external static String _convertIntercepted(
+ bool allowMalformed, List<int> codeUnits, int start, int end);
}
// UTF-8 constants.
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/convert_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698