Skip to content

Fix issue 2668 - Perform additional cleanup on callThrough() to discard any previously defined behavior#2670

Open
Sigill wants to merge 4 commits intosinonjs:mainfrom
Sigill:fix-issue-2668
Open

Fix issue 2668 - Perform additional cleanup on callThrough() to discard any previously defined behavior#2670
Sigill wants to merge 4 commits intosinonjs:mainfrom
Sigill:fix-issue-2668

Conversation

@Sigill
Copy link
Copy Markdown

@Sigill Sigill commented Dec 21, 2025

Purpose

Fix #2668 by cleanup all other behaviors when calling callThrough()

How to verify - mandatory

  1. Check out this branch
  2. npm install
  3. npm run test

Checklist for author

  • npm run lint passes
  • References to standard library functions are cached.

@Sigill Sigill force-pushed the fix-issue-2668 branch 2 times, most recently from 6cd60f4 to 5c7a7eb Compare December 21, 2025 17:21
@Sigill Sigill marked this pull request as draft December 21, 2025 17:37
@Sigill Sigill force-pushed the fix-issue-2668 branch 2 times, most recently from e96a8aa to 641a5cd Compare December 21, 2025 18:42
@fatso83
Copy link
Copy Markdown
Contributor

fatso83 commented Apr 9, 2026

This seems fine to me! Could you rebase on the latest main and I'll have a new look?

Sigill added 4 commits April 9, 2026 13:15
The cleanup for callThroughWithNew() could be the same as for
callThrough().

But in the callThroughWithNew() context, we are dealing with
constructors, which means the returnThis, resolves, resolvesArg,
resolvesthis, rejects, returnsArg and callsFake don't apply.

The callsArg/yield stuff still applies and needs to be cleaned-up.
@Sigill Sigill marked this pull request as ready for review April 9, 2026 11:28
@Sigill
Copy link
Copy Markdown
Author

Sigill commented Apr 9, 2026

@fatso83 Sure, done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stub.resolves(xxx) still applies after stub.callThrough()

2 participants