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

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java

Issue 12211045: Allow ambiguous Expect and ExpectException imports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added TODO. Created 7 years, 10 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
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698