8
0
Quellcode durchsuchen

Removed iterable interface from transaction and delta.

Piotr Jasiun vor 10 Jahren
Ursprung
Commit
9b2886159e

+ 0 - 7
packages/ckeditor5-engine/src/document/delta/delta.js

@@ -52,13 +52,6 @@ CKEDITOR.define( [], () => {
 
 			return operation;
 		}
-
-		/**
-		 * Delta provides iterator interface which will iterate over operations in the delta.
-		 */
-		[ Symbol.iterator ]() {
-			return this.operations[ Symbol.iterator ]();
-		}
 	}
 
 	return Delta;

+ 0 - 7
packages/ckeditor5-engine/src/document/delta/transaction-base.js

@@ -69,13 +69,6 @@ CKEDITOR.define( [ 'ckeditorerror' ], ( CKEditorError ) => {
 			return delta;
 		}
 
-		/**
-		 * Transaction provides iterator interface which will iterate over deltas in the transaction.
-		 */
-		[ Symbol.iterator ]() {
-			return this.deltas[ Symbol.iterator ]();
-		}
-
 		/**
 		 * Static method to register transaction methods. To make code scalable transaction do not have modification
 		 * methods built in. They can be registered using this method.

+ 4 - 4
packages/ckeditor5-engine/tests/document/deltas/changedelta.js

@@ -46,8 +46,8 @@ describe( 'Transaction', () => {
 	function getOperationsCount() {
 		let count = 0;
 
-		for ( let delta of transaction ) {
-			count += getIteratorCount( delta );
+		for ( let delta of transaction.deltas ) {
+			count += getIteratorCount( delta.operations );
 		}
 
 		return count;
@@ -136,8 +136,8 @@ describe( 'Transaction', () => {
 		function getChangesAttrsCount() {
 			let count = 0;
 
-			for ( let delta of transaction ) {
-				for ( let operation of delta ) {
+			for ( let delta of transaction.deltas ) {
+				for ( let operation of delta.operations ) {
 					count += getIteratorCount( operation.range );
 				}
 			}

+ 1 - 1
packages/ckeditor5-engine/tests/document/deltas/delta.js

@@ -59,7 +59,7 @@ describe( 'Delta', () => {
 			delta.addOperation( {} );
 			delta.addOperation( {} );
 
-			const count = getIteratorCount( delta );
+			const count = getIteratorCount( delta.operations );
 
 			expect( count ).to.equal( 3 );
 		} );