Skip to content

Commit 956643a

Browse files
committed
Port null/undefined support in __rest from microsoft/TypeScript#12552
1 parent faa3973 commit 956643a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tslib.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function __rest(s, e) {
3131
var t = {};
3232
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3333
t[p] = s[p];
34-
if (typeof Object.getOwnPropertySymbols === "function")
34+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
3535
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
3636
t[p[i]] = s[p[i]];
3737
return t;

tslib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var __generator;
6262
var t = {};
6363
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
6464
t[p] = s[p];
65-
if (typeof Object.getOwnPropertySymbols === "function")
65+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
6666
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
6767
t[p[i]] = s[p[i]];
6868
return t;

0 commit comments

Comments
 (0)