Repository navigation
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
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TSLANG 187.
argumentsin methods, constructors and generic functions. Anundefinedpassed 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 withoutarguments, or with fewer parameters, work through the base class's slot.throw()through ayield*of strings is handed to the delegate (made there, held in a parameter, or typed withthrowonly). The delegate's optionalthrow, once tested, is read out directly; its result is treated as fresh like an iterator'snext()(OwnershipSignaturePass: a generator's ownthrowreturns itsnext'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);argumentsthrough 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