Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/closure.dart

Issue 409473002: A bit of element model cleanup. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698