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

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

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 org_dartlang_compiler_util; 5 part of org_dartlang_compiler_util;
6 6
7 class Link<T> { 7 class Link<T> {
8 T get head => null; 8 T get head => null;
9 Link<T> get tail => null; 9 Link<T> get tail => null;
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // TODO(ahe): Remove this method? 100 // TODO(ahe): Remove this method?
101 T get first { 101 T get first {
102 if (isEmpty) throw new StateError('No elements'); 102 if (isEmpty) throw new StateError('No elements');
103 return head; 103 return head;
104 } 104 }
105 } 105 }
106 106
107 abstract class LinkBuilder<T> { 107 abstract class LinkBuilder<T> {
108 factory LinkBuilder() = LinkBuilderImplementation; 108 factory LinkBuilder() = LinkBuilderImplementation;
109 109
110 Link<T> toLink(); 110 /**
111 * Prepends all elements added to the builder to [tail]. The resulting list is
112 * returned and the builder is cleared.
113 */
114 Link<T> toLink([Link<T> tail = const Link()]);
115
111 void addLast(T t); 116 void addLast(T t);
112 117
113 final int length; 118 final int length;
114 final bool isEmpty; 119 final bool isEmpty;
115 } 120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698