Explorar el Código

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

Aleksander Nowodziński hace 9 años
padre
commit
929de5f733
Se han modificado 1 ficheros con 2 adiciones y 4 borrados
  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.