Explorar o código

Added globals for lint, fixed variable naming.

Maksymilian Barnaś %!s(int64=9) %!d(string=hai) anos
pai
achega
0fd9f3ce29

+ 4 - 4
packages/ckeditor5-engine/src/dataprocessor/xmldataprocessor.js

@@ -107,17 +107,17 @@ export default class XmlDataProcessor {
 		// Wrap data into root element with optional namespace definitions.
 		data = `<xml ${ namespaces }>${ data }</xml>`;
 
-		const document = this._domParser.parseFromString( data, 'text/xml' );
+		const parsedDocument = this._domParser.parseFromString( data, 'text/xml' );
 
 		// Parse validation.
-		const parserError = document.querySelector( 'parsererror' );
+		const parserError = parsedDocument.querySelector( 'parsererror' );
 
 		if ( parserError ) {
 			throw new Error( 'Parse error - ' + parserError.textContent );
 		}
 
-		const fragment = document.createDocumentFragment();
-		const nodes = document.documentElement.childNodes;
+		const fragment = parsedDocument.createDocumentFragment();
+		const nodes = parsedDocument.documentElement.childNodes;
 
 		while ( nodes.length > 0 ) {
 			fragment.appendChild( nodes[ 0 ] );

+ 3 - 1
packages/ckeditor5-engine/tests/dataprocessor/xmldataprocessor.js

@@ -6,6 +6,8 @@
 /* bender-tags: browser-only */
 /* globals window, setTimeout */
 
+/* globals window */
+
 import XmlDataProcessor from '/ckeditor5/engine/dataprocessor/xmldataprocessor.js';
 import xssTemplates from '/tests/engine/dataprocessor/_utils/xsstemplates.js';
 import ViewDocumentFragment from '/ckeditor5/engine/view/documentfragment.js';
@@ -73,7 +75,7 @@ describe( 'XmlDataProcessor', () => {
 				window.testXss = sinon.spy();
 				dataProcessor.toView( input );
 
-				setTimeout( () => {
+				window.setTimeout( () => {
 					sinon.assert.notCalled( window.testXss );
 					done();
 				}, 10 );