OLD | NEW |
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 Loading... |
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 // TODO(8474): Remove the "Expect" special casing. |
| 604 if (element.name == const SourceString("Expect") || |
| 605 element.name == const SourceString("ExpectException")) { |
| 606 return; |
| 607 } |
603 // TODO(johnniwinther): Provide access to the import tags from which | 608 // TODO(johnniwinther): Provide access to the import tags from which |
604 // the elements came. | 609 // the elements came. |
605 importScope[element.name] = new AmbiguousElementX( | 610 importScope[element.name] = new AmbiguousElementX( |
606 MessageKind.DUPLICATE_IMPORT, {'name': element.name}, | 611 MessageKind.DUPLICATE_IMPORT, {'name': element.name}, |
607 this, existing, element); | 612 this, existing, element); |
608 } else { | 613 } else { |
609 importScope[element.name] = element; | 614 importScope[element.name] = element; |
610 } | 615 } |
611 } | 616 } |
612 | 617 |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 | 1977 |
1973 MetadataAnnotation ensureResolved(Compiler compiler) { | 1978 MetadataAnnotation ensureResolved(Compiler compiler) { |
1974 if (resolutionState == STATE_NOT_STARTED) { | 1979 if (resolutionState == STATE_NOT_STARTED) { |
1975 compiler.resolver.resolveMetadataAnnotation(this); | 1980 compiler.resolver.resolveMetadataAnnotation(this); |
1976 } | 1981 } |
1977 return this; | 1982 return this; |
1978 } | 1983 } |
1979 | 1984 |
1980 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1985 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
1981 } | 1986 } |
OLD | NEW |