| 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 'elements.dart'; | 7 import 'elements.dart'; |
| 8 import '../helpers/helpers.dart'; | 8 import '../helpers/helpers.dart'; |
| 9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
| 10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 | 963 |
| 964 bool get isPlatformLibrary => canonicalUri.scheme == 'dart'; | 964 bool get isPlatformLibrary => canonicalUri.scheme == 'dart'; |
| 965 | 965 |
| 966 bool get isPackageLibrary => canonicalUri.scheme == 'package'; | 966 bool get isPackageLibrary => canonicalUri.scheme == 'package'; |
| 967 | 967 |
| 968 bool get isInternalLibrary => | 968 bool get isInternalLibrary => |
| 969 isPlatformLibrary && canonicalUri.path.startsWith('_'); | 969 isPlatformLibrary && canonicalUri.path.startsWith('_'); |
| 970 | 970 |
| 971 String toString() { | 971 String toString() { |
| 972 if (origin != null) { | 972 if (origin != null) { |
| 973 return 'patch library(${getLibraryOrScriptName()})'; | 973 return 'patch library(${canonicalUri})'; |
| 974 } else if (patch != null) { | 974 } else if (patch != null) { |
| 975 return 'origin library(${getLibraryOrScriptName()})'; | 975 return 'origin library(${canonicalUri})'; |
| 976 } else { | 976 } else { |
| 977 return 'library(${getLibraryOrScriptName()})'; | 977 return 'library(${canonicalUri})'; |
| 978 } | 978 } |
| 979 } | 979 } |
| 980 | 980 |
| 981 int compareTo(LibraryElement other) { | 981 int compareTo(LibraryElement other) { |
| 982 if (this == other) return 0; | 982 if (this == other) return 0; |
| 983 return getLibraryOrScriptName().compareTo(other.getLibraryOrScriptName()); | 983 return getLibraryOrScriptName().compareTo(other.getLibraryOrScriptName()); |
| 984 } | 984 } |
| 985 | 985 |
| 986 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); | 986 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); |
| 987 | 987 |
| (...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2577 assert(invariant(this, this.origin == null, | 2577 assert(invariant(this, this.origin == null, |
| 2578 message: "Origin element is a patch.")); | 2578 message: "Origin element is a patch.")); |
| 2579 assert(invariant(patch, patch.origin == null, | 2579 assert(invariant(patch, patch.origin == null, |
| 2580 message: "Element is patched twice.")); | 2580 message: "Element is patched twice.")); |
| 2581 assert(invariant(patch, patch.patch == null, | 2581 assert(invariant(patch, patch.patch == null, |
| 2582 message: "Patch element is patched.")); | 2582 message: "Patch element is patched.")); |
| 2583 this.patch = patch; | 2583 this.patch = patch; |
| 2584 patch.origin = this; | 2584 patch.origin = this; |
| 2585 } | 2585 } |
| 2586 } | 2586 } |
| OLD | NEW |