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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 10910119: Implement new optional parameters syntax in the vm (issue 4290). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 const Function& func = Api::UnwrapFunctionHandle(isolate, function); 2832 const Function& func = Api::UnwrapFunctionHandle(isolate, function);
2833 if (func.IsNull()) { 2833 if (func.IsNull()) {
2834 RETURN_TYPE_ERROR(isolate, function, Function); 2834 RETURN_TYPE_ERROR(isolate, function, Function);
2835 } 2835 }
2836 2836
2837 // We hide implicit parameters, such as a method's receiver. This is 2837 // We hide implicit parameters, such as a method's receiver. This is
2838 // consistent with Invoke or New, which don't expect their callers to 2838 // consistent with Invoke or New, which don't expect their callers to
2839 // provide them in the argument lists they are handed. 2839 // provide them in the argument lists they are handed.
2840 *fixed_param_count = (func.num_fixed_parameters() - 2840 *fixed_param_count = (func.num_fixed_parameters() -
2841 func.NumberOfImplicitParameters()); 2841 func.NumberOfImplicitParameters());
2842 *opt_param_count = func.num_optional_parameters(); 2842 // TODO(regis): Separately report named and positional optional param counts.
2843 *opt_param_count = (func.num_optional_positional_parameters() +
2844 func.num_optional_named_parameters());
2843 2845
2844 ASSERT(*fixed_param_count >= 0); 2846 ASSERT(*fixed_param_count >= 0);
2845 ASSERT(*opt_param_count >= 0); 2847 ASSERT(*opt_param_count >= 0);
2846 2848
2847 return Api::Success(isolate); 2849 return Api::Success(isolate);
2848 } 2850 }
2849 2851
2850 2852
2851 DART_EXPORT Dart_Handle Dart_GetVariableNames(Dart_Handle target) { 2853 DART_EXPORT Dart_Handle Dart_GetVariableNames(Dart_Handle target) {
2852 Isolate* isolate = Isolate::Current(); 2854 Isolate* isolate = Isolate::Current();
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
4179 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) { 4181 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) {
4180 Dart::set_perf_events_writer(function); 4182 Dart::set_perf_events_writer(function);
4181 } 4183 }
4182 4184
4183 4185
4184 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function) { 4186 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function) {
4185 Dart::set_flow_graph_writer(function); 4187 Dart::set_flow_graph_writer(function);
4186 } 4188 }
4187 4189
4188 } // namespace dart 4190 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698