@@ -305,6 +305,26 @@ export default class ParsePromise {
305305 return promise ;
306306 }
307307
308+ /**
309+ * Returns a new promise that is resolved with a given value.
310+ * If that value is a thenable Promise (has a .then() prototype
311+ * method), the new promise will be chained to the end of the
312+ * value.
313+ * @method resolve
314+ * @param value The value to resolve the promise with
315+ * @static
316+ * @return {Parse.Promise } the new promise.
317+ */
318+ static resolve ( value ) {
319+ return new ParsePromise ( ( resolve , reject ) => {
320+ if ( ParsePromise . is ( value ) ) {
321+ value . then ( resolve , reject ) ;
322+ } else {
323+ resolve ( value ) ;
324+ }
325+ } ) ;
326+ }
327+
308328 /**
309329 * Returns a new promise that is rejected with a given error.
310330 * @method error
@@ -318,6 +338,19 @@ export default class ParsePromise {
318338 return promise ;
319339 }
320340
341+ /**
342+ * Returns a new promise that is rejected with a given error.
343+ * This is an alias for Parse.Promise.error, for compliance with
344+ * the ES6 implementation.
345+ * @method reject
346+ * @param error The error to reject the promise with
347+ * @static
348+ * @return {Parse.Promise } the new promise.
349+ */
350+ static reject ( ...errors ) {
351+ return ParsePromise . error . apply ( null , errors ) ;
352+ }
353+
321354 /**
322355 * Returns a new promise that is fulfilled when all of the input promises
323356 * are resolved. If any promise in the list fails, then the returned promise
0 commit comments