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

Side by Side Diff: lib/compiler/implementation/resolution/scope.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 2 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) 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 resolution; 5 part of resolution;
6 6
7 abstract class Scope { 7 abstract class Scope {
8 /** 8 /**
9 * Adds [element] to this scope. This operation is only allowed on mutable 9 * Adds [element] to this scope. This operation is only allowed on mutable
10 * scopes such as [MethodScope] and [BlockScope]. 10 * scopes such as [MethodScope] and [BlockScope].
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 : super(parent) { 55 : super(parent) {
56 assert(parent != null); 56 assert(parent != null);
57 } 57 }
58 58
59 Element add(Element newElement) { 59 Element add(Element newElement) {
60 throw "Cannot add element to TypeDeclarationScope"; 60 throw "Cannot add element to TypeDeclarationScope";
61 } 61 }
62 62
63 Element lookupTypeVariable(SourceString name) { 63 Element lookupTypeVariable(SourceString name) {
64 Link<DartType> typeVariableLink = element.typeVariables; 64 Link<DartType> typeVariableLink = element.typeVariables;
65 while (!typeVariableLink.isEmpty()) { 65 while (!typeVariableLink.isEmpty) {
66 TypeVariableType typeVariable = typeVariableLink.head; 66 TypeVariableType typeVariable = typeVariableLink.head;
67 if (typeVariable.name == name) { 67 if (typeVariable.name == name) {
68 return typeVariable.element; 68 return typeVariable.element;
69 } 69 }
70 typeVariableLink = typeVariableLink.tail; 70 typeVariableLink = typeVariableLink.tail;
71 } 71 }
72 return null; 72 return null;
73 } 73 }
74 74
75 Element localLookup(SourceString name) => lookupTypeVariable(name); 75 Element localLookup(SourceString name) => lookupTypeVariable(name);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 Element localLookup(SourceString name) => library.find(name); 155 Element localLookup(SourceString name) => library.find(name);
156 Element lookup(SourceString name) => localLookup(name); 156 Element lookup(SourceString name) => localLookup(name);
157 157
158 Element add(Element newElement) { 158 Element add(Element newElement) {
159 throw "Cannot add an element to a library scope"; 159 throw "Cannot add an element to a library scope";
160 } 160 }
161 161
162 String toString() => 'LibraryScope($library)'; 162 String toString() => 'LibraryScope($library)';
163 } 163 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/resolution/members.dart ('k') | lib/compiler/implementation/runtime_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698