remove cast method

This commit is contained in:
error
2014-10-27 10:31:35 -05:00
parent aacb0059e0
commit 67469b12e4
3 changed files with 1 additions and 23 deletions

View File

@@ -22,12 +22,6 @@ var constructResult1 = new Promise<string>((resolve: (promise: Thenable<string>)
});
promiseString = constructResult1;
//cast test
var castResult = Promise.cast('a string');
promiseString = castResult;
var castResult1 = Promise.cast(Promise.resolve('a string'));
promiseString = castResult1;
//resolve test
var resolveResult = Promise.resolve('a string');
promiseString = resolveResult;

View File

@@ -20,12 +20,6 @@ var constructResult1 = new Promise<string>((resolve:(promise: Thenable<string>)
});
promiseString = constructResult1;
//cast test
var castResult = Promise.cast('a string');
promiseString = castResult;
var castResult1 = Promise.cast(Promise.resolve('a string'));
promiseString = castResult1;
//resolve test
var resolveResult = Promise.resolve('a string');
promiseString = resolveResult;

View File

@@ -118,23 +118,13 @@ declare class Promise<R> implements Thenable<R> {
}
declare module Promise {
/**
* Returns promise (only if promise.constructor == Promise)
*/
function cast<R>(promise: Promise<R>): Promise<R>;
/**
* Make a promise that fulfills to obj.
*/
function cast<R>(object: R): Promise<R>;
/**
* Make a new promise from the thenable.
* A thenable is promise-like in as far as it has a "then" method.
* This also creates a new promise if you pass it a genuine JavaScript promise, making it less efficient for casting than Promise.cast.
*/
function resolve<R>(thenable?: Thenable<R>): Promise<R>;
/**
* Make a promise that fulfills to obj. Same as Promise.cast(obj) in this situation.
* Make a promise that fulfills to obj.
*/
function resolve<R>(object?: R): Promise<R>;