Repository navigation
Fix generated COM identifiers and aggregate target keys - #150
Merged
Merged
Conversation
Share strict JavaScript binding-name escaping without changing unsafe parameter or method naming conventions. Reject transformed parameter and generated-binding collisions before emitting a companion. Serialize raw aggregate layouts with x86/x64/arm64 runtime keys while preserving census vocabulary and ABI layouts. Cover real IUIAutomation syntax, CJS/ESM registration, raw schema validation, and declarations without native UIA calls. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mixed-language test coverageWorkflow status: ✅ Passed
|
shisan (qiutongMS)
approved these changes
Sep 11, 2026
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.
Summary
Fix two independent import blockers reproduced by generating
Windows.Win32.UI.Accessibility.IUIAutomation:varproducedrectToVariant(rc, var)and a JavaScript syntax error. Share reserved/restricted binding-name escaping with the existing COM JavaScript naming helper. Preserve unsafe parameter casing/Hungarian prefixes, valid contextual names, and existing method spellings. Reject transformed parameter collisions and clashes with generated bindings explicitly, with consistent JavaScript arguments and declarations.i686, but the strict runtime schema acceptsx86,x64, andarm64. Translate only descriptor root keys; preserve census/support-report keys and native layouts. Eager POINT registration can now succeed when the generated module loads.Add a real-metadata regression to the existing generated-unsafe E2E suite: Node syntax checking, independent CommonJS and ESM import/registration, runtime by-value descriptor validation (including rejection of an invalid
i686key), and a TypeScript consumer. Unit regressions cover restricted names, sanitization/collisions, generated locals, and pointer-width-sensitive struct/union descriptors for all three targets.Boundaries
Based directly on
mainate7469c840e6f68310083b23520c6b681601eb276; this is an independent PR, not a stack. No runtime/native ABI, WinRT, npm root API, contract registry migration, or flat Win32 functionality changes. No new safe UIA support or unsafe bypass.Validation
Windows ARM64, Node v24.15.0;
DYNWINRT_WIN32_WINMDpoints to Microsoft.Windows.SDK.Win32Metadata 71.0.14-preview, SHA256B64EE4818A7ED9F9D135038D58C51BD08369184D4D5ED428F20E9DE55DF8121D.Before the fix, reproduced both the
Unexpected token 'var'syntax failure and the unchanged runtime'sRaw by-value root descriptor contains unknown key i686failure using the actual generated POINT descriptor. The new E2E regression also failed on baseline generation.Passed:
cargo test -p dynwinrt-codegen --lib -- codegen::com::generated_unsafe::tests codegen::com::javascript::naming::tests codegen::com::capability::tests::raw_aggregate_descriptors_use_runtime_architectures_without_renaming_census_targets— 22 passed, including the exact pinned Stage 2 coverage baseline.cargo test -p dynwinrt-codegen --lib --test win32_com_test -- codegen::com::javascript:: snapshot_ safe_incomplete_interface_generates_an_isolated_unsafe_companion generated_unsafe_preserves_direct_void_pointer_returns— 89 unit + 4 integration tests passed, including existing COM snapshots.cargo test -p dynwinrt-codegen --test snapshot_test— 6 passed, unchanged WinRT JS/Python output.bindings\js:npm run test:generated-unsafe -- __test__\raw-phase1.spec.ts— 7 passed with the repository-standard native build, generated declarations, and raw-runtime integration.oxlint, andgit diff --checkpassed.Limitations: live execution was ARM64 only; x86/x64 descriptor keys, sizes, alignments, and offsets are covered by generation tests, not live x86/x64 calls. The UIA regression performs no activation or native UIA method invocation, keyboard/mouse injection, Electron build, or UI automation.