| Index: pkg/kernel/lib/canonical_name.dart
|
| diff --git a/pkg/kernel/lib/canonical_name.dart b/pkg/kernel/lib/canonical_name.dart
|
| index a56c482c23264d8f147c4f5d1f8c2d08833843f3..375453e4c423cb5ac0f42cfb492bf068187d8900 100644
|
| --- a/pkg/kernel/lib/canonical_name.dart
|
| +++ b/pkg/kernel/lib/canonical_name.dart
|
| @@ -57,7 +57,7 @@ import 'ast.dart';
|
| /// The "qualified name" allows a member to have a name that is private to
|
| /// a library other than the one containing that member.
|
| class CanonicalName {
|
| - final CanonicalName parent;
|
| + CanonicalName _parent;
|
| final String name;
|
|
|
| Map<String, CanonicalName> _children;
|
| @@ -68,16 +68,16 @@ class CanonicalName {
|
| /// Temporary index used during serialization.
|
| int index = -1;
|
|
|
| - CanonicalName._(this.parent, this.name) {
|
| + CanonicalName._(this._parent, this.name) {
|
| assert(name != null);
|
| }
|
|
|
| - CanonicalName.root()
|
| - : parent = null,
|
| - name = '';
|
| + CanonicalName.root() : name = '';
|
|
|
| bool get isRoot => parent == null;
|
|
|
| + CanonicalName get parent => _parent;
|
| +
|
| Iterable<CanonicalName> get children =>
|
| _children?.values ?? const <CanonicalName>[];
|
|
|
| @@ -112,6 +112,13 @@ class CanonicalName {
|
| _children?.remove(name);
|
| }
|
|
|
| + /// Transplant the given [child] into this name.
|
| + void transplantChild(CanonicalName child) {
|
| + var map = _children ??= <String, CanonicalName>{};
|
| + map[child.name] = child;
|
| + child._parent = this;
|
| + }
|
| +
|
| void bindTo(Reference target) {
|
| if (reference == target) return;
|
| if (reference != null) {
|
|
|