mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
The wrapper returned by `deprecate.removeFunction` dropped the wrapped function's return value because it did not `return` from `fn.apply`. Every other function wrapper in this module (`renameFunction`, `moveAPI`) forwards the return value, and the generic type signature `<T extends Function>(fn: T, ...): T` promises that `T`'s return type is preserved. Callers that relied on the return value of a function wrapped by `removeFunction` would silently receive `undefined` from the wrapper. Mirror the forwarding done by `renameFunction` / `moveAPI` and extend the existing spec to assert that the wrapper preserves both the return value and the `this` context of the deprecated function. Assisted-By: Claude Opus 4.6 Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>