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

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed)

Created:
8 years, 11 months ago by gbracha
Modified:
8 years, 11 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Added method map to Collection interface and all its implementations (except classes generated from IDL for the DOM). Committed: https://code.google.com/p/dart/source/detail?r=3223

Patch Set 1 #

Total comments: 43

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+252 lines, -9 lines) Patch
M client/dom/common/implementation.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M client/dom/frog/dom_frog.dart View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M client/html/src/CssClassSet.dart View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M client/html/src/DocumentFragmentWrappingImplementation.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M client/html/src/ElementWrappingImplementation.dart View 1 2 2 chunks +17 lines, -2 lines 0 comments Download
M client/html/src/NodeWrappingImplementation.dart View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M client/observable/observable.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M client/samples/swarm/DataSource.dart View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M compiler/lib/implementation/array.dart View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M compiler/lib/implementation/collections.dart View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M compiler/lib/implementation/regexp.dart View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M corelib/src/collection.dart View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M corelib/src/implementation/hash_map_set.dart View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M corelib/src/implementation/queue.dart View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
M frog/lib/collections.dart View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M frog/lib/corelib_impl.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M frog/minfrog View 1 2 7 chunks +36 lines, -0 lines 0 comments Download
M frog/utils.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/lib/array.dart View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/lib/byte_buffer.dart View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/lib/collections.dart View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M runtime/lib/growable_array.dart View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M tests/corelib/src/GrowableObjectArrayVMTest.dart View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
M tests/corelib/src/ListTest.dart View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M tests/corelib/src/QueueTest.dart View 1 2 2 chunks +13 lines, -2 lines 0 comments Download
M tests/corelib/src/RegExpAllMatchesTest.dart View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M tests/corelib/src/SetTest.dart View 1 2 1 chunk +34 lines, -5 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
gbracha
I added a map method to collections. IDL fixes wil be provided by SEA before ...
8 years, 11 months ago (2012-01-05 22:14:48 UTC) #1
ahe
LGTM! Mostly nits, but there are a few things that are important. Cheers, Peter http://codereview.chromium.org/9114021/diff/1/client/dom/frog/dom_frog.dart ...
8 years, 11 months ago (2012-01-05 22:36:54 UTC) #2
sra1
I'll start be working on the DOM side after finishing up my current task. http://codereview.chromium.org/9114021/diff/1/client/dom/frog/dom_frog.dart ...
8 years, 11 months ago (2012-01-05 22:46:48 UTC) #3
Ivan Posva
LGTM (from the VM perspective). -Ivan http://codereview.chromium.org/9114021/diff/1/corelib/src/collection.dart File corelib/src/collection.dart (right): http://codereview.chromium.org/9114021/diff/1/corelib/src/collection.dart#newcode21 corelib/src/collection.dart:21: * type would ...
8 years, 11 months ago (2012-01-05 22:47:02 UTC) #4
Jennifer Messerly
few comments but overall lgtm http://codereview.chromium.org/9114021/diff/1/client/html/src/ElementWrappingImplementation.dart File client/html/src/ElementWrappingImplementation.dart (right): http://codereview.chromium.org/9114021/diff/1/client/html/src/ElementWrappingImplementation.dart#newcode34 client/html/src/ElementWrappingImplementation.dart:34: List<Element> output = new ...
8 years, 11 months ago (2012-01-05 22:54:20 UTC) #5
vsm
LGTM for Dartium (but please wait for sra on DartC and Frog DOM)
8 years, 11 months ago (2012-01-05 23:53:42 UTC) #6
zundel
http://codereview.chromium.org/9114021/diff/1/compiler/lib/implementation/collections.dart File compiler/lib/implementation/collections.dart (right): http://codereview.chromium.org/9114021/diff/1/compiler/lib/implementation/collections.dart#newcode21 compiler/lib/implementation/collections.dart:21: destination.add(f(e)); I don't understand what this is supposed to ...
8 years, 11 months ago (2012-01-06 14:42:11 UTC) #7
floitsch
LGTM, but the next time please include Nicolas and/or me when doing core-library changes (and ...
8 years, 11 months ago (2012-01-10 13:45:19 UTC) #8
gbracha
8 years, 11 months ago (2012-01-12 00:53:57 UTC) #9
Ok, all comments have been acted upon. Are we good to go?

http://codereview.chromium.org/9114021/diff/1/client/html/src/_Collections.dart
File client/html/src/_Collections.dart (right):

http://codereview.chromium.org/9114021/diff/1/client/html/src/_Collections.da...
client/html/src/_Collections.dart:17: static List map(Iterable<Object> source,
On 2012/01/05 22:46:49, sra1 wrote:
> Question - is there a good reason for this to be Iterable<Object> rather than
> just Iterable (aka Iterable/*<Dynamic>*/)

I don't think so. I've followed the style that's already in place in this class.

http://codereview.chromium.org/9114021/diff/1/client/samples/swarm/DataSource...
File client/samples/swarm/DataSource.dart (right):

http://codereview.chromium.org/9114021/diff/1/client/samples/swarm/DataSource...
client/samples/swarm/DataSource.dart:91: return Collections.map(this, new
List<Section>(), f);
On 2012/01/05 22:36:54, ahe wrote:
> How do you know that f returns a Section?

I don't. It's a mistake. Fixed.

http://codereview.chromium.org/9114021/diff/1/compiler/lib/implementation/arr...
File compiler/lib/implementation/array.dart (right):

http://codereview.chromium.org/9114021/diff/1/compiler/lib/implementation/arr...
compiler/lib/implementation/array.dart:80: return Collections.map(this, new
List(), f);
On 2012/01/05 22:54:21, John Messerly wrote:
> minor style comment, I'd just use "[]" here instead of "new List()"

I'm of two minds on that. I agree it looks nice, but to me [] feels like an
immutable empty list, so I tend to avoid it in  cases like these.

http://codereview.chromium.org/9114021/diff/1/compiler/lib/implementation/col...
File compiler/lib/implementation/collections.dart (right):

http://codereview.chromium.org/9114021/diff/1/compiler/lib/implementation/col...
compiler/lib/implementation/collections.dart:21: destination.add(f(e));
On 2012/01/06 14:42:12, zundel wrote:
> I don't understand what this is supposed to do.  It looks like, according to
the
> method signature, that it will call the function 'f' and populate a list with
> values 'true' or 'false' in each position.

Oops, cut-and-paste error. Obviously, the function need not be boolean. Fixed.

http://codereview.chromium.org/9114021/diff/1/runtime/lib/array.dart
File runtime/lib/array.dart (right):

http://codereview.chromium.org/9114021/diff/1/runtime/lib/array.dart#newcode88
runtime/lib/array.dart:88: return Collections.map(this, new
GrowableObjectArray(), f);
On 2012/01/05 22:47:03, Ivan Posva wrote:
> Maybe even allocate a new ObjectArray(length), but this is a bigger question
> about what types the collection methods return.

I suppose someone could compute the mapped collection and then want to add stuff
to it. Bad style perhaps, but I leave it to the library designer to decide.

Powered by Google App Engine
This is Rietveld 408576698