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

Docs: explained a change in inline comment.

Szymon Cofalik преди 8 години
родител
ревизия
d1f4154169
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      packages/ckeditor5-engine/src/dev-utils/view.js

+ 2 - 0
packages/ckeditor5-engine/src/dev-utils/view.js

@@ -852,6 +852,8 @@ function _convertViewElements( rootNode ) {
 		const convertedElement = rootNode.is( 'documentFragment' ) ? new ViewDocumentFragment() : _convertElement( rootNode );
 
 		// Convert all child nodes.
+		// Cache the nodes in array. Otherwise, we would skip some nodes because during iteration we move nodes
+		// from `rootNode` to `convertedElement`. This would interfere with iteration.
 		for ( const child of [ ...rootNode.getChildren() ] ) {
 			if ( convertedElement.is( 'emptyElement' ) ) {
 				throw new Error( 'Parse error - cannot parse inside EmptyElement.' );