浏览代码

Introduced copying builtin plugins to get rid of shared references between editors [watchdog].

Maciej Bukowski 5 年之前
父节点
当前提交
713dc3d6ca
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      packages/ckeditor5-core/src/editor/editor.js
  2. 1 1
      packages/ckeditor5-core/tests/editor/editor.js

+ 1 - 1
packages/ckeditor5-core/src/editor/editor.js

@@ -61,7 +61,7 @@ export default class Editor {
 		this._context = config.context || new Context( { language: config.language } );
 		this._context._addEditor( this, !config.context );
 
-		const availablePlugins = this.constructor.builtinPlugins;
+		const availablePlugins = Array.from( this.constructor.builtinPlugins || [] );
 
 		/**
 		 * Stores all configurations specific to this editor instance.

+ 1 - 1
packages/ckeditor5-core/tests/editor/editor.js

@@ -262,7 +262,7 @@ describe( 'Editor', () => {
 			const context = await Context.create( { plugins: [ ContextPlugin ] } );
 			const editor = await TestEditor.create( { context } );
 
-			expect( editor.config.get( 'plugins' ) ).to.be.undefined;
+			expect( editor.config.get( 'plugins' ) ).to.be.empty;
 		} );
 
 		it( 'should pass DOM element using reference, not copy', async () => {