Skip to content

[TS] Retain classes with constant computed member keys - #448

Open
CaelmBleidd wants to merge 1 commit into
neofrom
caelmbleidd/ts-constant-computed-members
Open

CaelmBleidd wants to merge 1 commit into
neofrom
caelmbleidd/ts-constant-computed-members

Conversation

@CaelmBleidd

Copy link
Copy Markdown
Member

A class with ['values'], [1e2], or the standard-library [Symbol.iterator] currently retains independent bodies but receives an unsupported lifecycle, while the computed member itself is omitted. These supported keys now retain the class lifecycle and member bodies. String and numeric literal keys share their JavaScript property identity; initializers keep source order and later method definitions replace the same runtime key.

FieldSignature and MethodSignature gain an optional wellKnownSymbol marker using the existing iterator identity. It survives frontend JSON and Kotlin conversion, so the symbol key and the ordinary string "Symbol.iterator" remain different signatures. Shadowed Symbol, dynamic key calls, computed accessors and accessor collisions, and synthetic lifecycle-name collisions remain explicit unsupported cases. Recognition of the standard-library key assumes the intrinsic global Symbol has not been replaced by external code.

Validation:

  • Frontend build/typecheck; 70 focused class tests, 40 adjacent type/iterator tests, and 21 computed-object/accessor tests passed.
  • Five production frontend-to-Kotlin tests passed, including method and field symbol/string identity.
  • checkLicenseMain passed. checkLicenseTest reports existing violations in four files unchanged from the PR base: EtsTsStrictModeTest.kt, IdentityHashSetTest.kt, EtsFileDtoRenderingTest.kt, and EtsBlockCfgTargetsTest.kt.
  • Original frozen Matrix and SegmentTree sources retained 44/21 methods and 3/5 fields, respectively. Their constructors and initialization bodies contain no unsupported barriers. Each iterator body still reports its unsupported computed object method; original source hashes were unchanged.

USVM dependency integration must make name-based method/field lookups respect this marker before updating the pin. This PR preserves frontend/IR identity and independent ordinary bodies; it does not implement general Symbol execution or establish improved symbolic coverage.

Closes #447.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

  252 files  ±0    252 suites  ±0   16m 4s ⏱️ -56s
  911 tests +1    899 ✅ +1  12 💤 ±0  0 ❌ ±0 
2 197 runs  +1  2 145 ✅ +1  52 💤 ±0  0 ❌ ±0 

Results for commit 0fac32c. ± Comparison against base commit 4251d20.

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.

1 participant