From 417678310c095c378e2ebd8c76e83a50ef21e7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 20 Aug 2014 11:22:11 -0700 Subject: [PATCH] Update Object.assign polyfill The spec changed to allow null & undefined sources without throwing. Now our code depends on this new behavior. The only browser that implements Object.assign has also updated its native implementation to this behavior (Firefox Nightly). --- src/vendor/polyfill/Object.es6.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/vendor/polyfill/Object.es6.js b/src/vendor/polyfill/Object.es6.js index a5a6ac128a..b31bb6ab54 100644 --- a/src/vendor/polyfill/Object.es6.js +++ b/src/vendor/polyfill/Object.es6.js @@ -24,20 +24,20 @@ if (!Object.assign) { if (target == null) { throw new TypeError('Object.assign target cannot be null or undefined'); } - var to = Object(target); + var to = Object(target); var hasOwnProperty = Object.prototype.hasOwnProperty; for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { var nextSource = arguments[nextIndex]; if (nextSource == null) { - throw new TypeError('Object.assign source cannot be null or undefined'); + continue; } var from = Object(nextSource); - // We don't currently support accessors nor proxies. Therefore this copy - // cannot throw. If we ever supported this then we must handle + // We don't currently support accessors nor proxies. Therefore this + // copy cannot throw. If we ever supported this then we must handle // exceptions and side-effects. for (var key in from) { @@ -50,4 +50,3 @@ if (!Object.assign) { return to; }; } -