fix: invalidate unique shape when property attributes change in place

Closed
BE
1d ago
+31-2

Fork PR for bot review. Refs boa-dev/boa#5706


Summary by cubic

Fixes the Boa engine retaining stale inline caches when a property's attributes change in place, such as when Object.freeze changes writability. Instead of reusing the existing unique shape, a new unique shape is created so cached writes invalidate correctly.

Adds a regression test verifying that a previously cached write throws a TypeError after freezing.


Summary by Gitar

  • Shape invalidation:
    • Recreate UniqueShape when property attributes change in place, so stale inline caches are invalidated
  • Tests:
    • Added freeze_invalidates_cached_unique_shape_write regression test for issue 5706

This will update automatically on new commits.