Ensure computed property names are always checked (#37307)

This commit is contained in:
Wesley Wigham
2020-03-25 15:16:54 -07:00
committed by GitHub
parent 6c1e8aa0ad
commit 4567fc4f1a
5 changed files with 242 additions and 0 deletions

View File

@@ -22808,6 +22808,15 @@ namespace ts {
let hasComputedStringProperty = false;
let hasComputedNumberProperty = false;
// Spreads may cause an early bail; ensure computed names are always checked (this is cached)
// As otherwise they may not be checked until exports for the type at this position are retrieved,
// which may never occur.
for (const elem of node.properties) {
if (elem.name && isComputedPropertyName(elem.name) && !isWellKnownSymbolSyntactically(elem.name)) {
checkComputedPropertyName(elem.name);
}
}
let offset = 0;
for (let i = 0; i < node.properties.length; i++) {
const memberDecl = node.properties[i];