| Index: pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
|
| diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
|
| index 5fc4d0cae242c9f5f54a8cdca0456b9e3bd5334d..aa88a7a043599636f34fe8835510a72a04921424 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
|
| @@ -168,10 +168,14 @@ class TypeTestEmitter extends CodeEmitterHelper {
|
| call = cls.lookupBackendMember(Compiler.CALL_OPERATOR_NAME);
|
| }
|
| if (call != null && call.isFunction) {
|
| - generateInterfacesIsTests(compiler.functionClass,
|
| - emitIsTest,
|
| - emitSubstitution,
|
| - generated);
|
| + // A superclass might already implement the Function interface. In such
|
| + // a case, we can avoid emiting the is test here.
|
| + if (!cls.superclass.implementsFunction(compiler)) {
|
| + generateInterfacesIsTests(compiler.functionClass,
|
| + emitIsTest,
|
| + emitSubstitution,
|
| + generated);
|
| + }
|
| FunctionType callType = call.computeType(compiler);
|
| Map<FunctionType, bool> functionTypeChecks =
|
| getFunctionTypeChecksOn(callType);
|
|
|