| 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 part of js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
| 9 * from the given element. | 9 * from the given element. |
| 10 */ | 10 */ |
| (...skipping 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 if (checkedClasses.contains(cls)) { | 2022 if (checkedClasses.contains(cls)) { |
| 2023 emitIsTest(cls); | 2023 emitIsTest(cls); |
| 2024 emitSubstitution(cls); | 2024 emitSubstitution(cls); |
| 2025 } | 2025 } |
| 2026 | 2026 |
| 2027 RuntimeTypes rti = backend.rti; | 2027 RuntimeTypes rti = backend.rti; |
| 2028 ClassElement superclass = cls.superclass; | 2028 ClassElement superclass = cls.superclass; |
| 2029 | 2029 |
| 2030 bool haveSameTypeVariables(ClassElement a, ClassElement b) { | 2030 bool haveSameTypeVariables(ClassElement a, ClassElement b) { |
| 2031 if (a.isClosure()) return true; | 2031 if (a.isClosure()) return true; |
| 2032 if (b.isUnnamedMixinApplication) { |
| 2033 return false; |
| 2034 } |
| 2032 return a.typeVariables == b.typeVariables; | 2035 return a.typeVariables == b.typeVariables; |
| 2033 } | 2036 } |
| 2034 | 2037 |
| 2035 if (superclass != null && superclass != compiler.objectClass && | 2038 if (superclass != null && superclass != compiler.objectClass && |
| 2036 !haveSameTypeVariables(cls, superclass)) { | 2039 !haveSameTypeVariables(cls, superclass)) { |
| 2037 // We cannot inherit the generated substitutions, because the type | 2040 // We cannot inherit the generated substitutions, because the type |
| 2038 // variable layout for this class is different. Instead we generate | 2041 // variable layout for this class is different. Instead we generate |
| 2039 // substitutions for all checks and make emitSubstitution a NOP for the | 2042 // substitutions for all checks and make emitSubstitution a NOP for the |
| 2040 // rest of this function. | 2043 // rest of this function. |
| 2041 Set<ClassElement> emitted = new Set<ClassElement>(); | 2044 Set<ClassElement> emitted = new Set<ClassElement>(); |
| (...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4043 | 4046 |
| 4044 const String HOOKS_API_USAGE = """ | 4047 const String HOOKS_API_USAGE = """ |
| 4045 // The code supports the following hooks: | 4048 // The code supports the following hooks: |
| 4046 // dartPrint(message) - if this function is defined it is called | 4049 // dartPrint(message) - if this function is defined it is called |
| 4047 // instead of the Dart [print] method. | 4050 // instead of the Dart [print] method. |
| 4048 // dartMainRunner(main) - if this function is defined, the Dart [main] | 4051 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 4049 // method will not be invoked directly. | 4052 // method will not be invoked directly. |
| 4050 // Instead, a closure that will invoke [main] is | 4053 // Instead, a closure that will invoke [main] is |
| 4051 // passed to [dartMainRunner]. | 4054 // passed to [dartMainRunner]. |
| 4052 """; | 4055 """; |
| OLD | NEW |