Przeglądaj źródła

Fix: Use numbers instead of booleans in Array.sort.

Szymon Cofalik 7 lat temu
rodzic
commit
3b403d1a64
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      packages/ckeditor5-engine/src/dev-utils/model.js

+ 1 - 1
packages/ckeditor5-engine/src/dev-utils/model.js

@@ -249,7 +249,7 @@ export function stringify( node, selectionOrPositionOrRange = null, markers = nu
 
 	if ( markers ) {
 		// To provide stable results, sort markers by name.
-		markers = Array.from( markers ).sort( ( a, b ) => a.name < b.name );
+		markers = Array.from( markers ).sort( ( a, b ) => a.name < b.name ? 1 : -1 );
 
 		for ( const marker of markers ) {
 			downcastDispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );