Object rest skips only class methods

Previously, it skipped all methods
This commit is contained in:
Nathan Shively-Sanders
2017-01-10 08:55:46 -08:00
parent c9e301f236
commit 945e65f4d8

View File

@@ -3125,9 +3125,8 @@ namespace ts {
for (const prop of getPropertiesOfType(source)) {
const inNamesToRemove = prop.name in names;
const isPrivate = getDeclarationModifierFlagsFromSymbol(prop) & (ModifierFlags.Private | ModifierFlags.Protected);
const isMethod = prop.flags & SymbolFlags.Method;
const isSetOnlyAccessor = prop.flags & SymbolFlags.SetAccessor && !(prop.flags & SymbolFlags.GetAccessor);
if (!inNamesToRemove && !isPrivate && !isMethod && !isSetOnlyAccessor) {
if (!inNamesToRemove && !isPrivate && !isClassMethod(prop) && !isSetOnlyAccessor) {
members[prop.name] = prop;
}
}