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

Issue 10910119: Implement new optional parameters syntax in the vm (issue 4290). (Closed)

Created:
8 years, 3 months ago by regis
Modified:
8 years, 3 months ago
Reviewers:
hausner
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Implement new optional parameters syntax in the vm (issue 4290). Provide --reject_named_argument_as_positional flag to ease transition to new syntax (default is false). Add tests. Committed: https://code.google.com/p/dart/source/detail?r=12004

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+808 lines, -259 lines) Patch
M runtime/vm/ast_printer.cc View 1 1 chunk +4 lines, -2 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 3 chunks +6 lines, -6 lines 0 comments Download
M runtime/vm/code_generator_test.cc View 1 5 chunks +5 lines, -7 lines 0 comments Download
M runtime/vm/compiler.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M runtime/vm/flow_graph.h View 1 2 chunks +11 lines, -11 lines 0 comments Download
M runtime/vm/flow_graph.cc View 1 5 chunks +8 lines, -8 lines 0 comments Download
M runtime/vm/flow_graph_allocator.cc View 1 2 chunks +5 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_builder.h View 1 2 chunks +11 lines, -11 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 3 chunks +5 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 12 chunks +84 lines, -36 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 13 chunks +86 lines, -38 lines 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/object.h View 1 4 chunks +18 lines, -10 lines 0 comments Download
M runtime/vm/object.cc View 1 19 chunks +254 lines, -42 lines 0 comments Download
M runtime/vm/object_test.cc View 1 2 chunks +8 lines, -4 lines 0 comments Download
M runtime/vm/parser.h View 1 3 chunks +6 lines, -6 lines 0 comments Download
M runtime/vm/parser.cc View 1 14 chunks +70 lines, -37 lines 0 comments Download
M runtime/vm/raw_object.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/raw_object_snapshot.cc View 1 2 chunks +4 lines, -2 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 1 chunk +1 line, -4 lines 0 comments Download
M tests/language/function_type_alias2_test.dart View 1 1 chunk +27 lines, -5 lines 0 comments Download
M tests/language/language.status View 1 1 chunk +3 lines, -0 lines 0 comments Download
M tests/language/language_dart2js.status View 1 1 chunk +6 lines, -0 lines 0 comments Download
M tests/language/named_parameters_type_test.dart View 1 2 chunks +14 lines, -10 lines 0 comments Download
A tests/language/optional_named_parameters_test.dart View 1 chunk +105 lines, -0 lines 0 comments Download
A tests/language/positional_parameters_type_test.dart View 1 1 chunk +53 lines, -0 lines 0 comments Download
M tests/language/type_vm_test.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
regis
8 years, 3 months ago (2012-09-06 22:56:42 UTC) #1
hausner
LGTM. Thank you for keeping the new and old code so nicely separated. https://chromiumcodereview.appspot.com/10910119/diff/1/runtime/vm/object.cc File ...
8 years, 3 months ago (2012-09-07 00:23:29 UTC) #2
regis
8 years, 3 months ago (2012-09-07 01:11:33 UTC) #3
Thank you, Sir!

https://chromiumcodereview.appspot.com/10910119/diff/1/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://chromiumcodereview.appspot.com/10910119/diff/1/runtime/vm/object.cc#n...
runtime/vm/object.cc:3910: ASSERT(value >= 0);
On 2012/09/07 00:23:29, hausner wrote:
> I believe optional positional and optional named parameters are mutually
> exclusive, correct? I could not see a place where we assert that that's the
case
> (other than the parser rejecting a function that has both.)

Good point. I added an assert here and below.

https://chromiumcodereview.appspot.com/10910119/diff/1/tests/language/positio...
File tests/language/positional_parameters_type_test.dart (right):

https://chromiumcodereview.appspot.com/10910119/diff/1/tests/language/positio...
tests/language/positional_parameters_type_test.dart:16: void
acceptFunNumOptBool(void funNumOptBool(num num, [bool b])) { };
On 2012/09/07 00:23:29, hausner wrote:
> Should this be num n instead of num num. Same comment for the next few
> signatures.

Done here and in other tests.

Powered by Google App Engine
This is Rietveld 408576698