chore(runner): remove unnecessary traversal (#17415)

This commit is contained in:
Yury Semikhatsky 2022-09-16 15:45:52 -07:00 committed by GitHub
parent 8d639ae50e
commit ee83694372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,15 +282,10 @@ export class FixturePool {
}
validateFunction(fn: Function, prefix: string, location: Location) {
const visit = (registration: FixtureRegistration) => {
for (const name of registration.deps)
visit(this.resolveDependency(registration, name)!);
};
for (const name of fixtureParameterNames(fn, location)) {
const registration = this.registrations.get(name);
if (!registration)
throw errorWithLocations(`${prefix} has unknown parameter "${name}".`, { location, name: prefix, quoted: false });
visit(registration);
}
}