Chromium Code Reviews| Index: pkg/compiler/lib/src/js_backend/namer.dart |
| diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart |
| index f23d310bca8b09a48ba0e8955682efe15bb7d2ad..c718f8f9d85ca787d125118586405149a9ec0e3a 100644 |
| --- a/pkg/compiler/lib/src/js_backend/namer.dart |
| +++ b/pkg/compiler/lib/src/js_backend/namer.dart |
| @@ -17,13 +17,9 @@ import '../diagnostics/invariant.dart' show DEBUG_MODE; |
| import '../elements/elements.dart' |
| show |
| ClassElement, |
| - ConstructorBodyElement, |
| Element, |
| Elements, |
| FieldElement, |
| - FormalElement, |
| - FunctionElement, |
| - FunctionSignature, |
| MemberElement, |
| TypeDeclarationElement, |
| MixinApplicationElement, |
| @@ -769,26 +765,26 @@ class Namer { |
| } |
| } |
| - String _proposeNameForConstructorBody(ConstructorBodyElement method) { |
| + String _proposeNameForConstructorBody(ConstructorBodyEntity method) { |
| String name = Elements.reconstructConstructorNameSourceString(method); |
| // We include the method suffix on constructor bodies. It has no purpose, |
| // but this way it produces the same names as previous versions of the |
| // Namer class did. |
| - List<String> suffix = callSuffixForSignature(method.functionSignature); |
| + List<String> suffix = callSuffixForSignature(method.parameterStructure); |
| return '$name\$${suffix.join(r'$')}'; |
| } |
| /// Name for a constructor body. |
| - jsAst.Name constructorBodyName(ConstructorBodyElement ctor) { |
| + jsAst.Name constructorBodyName(ConstructorBodyEntity ctor) { |
| return _disambiguateInternalMember( |
| ctor, () => _proposeNameForConstructorBody(ctor)); |
| } |
| /// Annotated name for [method] encoding arity and named parameters. |
| jsAst.Name instanceMethodName(FunctionEntity method) { |
| - // TODO(redemption): Avoid the use of [ConstructorBodyElement]. The |
| + // TODO(johnniwinther): Avoid the use of [ConstructorBodyEntity]. The |
| // codegen model should be explicit about its constructor body elements. |
|
Siggi Cherem (dart-lang)
2017/07/07 20:00:25
I guess this TODO no longer applies, right?
Johnni Winther
2017/07/10 14:11:33
It still does, but not until after the redemption.
|
| - if (method is ConstructorBodyElement) { |
| + if (method is ConstructorBodyEntity) { |
| return constructorBodyName(method); |
| } |
| return invocationName(new Selector.fromElement(method)); |
| @@ -824,13 +820,9 @@ class Namer { |
| /// |
| /// This is used for the annotated names of `call`, and for the proposed name |
| /// for other instance methods. |
| - List<String> callSuffixForSignature(FunctionSignature sig) { |
| - List<String> suffixes = ['${sig.parameterCount}']; |
| - if (sig.optionalParametersAreNamed) { |
| - for (FormalElement param in sig.orderedOptionalParameters) { |
| - suffixes.add(param.name); |
| - } |
| - } |
| + List<String> callSuffixForSignature(ParameterStructure parameterStructure) { |
| + List<String> suffixes = ['${parameterStructure.totalParameters}']; |
| + suffixes.addAll(parameterStructure.namedParameters); |
| return suffixes; |
| } |