| Index: dart/frog/leg/ssa/codegen.dart
|
| diff --git a/dart/frog/leg/ssa/codegen.dart b/dart/frog/leg/ssa/codegen.dart
|
| index 0f58f29cd7a6ee9c84bf7f883acd856c5dddfdca..322cf34a1462e921f26f1a831d1798baf824c35c 100644
|
| --- a/dart/frog/leg/ssa/codegen.dart
|
| +++ b/dart/frog/leg/ssa/codegen.dart
|
| @@ -638,8 +638,21 @@ class SsaCodeGenerator implements HVisitor {
|
| // Remove the element and 'this'.
|
| int argumentCount = node.inputs.length - 2;
|
| String className = compiler.namer.isolatePropertyAccess(superClass);
|
| - String methodName = compiler.namer.instanceMethodName(
|
| - currentLibrary, superMethod.name, argumentCount);
|
| + String methodName;
|
| + if (superMethod.kind == ElementKind.FUNCTION ||
|
| + superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
|
| + methodName = compiler.namer.instanceMethodName(
|
| + currentLibrary, superMethod.name, argumentCount);
|
| + } else {
|
| + methodName = compiler.namer.getterName(currentLibrary, superMethod.name);
|
| + // We need to register the name to ensure that the emitter
|
| + // generates the necessary getter.
|
| + // TODO(ahe): This is not optimal for tree-shaking, but we lack
|
| + // API to register the precise information. In this case, the
|
| + // enclosingElement of superMethod needs the getter, no other
|
| + // class (not even its subclasses).
|
| + compiler.registerDynamicGetter(superMethod.name);
|
| + }
|
| buffer.add('$className.prototype.$methodName.call');
|
| visitArguments(node.inputs);
|
| endExpression(JSPrecedence.CALL_PRECEDENCE);
|
|
|