Explorar o código

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

Szymon Cofalik %!s(int64=7) %!d(string=hai) anos
pai
achega
3b403d1a64
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 );