浏览代码

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.