Преглед на файлове

Use array assignment instead of splice when changing arguments.

Maciej Gołaszewski преди 6 години
родител
ревизия
d3b2e797dd
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js

+ 1 - 1
packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js

@@ -336,7 +336,7 @@ function restrictDeleteContent( editor ) {
 		// to be modified.
 		// Instead we change the arguments passed to `deleteContent()` method when document selection was passed.
 		if ( selection.is( 'documentSelection' ) ) {
-			args.splice( 0, 1, editor.model.createSelection( allowedToDelete ) );
+			args[ 0 ] = editor.model.createSelection( allowedToDelete );
 		}
 		// We need to modify selection passed to deleteContent if it is an instance of selection because DeleteCommand uses passed
 		// selection to set selection afterwards. Since we modifying this here the selection set after the delete content will be invalid.