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

Issue 920453002: Add String.replaceFirstMapped. (Closed)

Created:
5 years, 10 months ago by Lasse Reichstein Nielsen
Modified:
5 years, 10 months ago
Reviewers:
floitsch, sra1, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add String.replaceFirstMapped. Also refactory VM implementation of checking if a string is one-byte, and adds dart2js implementation of replaceFirst for non-string/regexp pattern. BUG= http://dartbug.com/2979 R=floitsch@google.com, iposva@google.com Committed: https://code.google.com/p/dart/source/detail?r=43716 Committed: https://code.google.com/p/dart/source/detail?r=43718

Patch Set 1 #

Total comments: 11

Patch Set 2 : Address comments. #

Patch Set 3 : With change to _interpolate methods. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+283 lines, -97 lines) Patch
M runtime/lib/string_patch.dart View 1 2 4 chunks +50 lines, -21 lines 0 comments Download
M sdk/lib/_internal/compiler/js_lib/interceptors.dart View 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/js_lib/js_string.dart View 1 chunk +9 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/js_lib/string_helper.dart View 1 1 chunk +20 lines, -7 lines 1 comment Download
M sdk/lib/core/string.dart View 2 chunks +15 lines, -1 line 0 comments Download
M tests/corelib/string_replace_test.dart View 1 chunk +188 lines, -65 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
Lasse Reichstein Nielsen
5 years, 10 months ago (2015-02-11 11:23:43 UTC) #2
floitsch
LGTM, but wait for VM. https://codereview.chromium.org/920453002/diff/1/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/920453002/diff/1/runtime/lib/string_patch.dart#newcode719 runtime/lib/string_patch.dart:719: var matches = pattern.allMatches(this, ...
5 years, 10 months ago (2015-02-11 11:49:14 UTC) #3
Ivan Posva
LGTM with comments addressed. -Ivan https://codereview.chromium.org/920453002/diff/1/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/920453002/diff/1/runtime/lib/string_patch.dart#newcode693 runtime/lib/string_patch.dart:693: String replacement = "${replace(match)}"; ...
5 years, 10 months ago (2015-02-11 22:45:40 UTC) #4
Lasse Reichstein Nielsen
Committed patchset #2 (id:20001) manually as 43716 (presubmit successful).
5 years, 10 months ago (2015-02-12 09:04:39 UTC) #6
Lasse Reichstein Nielsen
Committed patchset #3 (id:40001) manually as 43718 (presubmit successful).
5 years, 10 months ago (2015-02-12 09:17:07 UTC) #7
Lasse Reichstein Nielsen
https://codereview.chromium.org/920453002/diff/1/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/920453002/diff/1/runtime/lib/string_patch.dart#newcode693 runtime/lib/string_patch.dart:693: String replacement = "${replace(match)}"; The interpolation also throws if ...
5 years, 10 months ago (2015-02-12 09:17:16 UTC) #8
sra1
https://codereview.chromium.org/920453002/diff/40001/sdk/lib/_internal/compiler/js_lib/string_helper.dart File sdk/lib/_internal/compiler/js_lib/string_helper.dart (right): https://codereview.chromium.org/920453002/diff/40001/sdk/lib/_internal/compiler/js_lib/string_helper.dart#newcode201 sdk/lib/_internal/compiler/js_lib/string_helper.dart:201: '${receiver.substring(index + from.length)}'; This common pattern (3x) makes me ...
5 years, 10 months ago (2015-02-17 17:01:00 UTC) #10
Lasse Reichstein Nielsen
5 years, 10 months ago (2015-02-23 08:39:17 UTC) #11
Message was sent while issue was closed.
Re: replaceRange - I like it.

Powered by Google App Engine
This is Rietveld 408576698