Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Replaced for..of with Array.prototype.forEach #271

Merged
merged 1 commit into from
Jan 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/emittermixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,17 @@ 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 ) {
this._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );
} else {
destinations.set( emitter, nameOrFunction );
}
}
} );
}
};
},
Expand Down