Skip to content

Commit 376df41

Browse files
author
Andy
authored
Merge pull request #15609 from Microsoft/jsx-redundant-code
Remove some redundant code in createJsxAttributesTypeFromAttributesProperty
2 parents 35a6797 + d36175b commit 376df41

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13301,19 +13301,15 @@ namespace ts {
1330113301
if (spread !== emptyObjectType) {
1330213302
if (attributesArray.length > 0) {
1330313303
spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable));
13304-
attributesArray = [];
13305-
attributesTable = createMap<Symbol>();
1330613304
}
1330713305
attributesArray = getPropertiesOfType(spread);
1330813306
}
1330913307

1331013308
attributesTable = createMap<Symbol>();
13311-
if (attributesArray) {
13312-
forEach(attributesArray, (attr) => {
13313-
if (!filter || filter(attr)) {
13314-
attributesTable.set(attr.name, attr);
13315-
}
13316-
});
13309+
for (const attr of attributesArray) {
13310+
if (!filter || filter(attr)) {
13311+
attributesTable.set(attr.name, attr);
13312+
}
1331713313
}
1331813314
}
1331913315

0 commit comments

Comments
 (0)