Przeglądaj źródła

Renamed `DIFFERENT` to lower case.

Oskar Wrobel 9 lat temu
rodzic
commit
906ae48b78

+ 2 - 2
packages/ckeditor5-engine/src/model/position.js

@@ -142,7 +142,7 @@ export default class Position {
 	 */
 	compareWith( otherPosition ) {
 		if ( this.root != otherPosition.root ) {
-			return 'DIFFERENT';
+			return 'different';
 		}
 
 		const result = compareArrays( this.path, otherPosition.path );
@@ -642,7 +642,7 @@ export default class Position {
 
 /**
  * A flag indicating whether this position is `'before'` or `'after'` or `'SAME'` as given position.
- * If positions are in different roots `'DIFFERENT'` flag is returned.
+ * If positions are in different roots `'different'` flag is returned.
  *
  * @typedef {String} engine.model.PositionRelation
  */

+ 2 - 2
packages/ckeditor5-engine/src/view/position.js

@@ -152,7 +152,7 @@ export default class Position {
 		switch ( result ) {
 			case 0:
 				// No common ancestors found.
-				return 'DIFFERENT';
+				return 'different';
 
 			case 'PREFIX':
 				commonAncestorIndex = path.length - 1;
@@ -270,7 +270,7 @@ export default class Position {
 
 /**
  * A flag indicating whether this position is `'before'` or `'after'` or `'SAME'` as given position.
- * If positions are in different roots `'DIFFERENT'` flag is returned.
+ * If positions are in different roots `'different'` flag is returned.
  *
  * @typedef {String} engine.view.PositionRelation
  */

+ 2 - 2
packages/ckeditor5-engine/tests/model/position.js

@@ -483,11 +483,11 @@ describe( 'position', () => {
 			expect( position.compareWith( compared ) ).to.equal( 'after' );
 		} );
 
-		it( 'should return DIFFERENT if positions are in different roots', () => {
+		it( 'should return different if positions are in different roots', () => {
 			const position = new Position( root, [ 1, 2, 3 ] );
 			const compared = new Position( otherRoot, [ 1, 2, 3 ] );
 
-			expect( position.compareWith( compared ) ).to.equal( 'DIFFERENT' );
+			expect( position.compareWith( compared ) ).to.equal( 'different' );
 		} );
 	} );
 

+ 2 - 2
packages/ckeditor5-engine/tests/view/position.js

@@ -281,13 +281,13 @@ describe( 'Position', () => {
 			expect( position.compareWith( compared ) ).to.equal( 'after' );
 		} );
 
-		it( 'should return DIFFERENT if positions are in different roots', () => {
+		it( 'should return different if positions are in different roots', () => {
 			const root1 = new Node();
 			const root2 = new Node();
 			const position = new Position( root1, 4 );
 			const compared = new Position( root2, 1 );
 
-			expect( position.compareWith( compared ) ).to.equal( 'DIFFERENT' );
+			expect( position.compareWith( compared ) ).to.equal( 'different' );
 		} );
 	} );