瀏覽代碼

Removed unnecessary complication - if it ever becomes a problem we should throw, not hide the error.

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

+ 1 - 4
packages/ckeditor5-engine/src/editor.js

@@ -75,13 +75,10 @@ CKEDITOR.define( [
 			var that = this;
 			var config = this.config;
 
-			// Create and cache a promise that resolves when all initialization procedures get resolved.
-			this._initPromise = this._initPromise || Promise.all( [
+			return Promise.all( [
 				loadPlugins().then( initPlugins )
 			] );
 
-			return this._initPromise;
-
 			function loadPlugins() {
 				return that.plugins.load( config.plugins );
 			}

+ 0 - 6
packages/ckeditor5-engine/tests/editor/editor.js

@@ -92,12 +92,6 @@ describe( 'init', function() {
 		return promise;
 	} );
 
-	it( 'should return the same promise for successive calls', function() {
-		var promise = editor.init();
-
-		expect( editor.init() ).to.equal( promise );
-	} );
-
 	it( 'should fill `plugins`', function() {
 		var Editor = modules.editor;
 		var Plugin = modules.plugin;