8
0
Просмотр исходного кода

Docs: explained a change in inline comment.

Szymon Cofalik 8 лет назад
Родитель
Сommit
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.' );