| 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 library closureToClassMapper; | 5 library closureToClassMapper; |
| 6 | 6 |
| 7 import "elements/elements.dart"; | 7 import "elements/elements.dart"; |
| 8 import "dart2jslib.dart"; | 8 import "dart2jslib.dart"; |
| 9 import "dart_types.dart"; | 9 import "dart_types.dart"; |
| 10 import "js_backend/js_backend.dart" show JavaScriptBackend; | 10 import "js_backend/js_backend.dart" show JavaScriptBackend; |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 if (arguments != null) { | 637 if (arguments != null) { |
| 638 visit(arguments); | 638 visit(arguments); |
| 639 } | 639 } |
| 640 } else { | 640 } else { |
| 641 visit(definition); | 641 visit(definition); |
| 642 } | 642 } |
| 643 } | 643 } |
| 644 } | 644 } |
| 645 | 645 |
| 646 visitTypeAnnotation(TypeAnnotation node) { | 646 visitTypeAnnotation(TypeAnnotation node) { |
| 647 Element member = executableContext.enclosingMember; | 647 MemberElement member = executableContext.memberContext; |
| 648 DartType type = elements.getType(node); | 648 DartType type = elements.getType(node); |
| 649 // TODO(karlklose,johnniwinther): if the type is null, the annotation is | 649 // TODO(karlklose,johnniwinther): if the type is null, the annotation is |
| 650 // from a parameter which has been analyzed before the method has been | 650 // from a parameter which has been analyzed before the method has been |
| 651 // resolved and the result has been thrown away. | 651 // resolved and the result has been thrown away. |
| 652 if (compiler.enableTypeAssertions && type != null && | 652 if (compiler.enableTypeAssertions && type != null && |
| 653 type.containsTypeVariables) { | 653 type.containsTypeVariables) { |
| 654 if (insideClosure && member.isFactoryConstructor) { | 654 if (insideClosure && member.isFactoryConstructor) { |
| 655 // This is a closure in a factory constructor. Since there is no | 655 // This is a closure in a factory constructor. Since there is no |
| 656 // [:this:], we have to mark the type arguments as free variables to | 656 // [:this:], we have to mark the type arguments as free variables to |
| 657 // capture them in the closure. | 657 // capture them in the closure. |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 | 1024 |
| 1025 String get name => typeVariable.name; | 1025 String get name => typeVariable.name; |
| 1026 | 1026 |
| 1027 int get hashCode => typeVariable.hashCode; | 1027 int get hashCode => typeVariable.hashCode; |
| 1028 | 1028 |
| 1029 bool operator ==(other) { | 1029 bool operator ==(other) { |
| 1030 if (other is! TypeVariableLocal) return false; | 1030 if (other is! TypeVariableLocal) return false; |
| 1031 return typeVariable == other.typeVariable; | 1031 return typeVariable == other.typeVariable; |
| 1032 } | 1032 } |
| 1033 } | 1033 } |
| OLD | NEW |