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

Issue 9689089: Improve the replaceFirst, replaceAll and split methods. (Closed)

Created:
8 years, 9 months ago by cshapiro
Modified:
8 years, 9 months ago
Reviewers:
ngeoffray, siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Improve the replaceFirst, replaceAll and split methods. An empty regular expression had caused split to loop infinitely. Now, the split method behaves like its namesake in ECMAScript and splits a string along character boundaries. The split, replaceFirst, and replaceAll methods only supported RegExp and String patterns. Now, these methods are implemented on top of the allMatches method and work for all subinterfaces of Pattern. BUG=2171 Committed: https://code.google.com/p/dart/source/detail?r=5653

Patch Set 1 #

Patch Set 2 : add co19 exceptions #

Patch Set 3 : propertly specify test exceptions #

Total comments: 10

Patch Set 4 : address review comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -115 lines) Patch
M runtime/lib/regexp.dart View 1 chunk +17 lines, -11 lines 0 comments Download
M runtime/lib/string.dart View 1 2 3 7 chunks +72 lines, -100 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M tests/corelib/corelib.status View 1 chunk +0 lines, -1 line 0 comments Download
M tests/corelib/src/StringPatternTest.dart View 2 chunks +2 lines, -2 lines 2 comments Download

Messages

Total messages: 10 (0 generated)
cshapiro
8 years, 9 months ago (2012-03-16 04:27:39 UTC) #1
Ivan Posva
LGTM with comments. -Ivan https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart File runtime/lib/string.dart (right): https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart#newcode278 runtime/lib/string.dart:278: int endIndex = position + ...
8 years, 9 months ago (2012-03-16 21:43:57 UTC) #2
ngeoffray
Hi Carl, https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart File runtime/lib/string.dart (right): https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart#newcode294 runtime/lib/string.dart:294: return iterator.hasNext() ? [] : [this]; [] ...
8 years, 9 months ago (2012-03-17 09:43:58 UTC) #3
cshapiro
https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart File runtime/lib/string.dart (right): https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart#newcode294 runtime/lib/string.dart:294: return iterator.hasNext() ? [] : [this]; can you give ...
8 years, 9 months ago (2012-03-19 06:39:29 UTC) #4
Ivan Posva
https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart File runtime/lib/string.dart (right): https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart#newcode294 runtime/lib/string.dart:294: return iterator.hasNext() ? [] : [this]; On 2012/03/19 06:39:29, ...
8 years, 9 months ago (2012-03-19 06:42:19 UTC) #5
cshapiro
https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart File runtime/lib/string.dart (right): https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart#newcode294 runtime/lib/string.dart:294: return iterator.hasNext() ? [] : [this]; I am curious ...
8 years, 9 months ago (2012-03-19 06:51:45 UTC) #6
ngeoffray
https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart File runtime/lib/string.dart (right): https://chromiumcodereview.appspot.com/9689089/diff/5001/runtime/lib/string.dart#newcode294 runtime/lib/string.dart:294: return iterator.hasNext() ? [] : [this]; On 2012/03/19 06:51:45, ...
8 years, 9 months ago (2012-03-19 08:25:38 UTC) #7
cshapiro
http://codereview.chromium.org/9689089/diff/5001/runtime/lib/string.dart File runtime/lib/string.dart (right): http://codereview.chromium.org/9689089/diff/5001/runtime/lib/string.dart#newcode278 runtime/lib/string.dart:278: int endIndex = position + this.length; Good idea. Done. ...
8 years, 9 months ago (2012-03-19 17:50:55 UTC) #8
ngeoffray
Hi Carl, http://codereview.chromium.org/9689089/diff/11001/tests/corelib/src/StringPatternTest.dart File tests/corelib/src/StringPatternTest.dart (right): http://codereview.chromium.org/9689089/diff/11001/tests/corelib/src/StringPatternTest.dart#newcode61 tests/corelib/src/StringPatternTest.dart:61: Expect.isTrue(matches.iterator().hasNext()); I believe one of these changes ...
8 years, 9 months ago (2012-03-19 20:13:29 UTC) #9
ngeoffray
8 years, 9 months ago (2012-03-19 20:14:15 UTC) #10
http://codereview.chromium.org/9689089/diff/11001/tests/corelib/src/StringPat...
File tests/corelib/src/StringPatternTest.dart (right):

http://codereview.chromium.org/9689089/diff/11001/tests/corelib/src/StringPat...
tests/corelib/src/StringPatternTest.dart:61:
Expect.isTrue(matches.iterator().hasNext());
On 2012/03/19 20:13:29, ngeoffray wrote:
> I believe one of these changes broke the leg bot.

%s/leg/dart2js

Powered by Google App Engine
This is Rietveld 408576698