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

Issue 9315028: Support default values for optional parameters. (Closed)

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

Description

Support default values for optional parameters. Committed: https://code.google.com/p/dart/source/detail?r=3791

Patch Set 1 : '' #

Total comments: 6

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -51 lines) Patch
M dart/frog/leg/compile_time_constants.dart View 1 6 chunks +35 lines, -34 lines 0 comments Download
M dart/frog/leg/compiler.dart View 1 2 chunks +10 lines, -1 line 0 comments Download
M dart/frog/leg/emitter.dart View 1 4 chunks +4 lines, -4 lines 0 comments Download
M dart/frog/leg/resolver.dart View 1 6 chunks +34 lines, -5 lines 0 comments Download
M dart/frog/leg/ssa/builder.dart View 1 2 chunks +4 lines, -4 lines 0 comments Download
M dart/tests/language/language-leg.status View 1 2 chunks +0 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
ngeoffray
8 years, 10 months ago (2012-02-01 13:21:39 UTC) #1
floitsch
LGTM. We will have to refactor this at some point, because the CTCHandler may return ...
8 years, 10 months ago (2012-02-01 14:35:39 UTC) #2
ngeoffray
8 years, 10 months ago (2012-02-01 15:54:59 UTC) #3
Thanks Florian,

https://chromiumcodereview.appspot.com/9315028/diff/2001/dart/frog/leg/compil...
File dart/frog/leg/compile_time_constants.dart (right):

https://chromiumcodereview.appspot.com/9315028/diff/2001/dart/frog/leg/compil...
dart/frog/leg/compile_time_constants.dart:47: TreeElements definitions) {
On 2012/02/01 14:35:39, floitsch wrote:
> indent.

Done.

https://chromiumcodereview.appspot.com/9315028/diff/2001/dart/frog/leg/compil...
File dart/frog/leg/compiler.dart (right):

https://chromiumcodereview.appspot.com/9315028/diff/2001/dart/frog/leg/compil...
dart/frog/leg/compiler.dart:276: Element savedElement = currentElement;
On 2012/02/01 14:35:39, floitsch wrote:
> why is this necessary?

To get proper error messages if the work item generates messages. Peter has a
change to make this a bit cleaner.

https://chromiumcodereview.appspot.com/9315028/diff/2001/dart/frog/leg/resolv...
File dart/frog/leg/resolver.dart (right):

https://chromiumcodereview.appspot.com/9315028/diff/2001/dart/frog/leg/resolv...
dart/frog/leg/resolver.dart:1084: // Visit the value. The compile time constant
handler will
On 2012/02/01 14:35:39, floitsch wrote:
> Shouldn't we full-resolve the parameter only when it's needed? We might not
even
> need to create the CTC.

As discussed, if we're here, we're assuming the parameter is needed. We might
reconsider this when the typechecker gets more attention.

Powered by Google App Engine
This is Rietveld 408576698