| 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 dart2js.resolution.scope; | 5 library dart2js.resolution.scope; |
| 6 | 6 |
| 7 import '../dart_types.dart'; | 7 import '../elements/resolution_types.dart'; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 | 9 |
| 10 abstract class Scope { | 10 abstract class Scope { |
| 11 /** | 11 /** |
| 12 * If an [Element] named `element.name` has already been added to this | 12 * If an [Element] named `element.name` has already been added to this |
| 13 * [Scope], return that element and make no changes. If no such element has | 13 * [Scope], return that element and make no changes. If no such element has |
| 14 * been added, add the given [element] to this [Scope], and return [element]. | 14 * been added, add the given [element] to this [Scope], and return [element]. |
| 15 * Note that this operation is only allowed on mutable scopes such as | 15 * Note that this operation is only allowed on mutable scopes such as |
| 16 * [MethodScope] and [BlockScope]. | 16 * [MethodScope] and [BlockScope]. |
| 17 */ | 17 */ |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 Element localLookup(String name) => library.find(name); | 222 Element localLookup(String name) => library.find(name); |
| 223 Element lookup(String name) => localLookup(name); | 223 Element lookup(String name) => localLookup(name); |
| 224 | 224 |
| 225 Element add(Element newElement) { | 225 Element add(Element newElement) { |
| 226 throw "Cannot add an element to a library scope"; | 226 throw "Cannot add an element to a library scope"; |
| 227 } | 227 } |
| 228 | 228 |
| 229 String toString() => 'LibraryScope($library)'; | 229 String toString() => 'LibraryScope($library)'; |
| 230 } | 230 } |
| OLD | NEW |