提交 6e5f0f82 编写于 作者: J Johannes Rieken

less WinJS.Promise#cancel-callback, #56137

上级 6d224092
......@@ -11,17 +11,14 @@ import { TPromise, TValueCallback } from 'vs/base/common/winjs.base';
export class DeferredTPromise<T> extends TPromise<T> {
public canceled: boolean;
private completeCallback: TValueCallback<T>;
private errorCallback: (err: any) => void;
constructor(oncancel?: any) {
constructor() {
let captured: any;
super((c, e) => {
captured = { c, e };
}, oncancel ? oncancel : () => this.oncancel);
this.canceled = false;
});
this.completeCallback = captured.c;
this.errorCallback = captured.e;
}
......@@ -33,10 +30,6 @@ export class DeferredTPromise<T> extends TPromise<T> {
public error(err: any) {
this.errorCallback(err);
}
private oncancel(): void {
this.canceled = true;
}
}
export function toResource(this: any, path: string) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册