refactor: use for-of instead of for simple array iteration (#39338)

This commit is contained in:
Milan Burda 2023-08-07 11:30:15 +02:00 committed by GitHub
parent 67523a47b4
commit 3d45429667
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 20 deletions

View file

@ -133,14 +133,14 @@ describe('renderer nodeIntegrationInSubFrames', () => {
const generateConfigs = (webPreferences: any, ...permutations: {name: string, webPreferences: any}[]) => {
const configs = [{ webPreferences, names: [] as string[] }];
for (let i = 0; i < permutations.length; i++) {
for (const permutation of permutations) {
const length = configs.length;
for (let j = 0; j < length; j++) {
const newConfig = Object.assign({}, configs[j]);
newConfig.webPreferences = Object.assign({},
newConfig.webPreferences, permutations[i].webPreferences);
newConfig.webPreferences, permutation.webPreferences);
newConfig.names = newConfig.names.slice(0);
newConfig.names.push(permutations[i].name);
newConfig.names.push(permutation.name);
configs.push(newConfig);
}
}