Repository navigation
Conversation
Delegate to Promise.finally() so cleanup callbacks do not replace results or turn processing errors into fulfilled promises. Signed-off-by: Don Yin <Don_Yin@outlook.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
LazyResult.finally()andNoWorkResult.finally()currently usethen(cb, cb). A cleanup callback's return value replaces theResult, and a rejected processing promise becomes fulfilled if cleanup succeeds.For example:
This delegates to the underlying promise's
finally()to follow the standard Promise API documented in the types. NativePromise.finally()is available throughout the supported Node.js range, so no compatibility helper is needed.The six regressions extend
processor.test.tsand cover no plugins, synchronous plugins and asynchronous plugins. They check result/error identity, a callback with no arguments, and completion of asynchronous cleanup. All six fail ond1908579and pass with the change.Validation:
env -u NO_COLOR pnpm testpasses (727 tests, 100% line coverage, lint, declarations, version, integration and size checks);pnpm exec tsc --noEmitalso passes. Windows and the other Node.js versions were not run locally.