Skip to content

Fix runtime type member writes for CLR wrappers#2496

Merged
lahma merged 1 commit into
sebastienros:mainfrom
nkgotcode:fix/jint-derived-runtime-set
Jun 7, 2026
Merged

Fix runtime type member writes for CLR wrappers#2496
lahma merged 1 commit into
sebastienros:mainfrom
nkgotcode:fix/jint-derived-runtime-set

Conversation

@nkgotcode

Copy link
Copy Markdown
Contributor

Summary

Fix writes to runtime-derived CLR wrapper members.

Details

  • Updates ObjectWrapper.Set to probe both declared and runtime CLR types before deciding a member write is unresolved.
  • Preserves strict unresolved-member behavior when neither type can satisfy the write.
  • Adds regression coverage for a base-declared property that returns a derived runtime object.

Linked issue

Fixes #2494

Test plan

  • Added or updated unit tests in Jint.Tests
  • Ran dotnet test --configuration Release locally
  • N/A - For ECMAScript spec changes: ran Jint.Tests.Test262 and confirmed no regressions
  • For interop changes: covered in Jint.Tests/Runtime/Interop
  • N/A - For perf changes: included before/after numbers from Jint.Benchmark

Focused validation:

docker run --rm -v "$PWD":/work -w /work mcr.microsoft.com/dotnet/sdk:10.0 dotnet test --configuration Release Jint.Tests/Jint.Tests.csproj --filter "FullyQualifiedName~Jint.Tests.Runtime.InteropExplicitTypeTests.DerivedRuntimePropertyFromBaseDeclaredProperty|FullyQualifiedName~Jint.Tests.Runtime.InteropTests.StrictAccessStillThrowsForMissingWrites"
Passed!  - Failed:     0, Passed:     2, Skipped:     0, Total:     2, Duration: 1 s - Jint.Tests.dll (net10.0)

Breaking change?

No

@lahma lahma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@lahma
lahma enabled auto-merge (squash) June 7, 2026 06:20
@lahma
lahma merged commit d501dd4 into sebastienros:main Jun 7, 2026
4 checks passed
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.

Jint interop uses declared property type for wrapped return values

2 participants