Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function toPromise() {
var promiseImpl: {
new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Rx.IPromise;
} = undefined as any;
Rx.config.Promise = promiseImpl;
var p: Rx.IPromise = obsNum.toPromise(promiseImpl);
p = obsNum.toPromise();
p = p.then(x => x);
p = p.then(x => p);
p = p.then(undefined, reason => 10);
//p = p.then(undefined, reason => p);
var ps: Rx.IPromise = p.then(undefined, reason => "error");
ps = p.then(x => "");
ps = p.then(x => ps);
}
}