change 'then' signature of promise that TS async/await is working (#11726)

change 'then' signature of promise that TS async/await is working
This commit is contained in:
Marco Bachmann
2016-10-06 02:14:25 +02:00
committed by Mohamed Hegazy
parent af17fc34a8
commit 4b4beff441
2 changed files with 6 additions and 2 deletions

View File

@@ -2319,7 +2319,7 @@ declare namespace webdriver {
* resolved with the result of the invoked callback.
* @template R
*/
then<R>(opt_callback?: (value: T) => R|IThenable<R>, opt_errback?: (error: any) => R|IThenable<R>): Promise<R>;
then<R>(opt_callback?: (value: T) => R|IThenable<R>, opt_errback?: (error: any) => any): Promise<R>;
/**
* Registers a listener for when this promise is rejected. This is synonymous
@@ -2526,7 +2526,7 @@ declare namespace webdriver {
* @return A new promise which will be resolved
* with the result of the invoked callback.
*/
then(opt_callback?: Function, opt_errback?: Function): Promise<any>;
then<R>(opt_callback?: (value: T) => IThenable<R>|R, opt_errback?: (error: any) => any): Promise<R>;
/**
* Registers a listener for when this promise is rejected. This is synonymous

View File

@@ -1114,6 +1114,10 @@ function TestErrorCode() {
errorCode = new webdriver.error.UnknownMethodError().code();
errorCode = new webdriver.error.UnsupportedOperationError().code();
}
async function TestAsyncAwaitable() {
var thenable: webdriver.promise.Promise<string> = new webdriver.promise.Promise<string>();
var str: string = await thenable;
}
function TestTestingModule() {
testing.before(function () {