Fix explicit WinRT delegate selection for JavaScript and Python - #207
Open
leileizhang (lei9444) wants to merge 2 commits into
Open
leileizhang (lei9444) wants to merge 2 commits into
leileizhang (lei9444) wants to merge 2 commits into
Conversation
Classify validated non-generic WinRT delegates before runtime-class fallback and reuse the shared dependency interface parser for JavaScript and Python. Include namespace roots, selection-order/incremental regressions, strict callable consumers, and bounded real ThreadPool callback fixtures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Accept optional trailing commas and format the two existing macro calls required by hosted Rust 1.99. Generated native signatures and behavior are unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mixed-language test coverageWorkflow status: ✅ Passed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Explicitly selecting
ThreadPool,WorkItemHandlerclassified the delegate as an ordinary runtime class. Its placeholder displaced the correct dependency module: JavaScript rejected normal callbacks withFailed to recover WinGUID, and Python rejected them as non-DynWinRTValueinputs before native invocation.Fix
Classify non-generic WinRT delegate roots from their metadata kind/base, public WinRT flags, typed IID, and
Invokecontract before class fallback. Reuse the existing shared delegate/interface dependency parser for both languages and include standalone delegates in namespace selection. Malformed/non-WinRT/open-generic roots fail explicitly; public-interface and Classic COM routing remain unchanged. The delegate fix does not change runtime, ABI, lifetime, renderer, release, or unrelated projection behavior.Regression coverage includes delegate-only, combined/reversed roots, automatic dependencies, repeat/incremental selection, namespace roots, ThreadPoolTimer's delegate family, malformed contracts, JS CJS/ESM and declarations, and Python with/without stubs. CLI help and codegen documentation now describe delegate selection.
Separate CI compatibility prerequisite: the additive commit copies only the approved tiny Rust 1.99 fixture-format correction from
49c7e6e2e7042b527f1fee9d6655a8df8f537099: allow a trailing comma in the test-onlystub!matcher and format its two existing audio invocations. The one-file delta is byte-identical to that source commit. Both invocation argument lists and the emittedextern "system"function signature/E_NOTIMPLbody are unchanged. No functional commit or dependent branch is imported; the original main base is retained.Verification
RoApartment()andprojected_lifetime_scope()..js/.d.ts/.py/.pyicomparisons for ThreadPool/WorkItemHandler and ThreadPoolTimer/TimerElapsedHandler are byte-identical to fresh-main automatic dependency output. Existing JS/Python delegate runtime selectors pass; local Rust 1.97/1.98.1 formatting is clean.Independent base:
de91e9b3889aafdda44098d5ea1b731f9976a3c6. Metadata: Windows SDK10.0.26100.0,Windows.winmdSHA-25611191cbcc796e520d47547b3f986be94a48556fe336d4e63334596d9f31a7806. Local native evidence uses Node24.15.0and CPython3.13.15; hosted x64 CI results are separate.