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

Data processor can be specified later.

Piotrek Koszuliński 9 лет назад
Родитель
Сommit
929a68b35d

+ 1 - 1
packages/ckeditor5-engine/src/datacontroller.js

@@ -38,7 +38,7 @@ export default class DataController {
 	 * Creates data controller instance.
 	 *
 	 * @param {engine.model.Document} model Document model.
-	 * @param {engine.dataProcessor.DataProcessor} dataProcessor Data processor which should used by the controller.
+	 * @param {engine.dataProcessor.DataProcessor} [dataProcessor] Data processor which should used by the controller.
 	 */
 	constructor( model, dataProcessor ) {
 		/**

+ 8 - 0
packages/ckeditor5-engine/tests/datacontroller.js

@@ -33,6 +33,14 @@ describe( 'DataController', () => {
 		schema = modelDocument.schema;
 	} );
 
+	describe( 'constructor', () => {
+		it( 'works without data processor', () => {
+			const data = new DataController( modelDocument );
+
+			expect( data.processor ).to.be.undefined;
+		} );
+	} );
+
 	describe( 'parse', () => {
 		it( 'should set text', () => {
 			schema.allow( { name: '$text', inside: '$root' } );