ソースを参照

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

Aleksander Nowodziński 9 年 前
コミット
929de5f733
1 ファイル変更2 行追加4 行削除
  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.