From 5a5967e4b36c87e0a6661a9c531447a3569074b7 Mon Sep 17 00:00:00 2001 From: Josh Ponelat Date: Tue, 10 May 2016 18:00:24 +0200 Subject: [PATCH] add object-assign pollyfill, for travis --- lib/object-assign-pollyfill.js | 23 +++++++++++++++++++++++ src/main/html/index.html | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 lib/object-assign-pollyfill.js diff --git a/lib/object-assign-pollyfill.js b/lib/object-assign-pollyfill.js new file mode 100644 index 00000000..51799207 --- /dev/null +++ b/lib/object-assign-pollyfill.js @@ -0,0 +1,23 @@ +if (typeof Object.assign != 'function') { + (function () { + Object.assign = function (target) { + 'use strict'; + if (target === undefined || target === null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + var output = Object(target); + for (var index = 1; index < arguments.length; index++) { + var source = arguments[index]; + if (source !== undefined && source !== null) { + for (var nextKey in source) { + if (Object.prototype.hasOwnProperty.call(source, nextKey)) { + output[nextKey] = source[nextKey]; + } + } + } + } + return output; + }; + })(); +} diff --git a/src/main/html/index.html b/src/main/html/index.html index 86ca99fe..dc5896ac 100644 --- a/src/main/html/index.html +++ b/src/main/html/index.html @@ -10,6 +10,8 @@ + +