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 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
6 | 6 |
7 import com.google.common.annotations.VisibleForTesting; | 7 import com.google.common.annotations.VisibleForTesting; |
8 import com.google.common.collect.Lists; | 8 import com.google.common.collect.Lists; |
9 import com.google.common.collect.Maps; | 9 import com.google.common.collect.Maps; |
10 import com.google.common.collect.Sets; | 10 import com.google.common.collect.Sets; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 scopeForImport = importScope; | 141 scopeForImport = importScope; |
142 } | 142 } |
143 } | 143 } |
144 // Prepare "lib" scope. | 144 // Prepare "lib" scope. |
145 fillInLibraryScope(lib, listener, processedObjects); | 145 fillInLibraryScope(lib, listener, processedObjects); |
146 // Fill "library" scope with element exported from "lib". | 146 // Fill "library" scope with element exported from "lib". |
147 for (Element element : lib.getElement().getExportedElements()) { | 147 for (Element element : lib.getElement().getExportedElements()) { |
148 String name = element.getName(); | 148 String name = element.getName(); |
149 if (libraryImport.isVisible(name)) { | 149 if (libraryImport.isVisible(name)) { |
150 Element oldElement = scopeForImport.declareElement(name, element); | 150 Element oldElement = scopeForImport.declareElement(name, element); |
151 if (oldElement != null) { | 151 // TODO(8474): Remove the "Expect" special casing. |
| 152 if (oldElement != null |
| 153 && !name.equals("Expect") && !name.equals("ExpectException")) { |
152 scopeForImport.declareElement(name, | 154 scopeForImport.declareElement(name, |
153 Elements.createDuplicateElement(oldElement, element)); | 155 Elements.createDuplicateElement(oldElement, element)); |
154 } | 156 } |
155 } | 157 } |
156 } | 158 } |
157 } | 159 } |
158 | 160 |
159 // Fill "library" export scope with re-exports. | 161 // Fill "library" export scope with re-exports. |
160 for (LibraryExport export : library.getExports()) { | 162 for (LibraryExport export : library.getExports()) { |
161 if (!processedObjects.add(export)) { | 163 if (!processedObjects.add(export)) { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 316 } |
315 | 317 |
316 @Override | 318 @Override |
317 public Void visitField(DartField node) { | 319 public Void visitField(DartField node) { |
318 Modifiers modifiers = node.getModifiers(); | 320 Modifiers modifiers = node.getModifiers(); |
319 node.setElement(Elements.fieldFromNode(node, library, node.getObsoleteMeta
data(), modifiers)); | 321 node.setElement(Elements.fieldFromNode(node, library, node.getObsoleteMeta
data(), modifiers)); |
320 return null; | 322 return null; |
321 } | 323 } |
322 } | 324 } |
323 } | 325 } |
OLD | NEW |