From 956643a544367010539c8a2d07e8b6b560831e16 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 29 Nov 2016 16:33:21 -0800 Subject: [PATCH] Port null/undefined support in __rest from https://github.com/Microsoft/TypeScript/pull/12552 --- tslib.es6.js | 2 +- tslib.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tslib.es6.js b/tslib.es6.js index 049e4de..2ba9dd3 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -31,7 +31,7 @@ export function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; - if (typeof Object.getOwnPropertySymbols === "function") + 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]]; return t; diff --git a/tslib.js b/tslib.js index b3556c3..e954a2f 100644 --- a/tslib.js +++ b/tslib.js @@ -62,7 +62,7 @@ var __generator; var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; - if (typeof Object.getOwnPropertySymbols === "function") + 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]]; return t;