Skip to content

arguments.length in methods, constructors and generics; -mm=own yield* of strings hands throw() to its delegate; f!() of a missing function throws (TSLANG 187) - #1025

Merged
ASDAlexander77 merged 2 commits into
mainfrom
tslang-187
Nov 24, 2026
Merged

ASDAlexander77 merged 2 commits into
mainfrom
tslang-187

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

TSLANG 187.

  • arguments in methods, constructors and generic functions. An undefined passed is counted (h(1, undefined) is 2), as 186 did for plain functions. A call by the method's symbol (direct, through the vtable, static, new) passes the count. Overrides with or without arguments, or with fewer parameters, work through the base class's slot.
  • -mm=own: throw() through a yield* of strings is handed to the delegate (made there, held in a parameter, or typed with throw only). The delegate's optional throw, once tested, is read out directly; its result is treated as fresh like an iterator's next() (OwnershipSignaturePass: a generator's own throw returns its next's result; any other is reached through calls the pass can't all see).
  • f!(x) of an optional function calls it, and throws a TypeError where it is missing, as JavaScript does (the call was silently skipped and gave a default). Under own, that result can now be kept (r = g.throw!(e) was refused as "merged from several branches").

Still open (TSLANG_ISSUES.md 187): an own leak when a generator of strings is given up before it finishes (pre-existing, the installed compiler leaks the same); own yield* over objects (pre-existing refusal); arguments through a function value.

Tests: 00arguments_length_methods.ts, 00generator_yield_star_throw_strings.ts, 00callee_non_null.ts (gc, rc, own). Full local suite: only the 10 known local failures.

🤖 Generated with Claude Code

ASDAlexander77 and others added 2 commits November 24, 2026 19:00
…nd generic functions; -mm=own yield* of strings hands throw() to its delegate (TSLANG 187)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esult can be kept under -mm=own (TSLANG 187)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 6d24178 into main Nov 24, 2026
8 checks passed
@ASDAlexander77
ASDAlexander77 deleted the tslang-187 branch November 24, 2026 19:53
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