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

Issue 9316026: Support named arguments for dynamic calls. (Closed)

Created:
8 years, 10 months ago by ngeoffray
Modified:
8 years, 10 months ago
Reviewers:
floitsch, kasperl
CC:
reviews_dartlang.org, ahe, Lasse Reichstein Nielsen, karlklose
Visibility:
Public.

Description

Support named arguments for dynamic calls. Committed: https://code.google.com/p/dart/source/detail?r=3786

Patch Set 1 : '' #

Total comments: 9

Patch Set 2 : '' #

Total comments: 18

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+162 lines, -42 lines) Patch
M frog/leg/emitter.dart View 1 2 1 chunk +79 lines, -24 lines 0 comments Download
M frog/leg/namer.dart View 1 2 chunks +7 lines, -2 lines 0 comments Download
M frog/leg/ssa/builder.dart View 1 2 3 1 chunk +27 lines, -2 lines 0 comments Download
M frog/leg/ssa/codegen.dart View 1 2 chunks +10 lines, -6 lines 0 comments Download
M frog/leg/ssa/js_names.dart View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M frog/leg/universe.dart View 1 2 2 chunks +33 lines, -5 lines 0 comments Download
M tests/language/language-leg.status View 1 2 chunks +0 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
ngeoffray
8 years, 10 months ago (2012-02-01 10:10:10 UTC) #1
kasperl
LGTM. https://chromiumcodereview.appspot.com/9316026/diff/4001/frog/leg/emitter.dart File frog/leg/emitter.dart (right): https://chromiumcodereview.appspot.com/9316026/diff/4001/frog/leg/emitter.dart#newcode54 frog/leg/emitter.dart:54: // The parameters that this stub takes. Maybe ...
8 years, 10 months ago (2012-02-01 10:21:21 UTC) #2
ngeoffray
Thank you Kasper! https://chromiumcodereview.appspot.com/9316026/diff/4001/frog/leg/emitter.dart File frog/leg/emitter.dart (right): https://chromiumcodereview.appspot.com/9316026/diff/4001/frog/leg/emitter.dart#newcode54 frog/leg/emitter.dart:54: // The parameters that this stub ...
8 years, 10 months ago (2012-02-01 11:44:15 UTC) #3
floitsch
LGTM. https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dart File frog/leg/emitter.dart (right): https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dart#newcode46 frog/leg/emitter.dart:46: if (positionalArgumentCount == parameters.parameterCount) return; assert that invocation.namedArgumentCount ...
8 years, 10 months ago (2012-02-01 12:19:16 UTC) #4
ngeoffray
8 years, 10 months ago (2012-02-01 13:02:39 UTC) #5
Thanks for the comments Florian!

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dart
File frog/leg/emitter.dart (right):

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dar...
frog/leg/emitter.dart:46: if (positionalArgumentCount ==
parameters.parameterCount) return;
On 2012/02/01 12:19:17, floitsch wrote:
> assert that invocation.namedArgumentCount == 0 before returning?

Done.

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dar...
frog/leg/emitter.dart:63: // We fullfil the string buffers depending on the
selector. For
On 2012/02/01 12:19:17, floitsch wrote:
> s/fullfil/fill?

Done.

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dar...
frog/leg/emitter.dart:78: // (3) foo$3$c(1, 2, c: 3);
On 2012/02/01 12:19:17, floitsch wrote:
> remove c:

Done.

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dar...
frog/leg/emitter.dart:81: // (6) foo$4$c$d(1, 2, d: 4, c: 3);
On 2012/02/01 12:19:17, floitsch wrote:
> remove d: and c: and reorder 4 and 3.

Done.

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dar...
frog/leg/emitter.dart:97: if (count != 0) parametersBuffer.add(', ');
On 2012/02/01 12:19:17, floitsch wrote:
> Given these annoyances with the string-buffer, maybe switch to a list<string>
> and finish with join(', '). 

Done.

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dar...
frog/leg/emitter.dart:98: parametersBuffer.add('${element.name}');
On 2012/02/01 12:19:17, floitsch wrote:
> parameter names might need to be mangled (eg. 'with'):
> JsNames.getValid(...).
> At the same time please add a comment to getValid to make clear that it is an
> injection/bijection. Maybe even change the name. Alternatively it would
probably
> be a good idea to go through to the namer.

Done.

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/emitter.dar...
frog/leg/emitter.dart:121: if (positionalArgumentCount != 0)
parametersBuffer.add(', ');
On 2012/02/01 12:19:17, floitsch wrote:
> Only the first name in names should not have a ','.

Gone with Strings.join.

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/namer.dart
File frog/leg/namer.dart (right):

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/namer.dart#...
frog/leg/namer.dart:40: String instanceMethodName(SourceString name, int arity)
{
On 2012/02/01 12:19:17, floitsch wrote:
> Do we still need this one?

For the definition of the method (that does not have a selector but just an
arity and a name).

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/ssa/builder...
File frog/leg/ssa/builder.dart (right):

https://chromiumcodereview.appspot.com/9316026/diff/2003/frog/leg/ssa/builder...
frog/leg/ssa/builder.dart:918: selector.orderedNamedArguments = keys;
On 2012/02/01 12:19:17, floitsch wrote:
> Why/how is keys ordered?

As discussed, ordered it in another way.

Powered by Google App Engine
This is Rietveld 408576698