Piotr Jasiun 10 yıl önce
ebeveyn
işleme
b6e275739a

+ 8 - 8
packages/ckeditor5-engine/src/document/deltas/changedelta.js

@@ -24,16 +24,16 @@ CKEDITOR.define( [
 	} );
 
 	function change( doc, transaction, key, value, range ) {
-		var lastSplitPosition = range.start;
+		let lastSplitPosition = range.start;
 
-		var position;
-		var valueBefore;
-		var valueAfter;
+		let position;
+		let valueBefore;
+		let valueAfter;
 
-		var iterator = range[ Symbol.iterator ]();
-		var next = iterator.next();
+		const iterator = range[ Symbol.iterator ]();
+		let next = iterator.next();
 
-		var delta = new ChangeDelta();
+		const delta = new ChangeDelta();
 
 		while ( !next.done ) {
 			valueAfter = next.value.node.getAttr( key );
@@ -59,7 +59,7 @@ CKEDITOR.define( [
 		transaction.addDelta( delta );
 
 		function split() {
-			var operation = new ChangeOperation(
+			const operation = new ChangeOperation(
 					new Range( lastSplitPosition, position ),
 					valueBefore ? new Attribute( key, valueBefore ) : null,
 					value ? new Attribute( key, value ) : null,

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

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [], function() {
+CKEDITOR.define( [], () => {
 	/**
 	 * @class document.delta.Delta
 	 */

+ 1 - 1
packages/ckeditor5-engine/src/document/deltas/register.js

@@ -7,6 +7,6 @@
 
 CKEDITOR.define( [
 	'document/deltas/transaction-base'
-], function( Transaction ) {
+], ( Transaction ) => {
 	return Transaction.register;
 } );

+ 1 - 1
packages/ckeditor5-engine/src/document/transaction.js

@@ -8,6 +8,6 @@
 CKEDITOR.define( [
 	'document/deltas/transaction-base',
 	'document/deltas/changedelta'
-], function( Transaction ) {
+], ( Transaction ) => {
 	return Transaction;
 } );

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

@@ -7,7 +7,7 @@
 
 'use strict';
 
-var modules = bender.amd.require(
+const modules = bender.amd.require(
 	'document/transaction',
 	'document/document',
 	'document/text',
@@ -16,9 +16,9 @@ var modules = bender.amd.require(
 	'document/position' );
 
 describe( 'Transaction', () => {
-	var Transaction, Document, Text, Attribute, Range, Position;
+	let Transaction, Document, Text, Attribute, Range, Position;
 
-	var doc, root, transaction;
+	let doc, root, transaction;
 
 	before( () => {
 		Transaction = modules[ 'document/transaction' ];
@@ -53,10 +53,10 @@ describe( 'Transaction', () => {
 	}
 
 	function getOperationsCount() {
-		var count = 0;
+		let count = 0;
 
-		for ( var delta of transaction ) {
-			for ( var operation of delta ) {
+		for ( let delta of transaction ) {
+			for ( let operation of delta ) {
 				count++;
 			}
 		}
@@ -65,11 +65,11 @@ describe( 'Transaction', () => {
 	}
 
 	function getChangesAttrsCount() {
-		var count = 0;
+		let count = 0;
 
-		for ( var delta of transaction ) {
-			for ( var operation of delta ) {
-				for ( var value of operation.range ) {
+		for ( let delta of transaction ) {
+			for ( let operation of delta ) {
+				for ( let value of operation.range ) {
 					count++;
 				}
 			}
@@ -80,7 +80,7 @@ describe( 'Transaction', () => {
 
 	function getCompressedAttrs() {
 		// default: 111---111222---111
-		var range = Range.createFromElement( root );
+		const range = Range.createFromElement( root );
 		return Array.from( range ).map( value => value.node.getAttr( 'a' ) || '-' ).join( '' );
 	}
 

+ 0 - 8
packages/ckeditor5-engine/tests/document/element.js

@@ -121,12 +121,4 @@ describe( 'Element', () => {
 			expect( element.getChildCount() ).to.equal( 3 );
 		} );
 	} );
-
-	describe( 'getChildrenIterator', function() {
-		it( 'should return iterator over children', function() {
-			getChildrenIterator
-
-			expect( element.getChildCount() ).to.equal( 3 );
-		} );
-	} );
 } );

+ 10 - 10
packages/ckeditor5-engine/tests/document/transaction.js

@@ -7,13 +7,13 @@
 
 'use strict';
 
-var modules = bender.amd.require(
+const modules = bender.amd.require(
 	'document/transaction',
 	'document/deltas/delta',
 	'ckeditorerror' );
 
 describe( 'Transaction', () => {
-	var Transaction, Delta, CKEditorError;
+	let Transaction, Delta, CKEditorError;
 
 	before( () => {
 		Transaction = modules[ 'document/transaction' ];
@@ -22,14 +22,14 @@ describe( 'Transaction', () => {
 	} );
 
 	it( 'should have registered basic methods', () => {
-		var transaction = new Transaction();
+		const transaction = new Transaction();
 
 		expect( transaction.setAttr ).to.be.a( 'function' );
 		expect( transaction.removeAttr ).to.be.a( 'function' );
 	} );
 
 	describe( 'Transaction.register', () => {
-		var TestDelta;
+		let TestDelta;
 
 		before( () => {
 			TestDelta = class extends Delta {
@@ -48,7 +48,7 @@ describe( 'Transaction', () => {
 				t.addDelta( new TestDelta() );
 			} );
 
-			var transaction = new Transaction();
+			const transaction = new Transaction();
 
 			transaction.foo();
 
@@ -62,7 +62,7 @@ describe( 'Transaction', () => {
 				t.addDelta( new TestDelta() );
 			} );
 
-			var transaction = new Transaction();
+			const transaction = new Transaction();
 
 			transaction.foo();
 
@@ -72,12 +72,12 @@ describe( 'Transaction', () => {
 		} );
 
 		it( 'should pass arguments properly', () => {
-			var doc = 'doc';
-			var arg = 'arg';
+			const doc = 'doc';
+			const arg = 'arg';
 
-			var transaction = new Transaction( doc );
+			const transaction = new Transaction( doc );
 
-			var stub = sinon.stub();
+			const stub = sinon.stub();
 
 			Transaction.register( 'foo', stub );