Browse Source

Removed the Promise module.

Piotrek Koszuliński 10 years ago
parent
commit
c275e2876d

+ 1 - 4
packages/ckeditor5-utils/.jshintrc

@@ -13,8 +13,5 @@
 
 	"globals": {
 		"CKEDITOR": false
-	},
-	"predef": [
-		"-Promise"
-	]
+	}
 }

+ 0 - 28
packages/ckeditor5-utils/src/promise.js

@@ -1,28 +0,0 @@
-/**
- * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* globals window */
-
-'use strict';
-
-/**
- * An ES6 compatible Promise class, used for deferred and asynchronous computations.
- *
- * @class Promise
- */
-
-CKEDITOR.define( function() {
-	// For now we're using the native browser implementation of Promise, an ES6 feature. Just IE is not supporting it so
-	// a polyfill will have to be developed for it.
-	//
-	// http://caniuse.com/#feat=promises
-
-	/* istanbul ignore next: we expect this to never happen for now, so we'll not have coverage for this */
-	if ( !window.Promise ) {
-		throw new Error( 'The Promise class is not available natively. CKEditor is not compatible with this browser.' );
-	}
-
-	return window.Promise;
-} );

+ 1 - 4
packages/ckeditor5-utils/tests/.jshintrc

@@ -25,8 +25,5 @@
 		"bender": false,
 		"sinon": false,
 		"setTimeout": false
-	},
-	"predef": [
-		"-Promise"
-	]
+	}
 }

+ 1 - 2
packages/ckeditor5-utils/tests/ckeditor/ckeditor.js

@@ -8,7 +8,7 @@
 
 'use strict';
 
-var modules = bender.amd.require( 'ckeditor', 'editor', 'promise', 'config' );
+var modules = bender.amd.require( 'ckeditor', 'editor', 'config' );
 
 var content = document.getElementById( 'content' );
 var editorConfig = { plugins: 'creator-test' };
@@ -28,7 +28,6 @@ beforeEach( function() {
 describe( 'create', function() {
 	it( 'should return a promise', function() {
 		var CKEDITOR = modules.ckeditor;
-		var Promise = modules.promise;
 
 		expect( CKEDITOR.create( content, editorConfig ) ).to.be.instanceof( Promise );
 	} );

+ 0 - 22
packages/ckeditor5-utils/tests/promise/promise.js

@@ -1,22 +0,0 @@
-/**
- * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-var modules = bender.amd.require( 'promise' );
-
-describe( 'Promise', function() {
-	it( 'should resolve properly', function() {
-		var Promise = modules.promise;
-
-		var promise = new Promise( function( resolve ) {
-			resolve( 1 );
-		} );
-
-		return promise.then( function( value ) {
-			expect( value ).to.equal( 1 );
-		} );
-	} );
-} );