Index: sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart |
index f8243c5ad5fb0a1cc47e6577118616d75c8a11ba..1e6bc7bfcd5d8134e9554d0f40dfff60e6e3587c 100644 |
--- a/sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart |
+++ b/sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart |
@@ -136,6 +136,10 @@ class _AllMatchesIterator implements Iterator<Match> { |
bool moveNext() { |
// firstMatch actually acts as nextMatch because of |
// hidden global flag. |
+ if (_current != null && _current.start == _current.end) { |
+ // Advance implicit start-position if last match was empty. |
+ JS("void", "#.lastIndex++", _re._nativeRegExp); |
+ } |
_current = _re.firstMatch(_str); |
return _current != null; |
} |