code: function Promise (executor) {
          var self = this,
              err;
  
          // "this._s" is the internal state of: pending, resolved or rejected
          // "this._v" is the internal value
  
          if (!isObject(self) || self._s !== $undefined)
              throw genTypeError($invalidThis);
  
          self._s = $pending;
  
          if (executor !== $noop) {
              if (!isFunction(executor))
                  throw genTypeError($invalidArgument);
  
              err = genTryCatcher(executor)(
                  genSettler(self, $resolved),
                  genSettler(self, $rejected)
              );
  
              if (err === $tryErr)
                  settlePromise(self, $rejected, err.e);
          }
      }
docs: This class follows the [Promises/A+](https://promisesaplus.com) and
  [ES6](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) spec
  with some extra helpers.
  @param  {Function} executor Function object with two arguments resolve, reject.
  The first argument fulfills the promise, the second argument rejects it.
  We can call these functions, once our operation is completed.