Skip to content

[TS] Model Array and Error constructors and String.replaceAll - #451

Merged
CaelmBleidd merged 9 commits into
mainfrom
caelmbleidd/stdlib-constructors-pr391
Oct 13, 2026
Merged

CaelmBleidd merged 9 commits into
mainfrom
caelmbleidd/stdlib-constructors-pr391

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Preserve actual runtime values in Error.name/message, including primitive/nullish values, object aliases and bounded symbolic strings. Private storage avoids collisions with ordinary fields. Thrown Error/TypeError identity survives complete fake packets and conditional references; catch routing remains intact, and source class shadows do not acquire SDK identity.

Callable builtin Array reaches its bounded model even when the native frontend provides a nonreference function pointer. Array allocations retain their logical runtime type and exact undefined holes. String.replaceAll uses current length/slice operations; type assertions erase annotations without changing runtime values.

Based on main at 5645f04, including merged #449, #450 and #452. The diff contains the constructor/replaceAll and modeled Error changes, plus explicit assertion-erasure configuration and its regression tests. The guarded primitive dispatch and catalog-derived model routing from main are preserved. Error throw and storage helpers are extracted to retain Detekt limits after integration.

Modeled Error storage is handled at read/write boundaries, without Error-specific parameters in generic field readers. Conditional deletion and reassignment retain the stored runtime value. Type assertions are erased only when TsOptions.eraseTypeAssertions is explicitly true; the default preserves prior ETS cast constraints and unsupported casts. The TypeScript Calls engine explicitly opts into erasure.

Validation on 6be44b9: 297 focused usvm-ts tests (280 passed, 17 skipped, no failures), one Calls test with confirmed JavaScript replay, production/test compilation, Detekt usvm-ts main/test and git diff --check passed. Coverage includes Array constructors, replaceAll, model catalog, primitive owner boundaries, Error fields/deletion/identity, cast modes, ordinary fields and runtime class operations. Temporarily restoring unconditional assertion erasure made the default-cast regression fail with an extra execution; the corrected implementation passes. Calls Detekt tasks previously completed with seven pre-existing formatting findings also present in main. The obsolete local checkLicense commit hook was bypassed; validation ran independently. GitHub CI pending.

@CaelmBleidd CaelmBleidd changed the title [11/12] Model Array and Error constructors and replaceAll [TS] Model Array and Error constructors and String.replaceAll Oct 2, 2026
@CaelmBleidd
CaelmBleidd marked this pull request as ready for review October 2, 2026 16:15
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-runtime-values-pr391 branch from ff54580 to aaae9a2 Compare October 2, 2026 16:45
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-constructors-pr391 branch from 03bad57 to 1daff2b Compare October 2, 2026 16:45
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-constructors-pr391 branch from 1daff2b to debf84d Compare October 11, 2026 06:51
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-runtime-values-pr391 branch from aaae9a2 to 741be74 Compare October 11, 2026 06:51
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-constructors-pr391 branch from debf84d to f8b213c Compare October 12, 2026 13:26
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-runtime-values-pr391 branch from 741be74 to 55af9fc Compare October 12, 2026 13:26
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-constructors-pr391 branch from f8b213c to b654cbd Compare October 12, 2026 23:24
@CaelmBleidd
CaelmBleidd changed the base branch from caelmbleidd/stdlib-runtime-values-pr391 to caelmbleidd/stdlib-bounded-sequences-pr391 October 12, 2026 23:24
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-constructors-pr391 branch from b654cbd to 09b16f7 Compare October 12, 2026 23:39
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-bounded-sequences-pr391 branch from 7d282e8 to 1fb4ccf Compare October 12, 2026 23:39
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-bounded-sequences-pr391 branch 2 times, most recently from 0c41796 to b8a1601 Compare October 13, 2026 20:27
Base automatically changed from caelmbleidd/stdlib-bounded-sequences-pr391 to main October 13, 2026 20:30
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-constructors-pr391 branch from 09b16f7 to 32b0774 Compare October 13, 2026 20:34
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/stdlib-constructors-pr391 branch from 343c3b7 to 6be44b9 Compare October 13, 2026 20:56
@CaelmBleidd
CaelmBleidd merged commit 8b30c2e into main Oct 13, 2026
5 of 6 checks passed
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/stdlib-constructors-pr391 branch October 13, 2026 20:58
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