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

Issue 462463003: Add optional startIndex to String.replaceFirst (Closed)

Created:
6 years, 4 months ago by srawlins
Modified:
6 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 26

Patch Set 2 : Update using allMatches's startIndex; more tests #

Total comments: 12

Patch Set 3 : Cleaner after lrn@'s feedback #

Total comments: 6

Patch Set 4 : Little fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -18 lines) Patch
M runtime/lib/string_patch.dart View 1 2 1 chunk +16 lines, -10 lines 0 comments Download
M sdk/lib/_internal/lib/js_string.dart View 1 1 chunk +6 lines, -2 lines 0 comments Download
M sdk/lib/_internal/lib/string_helper.dart View 1 2 3 2 chunks +16 lines, -4 lines 0 comments Download
M sdk/lib/core/string.dart View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M tests/corelib/string_replace_test.dart View 1 2 3 1 chunk +45 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
srawlins
Hi Bill, would you mind reviewing? (I chose you because you opened this issue, although ...
6 years, 4 months ago (2014-08-11 05:43:02 UTC) #1
Bill Hesse
I would like Lasse to review this, since he is making decisions about core library ...
6 years, 4 months ago (2014-08-11 07:47:48 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/462463003/diff/1/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/462463003/diff/1/runtime/lib/string_patch.dart#newcode429 runtime/lib/string_patch.dart:429: String remaining = this.substring(startIndex); Creating a substring, and then ...
6 years, 4 months ago (2014-08-11 08:13:33 UTC) #3
Lasse Reichstein Nielsen
https://codereview.chromium.org/462463003/diff/1/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/462463003/diff/1/runtime/lib/string_patch.dart#newcode429 runtime/lib/string_patch.dart:429: String remaining = this.substring(startIndex); This implementation is actually wrong: ...
6 years, 4 months ago (2014-08-11 09:37:11 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/462463003/diff/1/sdk/lib/_internal/lib/string_helper.dart File sdk/lib/_internal/lib/string_helper.dart (right): https://codereview.chromium.org/462463003/diff/1/sdk/lib/_internal/lib/string_helper.dart#newcode72 sdk/lib/_internal/lib/string_helper.dart:72: stringReplaceJS(receiver, replacer, to, [startIndex = 0]) { No need ...
6 years, 4 months ago (2014-08-11 10:20:01 UTC) #5
Lasse Reichstein Nielsen
https://codereview.chromium.org/462463003/diff/1/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/462463003/diff/1/runtime/lib/string_patch.dart#newcode417 runtime/lib/string_patch.dart:417: String replaceFirst(Pattern pattern, String replacement, [int startIndex = 0]) ...
6 years, 4 months ago (2014-08-13 08:35:09 UTC) #6
srawlins
Thanks so much, Lasse and Bill. This patch should be much higher quality, thanks largely ...
6 years, 4 months ago (2014-08-14 00:42:45 UTC) #7
Lasse Reichstein Nielsen
https://codereview.chromium.org/462463003/diff/20001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/462463003/diff/20001/runtime/lib/string_patch.dart#newcode433 runtime/lib/string_patch.dart:433: startIndex == 0 ? pattern.allMatches(this).iterator Indent by four. https://codereview.chromium.org/462463003/diff/20001/sdk/lib/_internal/lib/string_helper.dart ...
6 years, 4 months ago (2014-08-19 07:26:46 UTC) #8
srawlins
Done. Thanks for the review! https://codereview.chromium.org/462463003/diff/20001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/462463003/diff/20001/runtime/lib/string_patch.dart#newcode433 runtime/lib/string_patch.dart:433: startIndex == 0 ? ...
6 years, 4 months ago (2014-08-19 21:42:32 UTC) #9
Lasse Reichstein Nielsen
LGTM with lines broken and the last test fixed. https://codereview.chromium.org/462463003/diff/40001/sdk/lib/_internal/lib/string_helper.dart File sdk/lib/_internal/lib/string_helper.dart (right): https://codereview.chromium.org/462463003/diff/40001/sdk/lib/_internal/lib/string_helper.dart#newcode200 sdk/lib/_internal/lib/string_helper.dart:200: ...
6 years, 4 months ago (2014-08-20 08:58:54 UTC) #10
Lasse Reichstein Nielsen
Excellent! I'll commit it.
6 years, 4 months ago (2014-08-22 08:53:32 UTC) #11
Lasse Reichstein Nielsen
Committed patchset #4 manually as 39490 (presubmit successful).
6 years, 4 months ago (2014-08-22 11:27:40 UTC) #12
srawlins
Thanks much Lasse! https://codereview.chromium.org/462463003/diff/40001/sdk/lib/_internal/lib/string_helper.dart File sdk/lib/_internal/lib/string_helper.dart (right): https://codereview.chromium.org/462463003/diff/40001/sdk/lib/_internal/lib/string_helper.dart#newcode200 sdk/lib/_internal/lib/string_helper.dart:200: return '${receiver.substring(0, index)}$to${receiver.substring(index + from.length)}'; On ...
6 years, 4 months ago (2014-08-22 14:46:40 UTC) #13
Ivan Posva
On 2014/08/22 11:27:40, Lasse Reichstein Nielsen wrote: > Committed patchset #4 manually as 39490 (presubmit ...
6 years, 4 months ago (2014-08-22 18:21:01 UTC) #14
Lasse Reichstein Nielsen
6 years, 3 months ago (2014-09-01 11:00:19 UTC) #15
Message was sent while issue was closed.

          

Powered by Google App Engine
This is Rietveld 408576698