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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
731 // Use the file name as script name. | 731 // Use the file name as script name. |
732 String path = uri.path; | 732 String path = uri.path; |
733 return path.substring(path.lastIndexOf('/') + 1); | 733 return path.substring(path.lastIndexOf('/') + 1); |
734 } | 734 } |
735 } | 735 } |
736 | 736 |
737 Scope buildScope() => new LibraryScope(this); | 737 Scope buildScope() => new LibraryScope(this); |
738 | 738 |
739 bool get isPlatformLibrary => uri.scheme == "dart"; | 739 bool get isPlatformLibrary => uri.scheme == "dart"; |
740 | 740 |
741 bool get isPrivateLibrary => isPlatformLibrary && uri.path.startsWith('_'); | |
ahe
2013/01/18 11:03:10
This scares me. The uri.path is potentially from u
Johnni Winther
2013/01/21 09:27:54
[uri] is the canonical uri which we filter in [tra
| |
742 | |
741 String toString() { | 743 String toString() { |
742 if (origin != null) { | 744 if (origin != null) { |
743 return 'patch library(${getLibraryOrScriptName()})'; | 745 return 'patch library(${getLibraryOrScriptName()})'; |
744 } else if (patch != null) { | 746 } else if (patch != null) { |
745 return 'origin library(${getLibraryOrScriptName()})'; | 747 return 'origin library(${getLibraryOrScriptName()})'; |
746 } else { | 748 } else { |
747 return 'library(${getLibraryOrScriptName()})'; | 749 return 'library(${getLibraryOrScriptName()})'; |
748 } | 750 } |
749 } | 751 } |
750 } | 752 } |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1857 | 1859 |
1858 MetadataAnnotation ensureResolved(Compiler compiler) { | 1860 MetadataAnnotation ensureResolved(Compiler compiler) { |
1859 if (resolutionState == STATE_NOT_STARTED) { | 1861 if (resolutionState == STATE_NOT_STARTED) { |
1860 compiler.resolver.resolveMetadataAnnotation(this); | 1862 compiler.resolver.resolveMetadataAnnotation(this); |
1861 } | 1863 } |
1862 return this; | 1864 return this; |
1863 } | 1865 } |
1864 | 1866 |
1865 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1867 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
1866 } | 1868 } |
OLD | NEW |