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

Side by Side Diff: dart/runtime/lib/string_patch.dart

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/runtime/lib/simd128.cc ('k') | dart/runtime/lib/typed_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch class String { 5 patch class String {
6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) { 6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) {
7 return _StringBase.createFromCharCodes(charCodes); 7 return _StringBase.createFromCharCodes(charCodes);
8 } 8 }
9 9
10 /* patch */ const factory String.fromEnvironment(String name, 10 /* patch */ const factory String.fromEnvironment(String name,
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 for (int i = 0; i < this.length; i++) { 461 for (int i = 0; i < this.length; i++) {
462 if (string.codeUnitAt(start + i) != this.codeUnitAt(i)) { 462 if (string.codeUnitAt(start + i) != this.codeUnitAt(i)) {
463 return null; 463 return null;
464 } 464 }
465 } 465 }
466 return new _StringMatch(start, string, this); 466 return new _StringMatch(start, string, this);
467 } 467 }
468 468
469 List<String> split(Pattern pattern) { 469 List<String> split(Pattern pattern) {
470 if ((pattern is String) && pattern.isEmpty) { 470 if ((pattern is String) && pattern.isEmpty) {
471 List<String> result = new List<String>(length); 471 List<String> result = new List<String>(this.length);
472 for (int i = 0; i < length; i++) { 472 for (int i = 0; i < this.length; i++) {
473 result[i] = this[i]; 473 result[i] = this[i];
474 } 474 }
475 return result; 475 return result;
476 } 476 }
477 int length = this.length; 477 int length = this.length;
478 Iterator iterator = pattern.allMatches(this).iterator; 478 Iterator iterator = pattern.allMatches(this).iterator;
479 if (length == 0 && iterator.moveNext()) { 479 if (length == 0 && iterator.moveNext()) {
480 // A matched empty string input returns the empty list. 480 // A matched empty string input returns the empty list.
481 return <String>[]; 481 return <String>[];
482 } 482 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 class _CodeUnits extends Object with ListMixin<int>, 723 class _CodeUnits extends Object with ListMixin<int>,
724 UnmodifiableListMixin<int> { 724 UnmodifiableListMixin<int> {
725 /** The string that this is the code units of. */ 725 /** The string that this is the code units of. */
726 String _string; 726 String _string;
727 727
728 _CodeUnits(this._string); 728 _CodeUnits(this._string);
729 729
730 int get length => _string.length; 730 int get length => _string.length;
731 int operator[](int i) => _string.codeUnitAt(i); 731 int operator[](int i) => _string.codeUnitAt(i);
732 } 732 }
OLDNEW
« no previous file with comments | « dart/runtime/lib/simd128.cc ('k') | dart/runtime/lib/typed_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698