Browse Source

Code refac: Used ...spread instead of slicing arguments in DOMEmitterMixin listenTo()/stopListening().

Aleksander Nowodziński 9 years ago
parent
commit
929de5f733
1 changed files with 2 additions and 4 deletions
  1. 2 4
      packages/ckeditor5-ui/src/domemittermixin.js

+ 2 - 4
packages/ckeditor5-ui/src/domemittermixin.js

@@ -48,8 +48,7 @@ const DOMEmitterMixin = extend( {}, EmitterMixin, {
 	 *
 	 * @method ui.DOMEmitterMixin#listenTo
 	 */
-	listenTo() {
-		const args = Array.prototype.slice.call( arguments );
+	listenTo( ...args ) {
 		const emitter = args[ 0 ];
 
 		// Check if emitter is an instance of DOM Node. If so, replace the argument with
@@ -79,8 +78,7 @@ const DOMEmitterMixin = extend( {}, EmitterMixin, {
 	 *
 	 * @method ui.DOMEmitterMixin#stopListening
 	 */
-	stopListening() {
-		const args = Array.prototype.slice.call( arguments );
+	stopListening( ...args ) {
 		const emitter = args[ 0 ];
 
 		// Check if emitter is an instance of DOM Node. If so, replace the argument with corresponding ProxyEmitter.