From 862e5672b6ea46c73c2d76afabe4bdd3694fcac9 Mon Sep 17 00:00:00 2001 From: vitkarpov Date: Wed, 28 Dec 2016 19:06:12 +0300 Subject: [PATCH] =?UTF-8?q?[#112]=20=D0=9E=D1=88=D0=B8=D0=B1=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=B2=20=D0=98=D0=9511?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get rid of [...], because of Array.from which's not working in IE. Babel doesn't polyfill it by default (see https://github.com/babel/babel/issues/4922). --- source/dom.js | 2 +- source/utils.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/dom.js b/source/dom.js index 7f3aef7..b19bfaf 100644 --- a/source/dom.js +++ b/source/dom.js @@ -76,7 +76,7 @@ export const find = (selector, node) => (node || document).querySelector(selecto * @param {Node} [node] * @returns {Node[]} */ -export const findAll = (selector, node) => [...(node || document).querySelectorAll(selector)]; +export const findAll = (selector, node) => Array.prototype.slice.call((node || document).querySelectorAll(selector)); /** * Open the popup * diff --git a/source/utils.js b/source/utils.js index f96dac7..3bb2131 100644 --- a/source/utils.js +++ b/source/utils.js @@ -23,17 +23,17 @@ export const each = (object, callback) => { export const toArray = (arrayLike) => Array.prototype.slice.call(arrayLike); /** - * Merge given dictionaries (objects) into one object + * Merge given dictionaries (objects) into one object. + * Iterates across the arguments. * - * @param {...Object} object * @returns {Object} */ -export const merge = (...args) => { // eslint-disable-line no-unused-vars +export const merge = function() { const result = {}; - const argsArr = [...args]; + const args = Array.prototype.slice.call(arguments); // eslint-disable-line no-undef - for (let i = 0; i < argsArr.length; i++) { - const arg = argsArr[i]; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; if (arg) { for (const key in arg) {