/**
  `RSVP.Promise.Cast` returns the same promise if that promise shares a constructor
  with the promise being casted.

  Example:

      var promise = RSVP.resolve(1);
      var casted = RSVP.Promise.cast(promise);

      console.log(promise === casted); // true

  In the case of a promise whose constructor does not match, it is assimilated.
  The resulting promise will fulfill or reject based on the outcome of the
  promise being casted.

  In the case of a non-promise, a promise which will fulfill with that value is
  returned.

  Example:

      var value = 1; // could be a number, boolean, string, undefined...
      var casted = RSVP.Promise.cast(value);

      console.log(value === casted); // false
      console.log(casted instanceof RSVP.Promise) // true

      casted.then(function(val) {
        val === value // => true
      });

  `RSVP.Promise.Cast` is similar to `RSVP.resolve`, but `RSVP.Promise.Cast` differs in the
  following ways:
  * `RSVP.Promise.Cast` serves as a memory-efficient way of getting a promise, when you
  have something that could either be a promise or a value. RSVP.resolve
  will have the same effect but will create a new promise wrapper if the
  argument is a promise.
  * `RSVP.Promise.Cast` is a way of casting incoming thenables or promise subclasses to
  promises of the exact class specified, so that the resulting object's `then` is
  ensured to have the behavior of the constructor you are calling cast on (i.e., RSVP.Promise).

  @method cast
  @for RSVP
  @param {Object} object to be casted
  @return {Promise} promise that is fulfilled when all properties of `promises`
  have been fulfilled, or rejected if any of them become rejected.
*/


function cast(object) {
  /*jshint validthis:true */
  if (object && typeof object === 'object' && object.constructor === this) {
    return object;
  }

  var Promise = this;

  return new Promise(function(resolve) {
    resolve(object);
  });
}

export { cast };

@@ -9,25 +9,25 @@
 SVP.Promise.
-C
+c
 ast%60 returns
@@ -855,33 +855,33 @@
   %60RSVP.Promise.
-C
+c
 ast%60 is similar 
@@ -913,25 +913,25 @@
 SVP.Promise.
-C
+c
 ast%60 differs
@@ -970,25 +970,25 @@
 SVP.Promise.
-C
+c
 ast%60 serves 
@@ -1237,9 +1237,9 @@
 ise.
-C
+c
 ast%60

fix case in cast documentation