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

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

Issue 10831021: Added a test of Dart_FunctionParameterCounts against a closure inside an (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
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 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after
2893 RETURN_TYPE_ERROR(isolate, function, Function); 2893 RETURN_TYPE_ERROR(isolate, function, Function);
2894 } 2894 }
2895 2895
2896 // We hide implicit parameters, such as a method's receiver. This is 2896 // We hide implicit parameters, such as a method's receiver. This is
2897 // consistent with Invoke or New, which don't expect their callers to 2897 // consistent with Invoke or New, which don't expect their callers to
2898 // provide them in the argument lists they are handed. 2898 // provide them in the argument lists they are handed.
2899 *fixed_param_count = (func.num_fixed_parameters() - 2899 *fixed_param_count = (func.num_fixed_parameters() -
2900 func.NumberOfImplicitParameters()); 2900 func.NumberOfImplicitParameters());
2901 *opt_param_count = func.num_optional_parameters(); 2901 *opt_param_count = func.num_optional_parameters();
2902 2902
2903 ASSERT(*fixed_param_count >= 0);
2904 ASSERT(*opt_param_count >= 0);
2905
2903 return Api::Success(isolate); 2906 return Api::Success(isolate);
2904 } 2907 }
2905 2908
2906 2909
2907 DART_EXPORT Dart_Handle Dart_GetVariableNames(Dart_Handle target) { 2910 DART_EXPORT Dart_Handle Dart_GetVariableNames(Dart_Handle target) {
2908 Isolate* isolate = Isolate::Current(); 2911 Isolate* isolate = Isolate::Current();
2909 DARTSCOPE(isolate); 2912 DARTSCOPE(isolate);
2910 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target)); 2913 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target));
2911 if (obj.IsError()) { 2914 if (obj.IsError()) {
2912 return target; 2915 return target;
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
4168 *buffer_size = 0; 4171 *buffer_size = 0;
4169 } 4172 }
4170 } 4173 }
4171 4174
4172 4175
4173 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) { 4176 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) {
4174 Dart::set_flow_graph_writer(function); 4177 Dart::set_flow_graph_writer(function);
4175 } 4178 }
4176 4179
4177 } // namespace dart 4180 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698