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

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

Issue 52263003: Implement least upper bound. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years 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/dart_types.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 "scanner/scannerlib.dart" show Token; 10 import "scanner/scannerlib.dart" show Token;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // is unique, but also emit closure classes after all other 124 // is unique, but also emit closure classes after all other
125 // classes (since the emitter sorts classes by their id). 125 // classes (since the emitter sorts classes by their id).
126 compiler.getNextFreeClassId(), 126 compiler.getNextFreeClassId(),
127 STATE_DONE) { 127 STATE_DONE) {
128 ClassElement superclass = methodElement.isInstanceMember() 128 ClassElement superclass = methodElement.isInstanceMember()
129 ? compiler.boundClosureClass 129 ? compiler.boundClosureClass
130 : compiler.closureClass; 130 : compiler.closureClass;
131 superclass.ensureResolved(compiler); 131 superclass.ensureResolved(compiler);
132 supertype = superclass.computeType(compiler); 132 supertype = superclass.computeType(compiler);
133 interfaces = const Link<DartType>(); 133 interfaces = const Link<DartType>();
134 allSupertypes = const Link<DartType>().prepend(supertype);
135 thisType = rawType = new InterfaceType(this); 134 thisType = rawType = new InterfaceType(this);
135 allSupertypesAndSelf =
136 superclass.allSupertypesAndSelf.extendClass(thisType);
136 } 137 }
137 138
138 bool isClosure() => true; 139 bool isClosure() => true;
139 140
140 Token position() => node.getBeginToken(); 141 Token position() => node.getBeginToken();
141 142
142 Node parseNode(DiagnosticListener listener) => node; 143 Node parseNode(DiagnosticListener listener) => node;
143 144
144 /** 145 /**
145 * The most outer method this closure is declared into. 146 * The most outer method this closure is declared into.
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 } 831 }
831 832
832 visitTryStatement(TryStatement node) { 833 visitTryStatement(TryStatement node) {
833 // TODO(ngeoffray): implement finer grain state. 834 // TODO(ngeoffray): implement finer grain state.
834 bool oldInTryStatement = inTryStatement; 835 bool oldInTryStatement = inTryStatement;
835 inTryStatement = true; 836 inTryStatement = true;
836 node.visitChildren(this); 837 node.visitChildren(this);
837 inTryStatement = oldInTryStatement; 838 inTryStatement = oldInTryStatement;
838 } 839 }
839 } 840 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698