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

Unified Diff: runtime/lib/string_base.dart

Issue 11414273: Added native to split OneByteString with a char code as pattern. (Closed) Base URL: http://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
« no previous file with comments | « runtime/lib/string.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_base.dart
===================================================================
--- runtime/lib/string_base.dart (revision 15607)
+++ runtime/lib/string_base.dart (working copy)
@@ -389,6 +389,16 @@
String _substringUncheckedNative(int startIndex, int endIndex)
native "OneByteString_substringUnchecked";
+
+ List<String> _splitWithCharCode(int charCode)
+ native "OneByteString_splitWithCharCode";
+
+ List<String> split(Pattern pattern) {
+ if ((pattern is _OneByteString) && (pattern.length == 1)) {
+ return _splitWithCharCode(pattern.charCodeAt(0));
+ }
+ return super.split(pattern);
+ }
}
« no previous file with comments | « runtime/lib/string.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698