Check hasOwnProperty before copying property

This commit is contained in:
Andrew Casey 2017-11-20 18:43:14 -08:00
parent 9cbe4eb614
commit 71e07df817

View file

@ -528,9 +528,11 @@ namespace ts.server {
// raw is now fixed and ready
this.safelist = raw.typesMap;
for (const key in raw.simpleMap) {
if (raw.simpleMap.hasOwnProperty(key)) {
this.legacySafelist[key] = raw.simpleMap[key].toLowerCase();
}
}
}
catch (e) {
this.logger.info(`Error loading types map: ${e}`);
this.safelist = defaultTypeSafeList;