From 3dc7156e6eacbb540516d7403297ca8ae51141bf Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 23 Jan 2019 15:54:50 +0100 Subject: [PATCH] Replaced for..of with Array.prototype.forEach. See: https://github.com/ckeditor/ckeditor5-react/issues/40. --- src/emittermixin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emittermixin.js b/src/emittermixin.js index c692fe3..29201bc 100644 --- a/src/emittermixin.js +++ b/src/emittermixin.js @@ -237,7 +237,9 @@ const EmitterMixin = { this._delegations = new Map(); } - for ( const eventName of events ) { + // Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow + // build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40. + events.forEach( eventName => { const destinations = this._delegations.get( eventName ); if ( !destinations ) { @@ -245,7 +247,7 @@ const EmitterMixin = { } else { destinations.set( emitter, nameOrFunction ); } - } + } ); } }; },