Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteb99d8e

Browse files
authored
fix: Avoid handling promise rejections twice in stability helper (#3657)
`PendingTasks.run` reports rejections of the promise to the`ErrorHandler`. This function already returns a promise that is meant tobe handled in the developer's application. If there _is_ handling there,the rejection is handled both in the `PendingTasks.run` and in thedeveloper callsite.This change updates the code to use `PendingTasks.add` instead, whichhas no built in error handling mechanisms.fixesangular/angular#61932
1 parentc1c6af9 commiteb99d8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/zones.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,12 @@ export const ɵzoneWrap = <T= unknown>(it: T, blockUntilFirst: boolean, logLevel
170170
// eslint-disable-next-line @typescript-eslint/no-misused-promises
171171
returnrun(
172172
()=>{
173-
pendingTasks.run(()=>ret);
173+
constremoveTask=pendingTasks.add();
174174
returnnewPromise((resolve,reject)=>{
175175
ret.then(
176176
(it)=>runInInjectionContext(injector,()=>run(()=>resolve(it))),
177177
(reason)=>runInInjectionContext(injector,()=>run(()=>reject(reason)))
178-
)
178+
).finally(removeTask);
179179
});
180180
});
181181
}elseif(typeofret==='function'&&taskDone){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp