| Index: runtime/lib/string_base.dart
|
| diff --git a/runtime/lib/string_base.dart b/runtime/lib/string_base.dart
|
| index 880df42323ee66a6cc7c0649b27f7355c63fcdba..eef5b02a47d363fdcf73089036c762d77ce49f81 100644
|
| --- a/runtime/lib/string_base.dart
|
| +++ b/runtime/lib/string_base.dart
|
| @@ -189,7 +189,7 @@ class _StringBase {
|
| if (pattern is String) {
|
| return indexOf(pattern, startIndex) >= 0;
|
| }
|
| - return pattern.allMatches(this.substring(startIndex)).iterator().hasNext;
|
| + return pattern.allMatches(this.substring(startIndex)).iterator.moveNext();
|
| }
|
|
|
| String replaceFirst(Pattern pattern, String replacement) {
|
| @@ -201,9 +201,9 @@ class _StringBase {
|
| }
|
| StringBuffer buffer = new StringBuffer();
|
| int startIndex = 0;
|
| - Iterator iterator = pattern.allMatches(this).iterator();
|
| - if (iterator.hasNext) {
|
| - Match match = iterator.next();
|
| + Iterator iterator = pattern.allMatches(this).iterator;
|
| + if (iterator.moveNext()) {
|
| + Match match = iterator.current;
|
| buffer.add(this.substring(startIndex, match.start)).add(replacement);
|
| startIndex = match.end;
|
| }
|
| @@ -280,8 +280,8 @@ class _StringBase {
|
|
|
| List<String> split(Pattern pattern) {
|
| int length = this.length;
|
| - Iterator iterator = pattern.allMatches(this).iterator();
|
| - if (length == 0 && iterator.hasNext) {
|
| + Iterator iterator = pattern.allMatches(this).iterator;
|
| + if (length == 0 && iterator.moveNext()) {
|
| // A matched empty string input returns the empty list.
|
| return <String>[];
|
| }
|
| @@ -289,11 +289,11 @@ class _StringBase {
|
| int startIndex = 0;
|
| int previousIndex = 0;
|
| while (true) {
|
| - if (startIndex == length || !iterator.hasNext) {
|
| + if (startIndex == length || !iterator.moveNext()) {
|
| result.add(this.substring(previousIndex, length));
|
| break;
|
| }
|
| - Match match = iterator.next();
|
| + Match match = iterator.current;
|
| if (match.start == length) {
|
| result.add(this.substring(previousIndex, length));
|
| break;
|
|
|