Chromium Code Reviews| 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 elements; | 5 library elements; |
| 6 | 6 |
| 7 import 'dart:uri'; | 7 import 'dart:uri'; |
| 8 | 8 |
| 9 import 'modelx.dart'; | 9 import 'modelx.dart'; |
| 10 import '../tree/tree.dart'; | 10 import '../tree/tree.dart'; |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 abstract class CompilationUnitElement extends Element { | 464 abstract class CompilationUnitElement extends Element { |
| 465 Script get script; | 465 Script get script; |
| 466 PartOf get partTag; | 466 PartOf get partTag; |
| 467 | 467 |
| 468 void addMember(Element element, DiagnosticListener listener); | 468 void addMember(Element element, DiagnosticListener listener); |
| 469 void setPartOf(PartOf tag, DiagnosticListener listener); | 469 void setPartOf(PartOf tag, DiagnosticListener listener); |
| 470 bool get hasMembers; | 470 bool get hasMembers; |
| 471 } | 471 } |
| 472 | 472 |
| 473 abstract class LibraryElement extends Element implements ScopeContainerElement { | 473 abstract class LibraryElement extends Element implements ScopeContainerElement { |
| 474 /** | |
| 475 * The canonical uri for this library. | |
| 476 * | |
| 477 * For user libraries the canonical uri is the script uri. For platform | |
| 478 * libraries the canonical uri is of the form [:dart:x:], and for a patch | |
| 479 * library for [:dart:x:] the canonical uri is [:patch:_x:]. | |
|
ahe
2013/01/18 11:03:10
Why add an underscore?
Johnni Winther
2013/01/21 09:27:54
No need. The scheme is enough protection that we c
| |
| 480 */ | |
| 474 Uri get uri; | 481 Uri get uri; |
| 475 CompilationUnitElement get entryCompilationUnit; | 482 CompilationUnitElement get entryCompilationUnit; |
| 476 Link<CompilationUnitElement> get compilationUnits; | 483 Link<CompilationUnitElement> get compilationUnits; |
| 477 Link<LibraryTag> get tags; | 484 Link<LibraryTag> get tags; |
| 478 LibraryName get libraryTag; | 485 LibraryName get libraryTag; |
| 479 Link<Element> get exports; | 486 Link<Element> get exports; |
| 480 | 487 |
| 488 /** | |
| 489 * [:true:] if this library is part of the platform, i.e. its canonical | |
|
ahe
2013/01/18 11:03:10
i.e. -> that is (not all of us have studied ancien
Johnni Winther
2013/01/21 09:27:54
Well, I didn't write 'id est' ;-)
| |
| 490 * uri has the scheme 'dart'. | |
| 491 */ | |
| 481 bool get isPlatformLibrary; | 492 bool get isPlatformLibrary; |
| 493 | |
| 494 /** | |
| 495 * [:true:] if this library is a platform library whose path starts with | |
|
ahe
2013/01/18 11:03:10
I'm concerned about this approach. It seems brittl
Johnni Winther
2013/01/21 09:27:54
The security is based on the [isPlatformLibrary] c
| |
| 496 * an underscore. | |
| 497 */ | |
| 498 bool get isPrivateLibrary; | |
| 482 bool get canUseNative; | 499 bool get canUseNative; |
| 483 bool get exportsHandled; | 500 bool get exportsHandled; |
| 484 | 501 |
| 485 // TODO(kasperl): We should try to get rid of these. | 502 // TODO(kasperl): We should try to get rid of these. |
| 486 void set canUseNative(bool value); | 503 void set canUseNative(bool value); |
| 487 void set libraryTag(LibraryName value); | 504 void set libraryTag(LibraryName value); |
| 488 | 505 |
| 489 LibraryElement get implementation; | 506 LibraryElement get implementation; |
| 490 | 507 |
| 491 void addCompilationUnit(CompilationUnitElement element); | 508 void addCompilationUnit(CompilationUnitElement element); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 753 Element get annotatedElement; | 770 Element get annotatedElement; |
| 754 int get resolutionState; | 771 int get resolutionState; |
| 755 Token get beginToken; | 772 Token get beginToken; |
| 756 | 773 |
| 757 // TODO(kasperl): Try to get rid of these. | 774 // TODO(kasperl): Try to get rid of these. |
| 758 void set annotatedElement(Element value); | 775 void set annotatedElement(Element value); |
| 759 void set resolutionState(int value); | 776 void set resolutionState(int value); |
| 760 | 777 |
| 761 MetadataAnnotation ensureResolved(Compiler compiler); | 778 MetadataAnnotation ensureResolved(Compiler compiler); |
| 762 } | 779 } |
| OLD | NEW |