chore: hygiene round 7 — delete dead Intl stubs + orphaned call helpers, dedup singleton populate#1272
Merged
Conversation
…lpers - Remove the 20 non-Create Intl EmittedRuntime holders, their EmitReflectionHelper assignments, and the now-unreachable RuntimeTypes.Intl.cs instance-method statics. Compiled Intl instance calls dispatch reflectively on the SharpTSIntl* objects returned by the (kept) CreateIntl* factories; the stubs were never read or name-referenced. Verified with a compiled smoke covering format/formatToParts/resolvedOptions/compare/select/of/segment. - Delete 16 orphaned protected helpers in ExpressionEmitterBase.CallHelpers.cs stranded by the CallHandlerRegistry unification (b0e4ffe): EmitGlobalParseInt/ ParseFloat/IsNaN/IsFinite, EmitSet/ClearTimeout, EmitSet/ClearInterval, EmitQueueMicrotask, EmitTimerArgsArray, EmitSymbolCall, EmitBigIntCall, EmitErrorCall, EmitSuperConstructorCall, EmitAsyncFunctionCall, TryEmitProcessStreamCall. Live equivalents are private statics in TimersPrimitiveEmitter/TimerHandler and the registry handlers. - Drop GuestErrorEmitter.ThrowReferenceError (zero callers). ThrowSyntaxError stays: RuntimeEmitter.TSRegExp.cs (binary-flagged, invisible to grep) calls it at three sites — the build caught it.
…S helpers EmitBuiltinSingletonPopulate carried a local InstallNonEnumerable closure and an inline idempotency guard that were byte-for-byte copies of EmitInstallNonEnumerable / EmitPrototypePopulateGuard in RuntimeEmitter.PrototypePopulateShared.cs. Route through the shared helpers; emitted IL is unchanged (verified with --verify plus a compiled smoke checking value-form Math/JSON dispatch, wrapper identity, and Object.keys non-enumerability).
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.
Round 7 of the dead-code/duplication hygiene series (follows #1265–#1271). Net −604 lines, no behavior change.
Dead code removed (verified: zero call sites AND zero name-string references, including the binary-flagged TSRegExp.cs)
CreateIntlEmittedRuntimeholders, theirEmitReflectionHelperassignments, and the now-unreachableRuntimeTypes.Intl.csinstance-method statics. Compiled Intl instance calls (nf.format(x)etc.) dispatch reflectively on theSharpTSIntl*objects returned by the keptCreateIntl*factories — the stubs were assigned but never read.FormatDateToLocalealso kept (live viaRuntimeEmitter.Date.cs:115).ExpressionEmitterBase.CallHelpers.cs(~260 lines): stranded by the CallHandlerRegistry unification (b0e4ffe, 2026-04). The live implementations are private statics inTimersPrimitiveEmitter/TimersPromisesPrimitiveEmitter/TimerHandlerand the registry handlers; the base-class copies had zero callers.GuestErrorEmitter.ThrowReferenceError(zero callers, added speculatively in refactor(compile): single-source the guest-error raise idiom (159 sites, −407 lines) #1271).ThrowSyntaxErrorwas also flagged dead by grep but is kept —RuntimeEmitter.TSRegExp.csis binary-flagged (grep-invisible) and calls it at 3 sites; the compiler caught it.Duplication removed
EmitBuiltinSingletonPopulate(Math/JSON value-form populate) carried a localInstallNonEnumerableclosure + inline idempotency guard byte-identical to the sharedEmitInstallNonEnumerable/EmitPrototypePopulateGuard; now routed through them. This closes the last true inline duplicate of the non-enumerable PDS install idiom — remainingCompiledPropertyDescriptorCtorsites are legitimately different variants.Verification
m.max === Math.maxidentity,Object.keys(Math).length === 0non-enumerability): passes--verifyIL verification: passes