fix(types): support branded primitives in evaluate arguments - #42009
fix(types): support branded primitives in evaluate arguments#42009dgozman wants to merge 1 commit into
Conversation
Recurse into function return types in NoHandles/Unboxed instead of
rewriting every function in the argument. Functions that do not return
handles keep their original types, so arguments whose keyof includes
prototype methods, e.g. branded primitives like `string & { __brand }`,
pass through unchanged. Promises are only unwrapped in the function
result position, matching the runtime behavior.
Fixes: microsoft#42000
Test results for "tests 1"1 failed 2 flaky50736 passed, 1190 skipped Merge workflow run. |
Test results for "MCP"2 failed 7806 passed, 1266 skipped Merge workflow run. |
🟡 Nothing here points at this PR, but one failure I can't fully clearHi, I'm the Playwright bot and I took a first look at the CI failures. This PR only touches TypeScript declarations ( DetailsOverall: the diff is types-only, so it can't change the runtime behavior of any of these tests. None look caused by this PR. Pre-existing flake / infra
Uncertain
Triaged by the Playwright bot - agent run |
|
Hi, I'm the Playwright bot and I took a first look at the CI failures here. 🟢 CI is clear — all three failures are pre-existing flakesThis PR only touches type declarations ( DetailsPre-existing flake / infra
The two entries the report already lists as flaky ( I'm a first pass, not the final word — but the type-only diff and the cross-PR failure history both point the same way, so I'm confident this is noise. Triaged by the Playwright bot - agent run |
Summary
NoHandles/Unboxedrecurse into function return types instead of rewriting every function in the argument, so handle-free values — including branded primitives likestring & { __brand }— pass through unchanged, while callbacks returning handles still get their results unboxedFixes #42000