Added a Object.prototype.propertyIsEnumerable check to __rest to prevent enumerable symbols from sneaking through.

This commit is contained in:
Nicholas Yang 2019-01-31 17:44:19 -05:00
parent a539887893
commit 80d8e660d7

View file

@ -521,8 +521,10 @@ namespace ts {
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable(p[i]))
t[p[i]] = s[p[i]];
}
return t;
};`
};