From fd1995e1e36bf799ba5fa283b8be7f3973d3a51a Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Fri, 27 Jul 2018 11:44:17 -0700 Subject: [PATCH] fix(@angular-devkit/schematics): implement optimize() for HostTree Its only used by old Schematics library, which can end up in there. Since optimization is only a thing for VirtualTree, HostTree returns itself. --- packages/angular_devkit/schematics/src/tree/host-tree.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/angular_devkit/schematics/src/tree/host-tree.ts b/packages/angular_devkit/schematics/src/tree/host-tree.ts index 3772835dad4d..70b4fd710023 100644 --- a/packages/angular_devkit/schematics/src/tree/host-tree.ts +++ b/packages/angular_devkit/schematics/src/tree/host-tree.ts @@ -134,6 +134,12 @@ export class HostTree implements Tree { return this._record.willRename(path); } + // This can be used by old Schematics library with new Trees in some corner cases. + // TODO: remove this for 7.0 + optimize() { + return this; + } + branch(): Tree { const branchedTree = new HostTree(this._backend); branchedTree._record = this._record.clone();