Skip to content

Commit 52937b5

Browse files
committed
Convert to ES6 style Iterable<T>
1 parent 17355c2 commit 52937b5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/rush/src/taskRunner/TaskRunner.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class TaskRunner {
101101
this._currentActiveTasks = 0;
102102
console.log(`Executing a maximum of ${this._parallelism} simultaneous processes...${os.EOL}`);
103103

104-
this._checkForCyclicDependencies([...this._tasks.values()], []);
104+
this._checkForCyclicDependencies(this._tasks.values(), []);
105105

106106
// Precalculate the number of dependent packages
107107
this._tasks.forEach((task: ITask) => {
@@ -284,15 +284,15 @@ export default class TaskRunner {
284284
/**
285285
* Checks for projects that indirectly depend on themselves.
286286
*/
287-
private _checkForCyclicDependencies(tasks: ReadonlyArray<ITask>, dependencyChain: string[]): void {
287+
private _checkForCyclicDependencies(tasks: Iterable<ITask>, dependencyChain: string[]): void {
288288
for (const task of tasks) {
289289
if (dependencyChain.indexOf(task.name) >= 0) {
290290
throw new Error('A cyclic dependency was encountered:' + os.EOL
291291
+ ' ' + [...dependencyChain, task.name].reverse().join('\n -> ') + os.EOL
292292
+ 'Consider using the cyclicDependencyProjects option for rush.json.');
293293
}
294294
dependencyChain.push(task.name);
295-
this._checkForCyclicDependencies([...task.dependents], dependencyChain);
295+
this._checkForCyclicDependencies(task.dependents, dependencyChain);
296296
dependencyChain.pop();
297297
}
298298
}

0 commit comments

Comments
 (0)