libs/es6-shim.js
function(C) {
        if (!ES.IsCallable(C)) {
          throw new TypeError('bad promise constructor');
        }
        var capability = this;
        var resolver = function(resolve, reject) {
          capability.resolve = resolve;
          capability.reject = reject;
        };
        capability.promise = ES.Construct(C, [resolver]);
        // see https://bugs.ecmascript.org/show_bug.cgi?id=2478
        if (!capability.promise._es6construct) {
          throw new TypeError('bad promise constructor');
        }
        if (!(ES.IsCallable(capability.resolve) &&
              ES.IsCallable(capability.reject))) {
          throw new TypeError('bad promise constructor');
        }
      }
function(C) {
        if (!ES.IsCallable(C)) {
          throw new TypeError('bad promise constructor');
        }
        var capability = this;
        var resolver = function(resolve, reject) {
          capability.resolve = resolve;
          capability.reject = reject;
        };
        capability.promise = ES.Construct(C, [resolver]);
        // see https://bugs.ecmascript.org/show_bug.cgi?id=2478
        if (!capability.promise._es6construct) {
          throw new TypeError('bad promise constructor');
        }
        if (!(ES.IsCallable(capability.resolve) &&
              ES.IsCallable(capability.reject))) {
          throw new TypeError('bad promise constructor');
        }
      }
function ( C ) { if ( ! ES . IsCallable ( C ) ) { throw new TypeError ( 'bad promise constructor' ) ; } var capability = this ; var resolver = function ( resolve , reject ) { capability . resolve = resolve ; capability . reject = reject ; } ; capability . promise = ES . Construct ( C , [ resolver ] ) ; // see https://bugs.ecmascript.org/show_bug.cgi?id=2478 if ( ! capability . promise . _es6construct ) { throw new TypeError ( 'bad promise constructor' ) ; } if ( ! ( ES . IsCallable ( capability . resolve ) && ES . IsCallable ( capability . reject ) ) ) { throw new TypeError ( 'bad promise constructor' ) ; } }
"PromiseCapability" in the spec is what most promise implementations call a "deferred".
PromiseCapability in the spec is what most promise implementations call a deferred .