Przeglądaj źródła

Removed the Promise module.

Piotrek Koszuliński 10 lat temu
rodzic
commit
8cda11ff82

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

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

+ 0 - 28
packages/ckeditor5-ui/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-ui/tests/.jshintrc

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

+ 0 - 22
packages/ckeditor5-ui/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 );
-		} );
-	} );
-} );