Chromium Code Reviews| Index: pkg/compiler/lib/src/universe/world_builder.dart |
| diff --git a/pkg/compiler/lib/src/universe/world_builder.dart b/pkg/compiler/lib/src/universe/world_builder.dart |
| index 8302d84d2a5b93fcf85f8ecc7cb66f1fac8ca86e..a201a737429304bc6cbf55047c52e1ac5418d78b 100644 |
| --- a/pkg/compiler/lib/src/universe/world_builder.dart |
| +++ b/pkg/compiler/lib/src/universe/world_builder.dart |
| @@ -13,9 +13,10 @@ import '../common/names.dart' show Identifiers; |
| import '../common/resolution.dart' show Resolution; |
| import '../compiler.dart' show Compiler; |
| import '../core_types.dart'; |
| -import '../elements/resolution_types.dart'; |
| import '../elements/elements.dart'; |
| import '../elements/entities.dart'; |
| +import '../elements/resolution_types.dart'; |
| +import '../elements/types.dart'; |
| import '../universe/class_set.dart'; |
| import '../universe/function_set.dart' show FunctionSetBuilder; |
| import '../util/enumset.dart'; |
| @@ -1113,6 +1114,11 @@ abstract class CodegenWorldBuilder implements WorldBuilder { |
| void forEachInstanceField( |
| ClassEntity cls, void f(ClassEntity declarer, FieldEntity field)); |
| + /// Calls [f] for each parameter of [function] providing the type and name of |
| + /// the parameter. |
|
Siggi Cherem (dart-lang)
2017/01/20 17:00:15
I thought you were going to simply use the functio
Johnni Winther
2017/01/23 10:00:09
This has to do with names of parameter (not only t
Siggi Cherem (dart-lang)
2017/01/23 17:46:47
but I thought you only needed names for named-args
Johnni Winther
2017/01/24 09:16:42
This is called for (good) naming of parameters in
|
| + void forEachParameter( |
| + FunctionEntity function, void f(DartType type, String name)); |
|
Siggi Cherem (dart-lang)
2017/01/20 17:00:15
will you also eventually need to mark whether the
Johnni Winther
2017/01/23 10:00:09
Not sure. The JElements should not have these noti
|
| + |
| void forEachInvokedName( |
| f(String name, Map<Selector, SelectorConstraints> selectors)); |
| @@ -1234,6 +1240,15 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder { |
| .forEachInstanceField(f, includeSuperAndInjectedMembers: true); |
| } |
| + @override |
| + void forEachParameter( |
| + MethodElement function, void f(DartType type, String name)) { |
| + FunctionSignature parameters = function.functionSignature; |
| + parameters.forEachParameter((ParameterElement parameter) { |
| + f(parameter.type, parameter.name); |
| + }); |
| + } |
| + |
| Iterable<ClassElement> get processedClasses => _processedClasses.keys |
| .where((cls) => _processedClasses[cls].isInstantiated); |