Fix JavaScript collection input and output contracts - #180
Merged
Merged
Conversation
Reuse IReference boxing for automatic collection inputs, obtain owned map views through generated GetView, and distinguish nullable output types from input representations. Keep missing map entries distinct from conversion errors and cover strict consumers plus production native roundtrips. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bdea384f-3022-47e8-8c74-11fd768c2105
Record the paired IMap projection without revisiting the same argument subtree. Add a small nested dependency control and clarify that map get uses non-atomic native operations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bdea384f-3022-47e8-8c74-11fd768c2105
Mixed-language test coverageWorkflow status: ✅ Passed
|
Shawn Yuan (shuaiyuanxx)
approved these changes
Sep 22, 2026
leileizhang (lei9444)
deleted the
lei9444-fix-js-collection-contracts
branch
September 22, 2026 03:58
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.
Changes
IReference<T>boxing for automatic JavaScript array andMapinputs, including native array parameters. Preserve native and managed nulls and existing reference wrappers.Mapinputs to independently ownedIMapView<K,V>snapshots through the generatedIMap.getView()operation, releasing the temporary map without changing native QueryInterface behavior.Compatibility
Strict TypeScript consumers must guard nullable collection outputs before dereferencing them. A present
nullremains distinct from theundefinedreturned byget()for a missing key orat()for an out-of-range index. Array containers, scalar/struct values, and non-null collection factory results are not made nullable.Map
get()propagates conversion and native errors instead of treating them as missing entries. ItsHasKeyandLookupcalls are separate native operations, not atomic against concurrent native mutation.