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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 12211045: Allow ambiguous Expect and ExpectException imports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import 'dart:uri'; 7 import 'dart:uri';
8 8
9 import 'elements.dart'; 9 import 'elements.dart';
10 import '../../compiler.dart' as api; 10 import '../../compiler.dart' as api;
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 /** 593 /**
594 * Adds [element] to the import scope of this library. 594 * Adds [element] to the import scope of this library.
595 * 595 *
596 * If an element by the same name is already in the imported scope, an 596 * If an element by the same name is already in the imported scope, an
597 * [ErroneousElement] will be put in the imported scope, allowing for the 597 * [ErroneousElement] will be put in the imported scope, allowing for the
598 * detection of ambiguous uses of imported names. 598 * detection of ambiguous uses of imported names.
599 */ 599 */
600 void addImport(Element element, DiagnosticListener listener) { 600 void addImport(Element element, DiagnosticListener listener) {
601 Element existing = importScope[element.name]; 601 Element existing = importScope[element.name];
602 if (existing != null) { 602 if (existing != null) {
603 if (element.name == const SourceString("Expect") ||
Johnni Winther 2013/02/07 12:01:41 Add a TODO.
floitsch 2013/02/11 17:59:32 Done.
604 element.name == const SourceString("ExpectException")) {
605 return;
606 }
603 // TODO(johnniwinther): Provide access to the import tags from which 607 // TODO(johnniwinther): Provide access to the import tags from which
604 // the elements came. 608 // the elements came.
605 importScope[element.name] = new AmbiguousElementX( 609 importScope[element.name] = new AmbiguousElementX(
606 MessageKind.DUPLICATE_IMPORT, {'name': element.name}, 610 MessageKind.DUPLICATE_IMPORT, {'name': element.name},
607 this, existing, element); 611 this, existing, element);
608 } else { 612 } else {
609 importScope[element.name] = element; 613 importScope[element.name] = element;
610 } 614 }
611 } 615 }
612 616
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 1976
1973 MetadataAnnotation ensureResolved(Compiler compiler) { 1977 MetadataAnnotation ensureResolved(Compiler compiler) {
1974 if (resolutionState == STATE_NOT_STARTED) { 1978 if (resolutionState == STATE_NOT_STARTED) {
1975 compiler.resolver.resolveMetadataAnnotation(this); 1979 compiler.resolver.resolveMetadataAnnotation(this);
1976 } 1980 }
1977 return this; 1981 return this;
1978 } 1982 }
1979 1983
1980 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 1984 String toString() => 'MetadataAnnotation($value, $resolutionState)';
1981 } 1985 }
OLDNEW
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698