Browse Source

Docs: explained a change in inline comment.

Szymon Cofalik 8 năm trước cách đây
mục cha
commit
d1f4154169
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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.' );