mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 02:14:06 +00:00
fix: early return on cancellation
This commit is contained in:
parent
1e1025fc96
commit
e4fb11a1e7
|
@ -23,6 +23,7 @@ export function runSafeAsync<T>(runtime: RuntimeEnvironment, func: () => Thenabl
|
|||
runtime.timer.setImmediate(() => {
|
||||
if (token.isCancellationRequested) {
|
||||
resolve(cancelValue());
|
||||
return;
|
||||
}
|
||||
return func().then(result => {
|
||||
if (token.isCancellationRequested) {
|
||||
|
|
|
@ -23,6 +23,7 @@ export function runSafe<T>(runtime: RuntimeEnvironment, func: () => Thenable<T>,
|
|||
runtime.timer.setImmediate(() => {
|
||||
if (token.isCancellationRequested) {
|
||||
resolve(cancelValue());
|
||||
return;
|
||||
}
|
||||
return func().then(result => {
|
||||
if (token.isCancellationRequested) {
|
||||
|
|
|
@ -23,6 +23,7 @@ export function runSafeAsync<T>(runtime: RuntimeEnvironment, func: () => Thenabl
|
|||
runtime.timer.setImmediate(() => {
|
||||
if (token.isCancellationRequested) {
|
||||
resolve(cancelValue());
|
||||
return;
|
||||
}
|
||||
return func().then(result => {
|
||||
if (token.isCancellationRequested) {
|
||||
|
|
Loading…
Reference in a new issue