Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2850 // to check for a setter function here, but unfortunately the only | 2850 // to check for a setter function here, but unfortunately the only |
| 2851 // way to distinguish abstract setter functions is to use the name | 2851 // way to distinguish abstract setter functions is to use the name |
| 2852 // itself. Consider adding a RawFunction::kAbstractSetter type. | 2852 // itself. Consider adding a RawFunction::kAbstractSetter type. |
| 2853 const String& func_name = String::Handle(isolate, func.name()); | 2853 const String& func_name = String::Handle(isolate, func.name()); |
| 2854 *is_setter = Field::IsSetterName(func_name); | 2854 *is_setter = Field::IsSetterName(func_name); |
| 2855 | 2855 |
| 2856 return Api::Success(isolate); | 2856 return Api::Success(isolate); |
| 2857 } | 2857 } |
| 2858 | 2858 |
| 2859 | 2859 |
| 2860 DART_EXPORT Dart_Handle Dart_FunctionParameterCounts(Dart_Handle function, | |
| 2861 int64_t* fixed_param_count, | |
| 2862 int64_t* opt_param_count) { | |
|
turnidge
2012/07/13 23:37:12
Parameters should line up. Reindent signature as
| |
| 2863 Isolate* isolate = Isolate::Current(); | |
| 2864 DARTSCOPE(isolate); | |
| 2865 if (fixed_param_count == NULL) { | |
| 2866 RETURN_NULL_ERROR(fixed_param_count); | |
| 2867 } | |
| 2868 if (opt_param_count == NULL) { | |
| 2869 RETURN_NULL_ERROR(opt_param_count); | |
| 2870 } | |
| 2871 const Function& func = Api::UnwrapFunctionHandle(isolate, function); | |
| 2872 if (func.IsNull()) { | |
| 2873 RETURN_TYPE_ERROR(isolate, function, Function); | |
| 2874 } | |
| 2875 | |
| 2876 // We hide implicit parameters, such as a method's receiver. This is | |
| 2877 // consistent with Invoke or New, which don't expect their callers to | |
| 2878 // provide them in the argument lists they are handed. | |
| 2879 | |
|
turnidge
2012/07/13 23:37:12
Remove preceding blank line.
| |
| 2880 *fixed_param_count = func.num_fixed_parameters() | |
|
turnidge
2012/07/13 23:37:12
To get this to auto-indent correctly for those usi
| |
| 2881 - func.NumberOfImplicitParameters(); | |
| 2882 *opt_param_count = func.num_optional_parameters(); | |
| 2883 | |
| 2884 return Api::Success(isolate); | |
| 2885 } | |
| 2886 | |
| 2887 | |
| 2860 DART_EXPORT Dart_Handle Dart_GetVariableNames(Dart_Handle target) { | 2888 DART_EXPORT Dart_Handle Dart_GetVariableNames(Dart_Handle target) { |
| 2861 Isolate* isolate = Isolate::Current(); | 2889 Isolate* isolate = Isolate::Current(); |
| 2862 DARTSCOPE(isolate); | 2890 DARTSCOPE(isolate); |
| 2863 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target)); | 2891 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target)); |
| 2864 if (obj.IsError()) { | 2892 if (obj.IsError()) { |
| 2865 return target; | 2893 return target; |
| 2866 } | 2894 } |
| 2867 | 2895 |
| 2868 const GrowableObjectArray& names = | 2896 const GrowableObjectArray& names = |
| 2869 GrowableObjectArray::Handle(isolate, GrowableObjectArray::New()); | 2897 GrowableObjectArray::Handle(isolate, GrowableObjectArray::New()); |
| (...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4120 *buffer_size = 0; | 4148 *buffer_size = 0; |
| 4121 } | 4149 } |
| 4122 } | 4150 } |
| 4123 | 4151 |
| 4124 | 4152 |
| 4125 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) { | 4153 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) { |
| 4126 Dart::set_flow_graph_writer(function); | 4154 Dart::set_flow_graph_writer(function); |
| 4127 } | 4155 } |
| 4128 | 4156 |
| 4129 } // namespace dart | 4157 } // namespace dart |
| OLD | NEW |