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

Issue 8424012: Add optional arguments to our indexOf/lastIndexOf methods. (Closed)

Created:
9 years, 1 month ago by ngeoffray
Modified:
9 years, 1 month ago
Reviewers:
floitsch, srdjan, kasperl
CC:
reviews_dartlang.org, srdjan, mmendez
Visibility:
Public.

Description

Add optional arguments to our indexOf/lastIndexOf methods. Committed: https://code.google.com/p/dart/source/detail?r=947

Patch Set 1 : '' #

Total comments: 1

Patch Set 2 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -114 lines) Patch
M client/dom/generated/src/wrapping/_CanvasPixelArrayWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/dom/generated/src/wrapping/_HTMLCollectionWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/dom/generated/src/wrapping/_MediaListWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/dom/generated/src/wrapping/_NamedNodeMapWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/dom/generated/src/wrapping/_NodeListWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/dom/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/dom/generated/src/wrapping/_TouchListWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/dom/scripts/dartgenerator.py View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/html/generated/src/wrapping/_CanvasPixelArrayWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/html/generated/src/wrapping/_MediaListWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/html/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 2 comments Download
M client/html/generated/src/wrapping/_TouchListWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/html/src/DocumentFragmentWrappingImplementation.dart View 1 2 chunks +9 lines, -5 lines 2 comments Download
M client/html/src/DocumentWrappingImplementation.dart View 1 chunk +1 line, -1 line 0 comments Download
M client/html/src/ElementWrappingImplementation.dart View 1 2 chunks +7 lines, -6 lines 0 comments Download
client/html/src/NodeWrappingImplementation.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M client/observable/observable.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/backend/js/testListSubTypeExprOpt.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
M compiler/lib/implementation/array.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M compiler/lib/implementation/string.dart View 1 2 chunks +12 lines, -4 lines 0 comments Download
M compiler/lib/implementation/string.js View 1 chunk +2 lines, -2 lines 0 comments Download
M corelib/src/list.dart View 1 1 chunk +5 lines, -5 lines 0 comments Download
M corelib/src/string.dart View 1 2 chunks +5 lines, -5 lines 0 comments Download
M runtime/lib/array.dart View 1 2 chunks +10 lines, -8 lines 0 comments Download
runtime/lib/growable_array.dart View 1 2 chunks +5 lines, -7 lines 0 comments Download
M runtime/lib/string.dart View 1 2 chunks +10 lines, -9 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
ngeoffray
9 years, 1 month ago (2011-10-31 11:34:53 UTC) #1
kasperl
Quick nit: http://codereview.chromium.org/8424012/diff/3001/client/dom/generated/src/wrapping/_CanvasPixelArrayWrappingImplementation.dart File client/dom/generated/src/wrapping/_CanvasPixelArrayWrappingImplementation.dart (right): http://codereview.chromium.org/8424012/diff/3001/client/dom/generated/src/wrapping/_CanvasPixelArrayWrappingImplementation.dart#newcode49 client/dom/generated/src/wrapping/_CanvasPixelArrayWrappingImplementation.dart:49: int lastIndexOf(int element, [int fromIndex = null]) ...
9 years, 1 month ago (2011-10-31 12:35:09 UTC) #2
floitsch
LGTM, but I agree with Kasper: the named arguments should be consistent. Maybe just 'start' ...
9 years, 1 month ago (2011-10-31 12:52:57 UTC) #3
ngeoffray
Thanks for the reviews. I have dropped the "Index" in the argument name, and name ...
9 years, 1 month ago (2011-10-31 13:19:23 UTC) #4
srdjan
http://codereview.chromium.org/8424012/diff/1002/client/html/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart File client/html/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart (right): http://codereview.chromium.org/8424012/diff/1002/client/html/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart#newcode45 client/html/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart:45: if (start == null) start = length - 1; ...
9 years, 1 month ago (2011-10-31 18:01:29 UTC) #5
ngeoffray
9 years, 1 month ago (2011-11-01 07:50:43 UTC) #6
Thanks Srdjan,

http://codereview.chromium.org/8424012/diff/1002/client/html/generated/src/wr...
File
client/html/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart
(right):

http://codereview.chromium.org/8424012/diff/1002/client/html/generated/src/wr...
client/html/generated/src/wrapping/_StyleSheetListWrappingImplementation.dart:45:
if (start == null) start = length - 1;
On 2011/10/31 18:01:29, srdjan wrote:
> ===

Nice catch. I will let Jacob's script handle this case (I didn't know how to
generate the files, so I manually edited them).

http://codereview.chromium.org/8424012/diff/1002/client/html/src/DocumentFrag...
File client/html/src/DocumentFragmentWrappingImplementation.dart (right):

http://codereview.chromium.org/8424012/diff/1002/client/html/src/DocumentFrag...
client/html/src/DocumentFragmentWrappingImplementation.dart:105: int
lastIndexOf(Element element, [int start = null]) {
On 2011/10/31 18:01:29, srdjan wrote:
> WHy not just [int start] (here and everywhere else where default value is
null)?

Last time I checked, not giving a default value failed on DartC.

Powered by Google App Engine
This is Rietveld 408576698