From: Jukka Kurkela Date: Sat, 4 Jan 2020 17:59:27 +0000 (+0200) Subject: Remove `for of` loops for IE compatibility (#6905) X-Git-Tag: v3.0.0-alpha~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9fa553fb2be5d1661c1486b7bf2c1f3b1db6700;p=thirdparty%2FChart.js.git Remove `for of` loops for IE compatibility (#6905) --- diff --git a/src/core/core.animations.js b/src/core/core.animations.js index 220cbc303..c592b6a9a 100644 --- a/src/core/core.animations.js +++ b/src/core/core.animations.js @@ -71,7 +71,7 @@ export default class Animations { if (!isObject(cfg)) { return; } - for (let prop of cfg.properties || [key]) { + (cfg.properties || [key]).forEach(function(prop) { // Can have only one config per animation. if (!animatedProps.has(prop)) { animatedProps.set(prop, extend({}, animDefaults, cfg)); @@ -79,7 +79,7 @@ export default class Animations { // Single property targetting config wins over multi-targetting. animatedProps.set(prop, extend({}, animatedProps.get(prop), cfg)); } - } + }); }); } diff --git a/src/core/core.animator.js b/src/core/core.animator.js index 29422d5ba..e6e5a60cf 100644 --- a/src/core/core.animator.js +++ b/src/core/core.animator.js @@ -64,12 +64,11 @@ class Animator { _update() { const me = this; const date = Date.now(); - const charts = me._charts; let remaining = 0; - for (let [chart, anims] of charts) { + me._charts.forEach(function(anims, chart) { if (!anims.running || !anims.items.length) { - continue; + return; } const items = anims.items; let i = items.length - 1; @@ -105,12 +104,12 @@ class Animator { } remaining += items.length; - } + }); - this._lastDate = date; + me._lastDate = date; if (remaining === 0) { - this._running = false; + me._running = false; } }