promise.js 684 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals window */
  6. 'use strict';
  7. /**
  8. * An ES6 compatible Promise class, used for deferred and asynchronous computations.
  9. *
  10. * @class Promise
  11. */
  12. CKEDITOR.define( function() {
  13. // For now we're using the native browser implementation of Promise, an ES6 feature. Just IE is not supporting it so
  14. // a polyfill will have to be developed for it.
  15. //
  16. // http://caniuse.com/#feat=promises
  17. if ( !window.Promise ) {
  18. throw 'The Promise class is not available natively. CKEditor is not compatible with this browser.';
  19. }
  20. return window.Promise;
  21. } );