From 3e929fa5e950f1725c6c3ac2b6ee564d324bfb55 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 16 Nov 2016 09:59:59 -0800 Subject: [PATCH] Update __rest emit to handle symbols --- tslib.es6.js | 5 ++++- tslib.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tslib.es6.js b/tslib.es6.js index 5773973..87717cb 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -23,8 +23,11 @@ export const __assign = Object.assign || function (t) { export const __rest = function (s, e) { var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p)) + 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") + 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 0712664..b3556c3 100644 --- a/tslib.js +++ b/tslib.js @@ -60,8 +60,11 @@ var __generator; __rest = function (s, e) { var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p)) + 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") + 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; };