8
0
Maciej Gołaszewski 5 лет назад
Родитель
Сommit
e85f373303
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      packages/ckeditor5-engine/tests/manual/performance/position.js

+ 4 - 3
packages/ckeditor5-engine/tests/manual/performance/position.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
-/* globals document, setTimeout */
+/* globals window, document, setTimeout */
 
 document.getElementById( 'run' ).addEventListener( 'click', () => {
 	log( 'Running tests...' );
@@ -18,6 +18,8 @@ document.getElementById( 'run' ).addEventListener( 'click', () => {
 	} );
 } );
 
+window.cache = [];
+
 const output = document.getElementById( 'output' );
 
 function log( line ) {
@@ -31,7 +33,6 @@ function runTest( name, callback ) {
 		const start = new Date();
 
 		const repetitions = 10000000;
-		const z = Array( repetitions );
 
 		const root = {
 			root: 'foo',
@@ -41,7 +42,7 @@ function runTest( name, callback ) {
 
 		for ( let i = 0; i < repetitions; i++ ) {
 			const newPath = callback( root, path );
-			z[ i ] = [ newPath.length ];
+			window.cache.push( newPath.length );
 		}
 
 		const end = new Date();