promise.js
function Promise ( executor ) {
    var promise = this;
    if ( !IsCallable(executor) ) {
      throw TypeError('Invalid executor');
    }
    if ( Type(promise) !== 'object' ) {
      throw TypeError('Invalid promise');
    }
    if ( Type(promise['[[PromiseStatus]]']) !== 'undefined' ) {
      throw TypeError();
    }
    defineInternal(this, '[[PromiseConstructor]]', Promise);
    return InitializePromise(promise, executor);
  }
function Promise ( executor ) {
    var promise = this;
    if ( !IsCallable(executor) ) {
      throw TypeError('Invalid executor');
    }
    if ( Type(promise) !== 'object' ) {
      throw TypeError('Invalid promise');
    }
    if ( Type(promise['[[PromiseStatus]]']) !== 'undefined' ) {
      throw TypeError();
    }
    defineInternal(this, '[[PromiseConstructor]]', Promise);
    return InitializePromise(promise, executor);
  }
25.4.3.1 Promise ( executor )