Add 'clear' helper (#17209)

This commit is contained in:
Andy
2017-07-18 11:08:44 -07:00
committed by GitHub
parent 194c2bc2ca
commit 08a57d82cd
6 changed files with 12 additions and 8 deletions

View File

@@ -223,7 +223,7 @@ namespace ts.server {
for (const reference of this.references) {
reference.removeReferencedBy(this);
}
this.references = createSortedArray<ModuleBuilderFileInfo>();
clear(this.references);
}
}

View File

@@ -242,7 +242,7 @@ namespace ts.server {
// detach is unnecessary since we'll clean the list of containing projects anyways
p.removeFile(this, /*detachFromProjects*/ false);
}
this.containingProjects.length = 0;
clear(this.containingProjects);
}
getDefaultProject() {