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

Code style: Proper method ordering.

Piotrek Koszuliński 8 лет назад
Родитель
Сommit
a16df7edfd
1 измененных файлов с 14 добавлено и 14 удалено
  1. 14 14
      packages/ckeditor5-engine/src/model/schema.js

+ 14 - 14
packages/ckeditor5-engine/src/model/schema.js

@@ -439,6 +439,20 @@ export class SchemaItem {
 		this._requiredAttributes.push( attributes );
 	}
 
+	/**
+	 * Custom toJSON method to solve child-parent circular dependencies.
+	 *
+	 * @returns {Object} Clone of this object with the parent property replaced with its name.
+	 */
+	toJSON() {
+		const json = clone( this );
+
+		// Due to circular references we need to remove parent reference.
+		json._schema = '[model.Schema]';
+
+		return json;
+	}
+
 	/**
 	 * Adds path to the SchemaItem instance.
 	 *
@@ -529,20 +543,6 @@ export class SchemaItem {
 
 		return false;
 	}
-
-	/**
-	 * Custom toJSON method to solve child-parent circular dependencies.
-	 *
-	 * @returns {Object} Clone of this object with the parent property replaced with its name.
-	 */
-	toJSON() {
-		const json = clone( this );
-
-		// Due to circular references we need to remove parent reference.
-		json._schema = '[model.Schema]';
-
-		return json;
-	}
 }
 
 /**