Skip to content

Commit

Permalink
Added a Object.prototype.propertyIsEnumerable check to __rest to prev…
Browse files Browse the repository at this point in the history
…ent enumerable symbols from sneaking through.
  • Loading branch information
NicholasLYang committed Apr 30, 2019
1 parent a539887 commit 80d8e66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/compiler/transformers/destructuring.ts
Expand Up @@ -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;
};`
};
Expand Down

0 comments on commit 80d8e66

Please sign in to comment.