瀏覽代碼

Data processor can be specified later.

Piotrek Koszuliński 9 年之前
父節點
當前提交
929a68b35d
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 1 1
      packages/ckeditor5-engine/src/datacontroller.js
  2. 8 0
      packages/ckeditor5-engine/tests/datacontroller.js

+ 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' } );