lib: add Math.sumPrecise type definition (ES2025)#63429
Open
827652549 wants to merge 1 commit intomicrosoft:mainfrom
Open
lib: add Math.sumPrecise type definition (ES2025)#63429827652549 wants to merge 1 commit intomicrosoft:mainfrom
827652549 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
690af4e to
8c8953c
Compare
Author
|
@microsoft-github-policy-service agree |
da8c0cf to
769ae58
Compare
Math.sumPrecise is part of the TC39 proposal-math-sum which reached Stage 4 on 2025-07-28, making it part of ES2026. Already implemented in Firefox 137+, Safari 18.4, and Bun, but not yet in V8/Node.js. Adds src/lib/esnext.math.d.ts with the Math interface extension, and wires it into esnext.d.ts and libs.json. Fixes microsoft#63427
769ae58 to
e38adc3
Compare
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.
Summary
Adds type definition for
Math.sumPrecisewhich is part of the TC39proposal-math-sumthat reached Stage 4 on 2025-07-28, making it part of ES2026.Changes
src/lib/esnext.math.d.ts— extendsinterface MathwithsumPrecisesrc/lib/esnext.d.ts— added/// <reference lib="esnext.math" />src/lib/libs.json— registeredesnext.mathin the libs arraysrc/compiler/commandLineParser.ts— mappedesnext.mathlib name to filesrc/compiler/utilities.ts— addedsumPrecisetoScriptTargetFeaturesfor helpful diagnosticsWhy esnext, not es2025?
The proposal reached Stage 4 on 2025-07-28, one month after ES2025 was finalized (June 2025), so it will be included in ES2026. TypeScript does not have
es2026lib files yet, soesnextis the correct placement for now.Runtime support
References
AI Disclosure
This PR was developed with AI assistance (Claude by Anthropic) for research, code generation, and verification against the TC39 spec, MDN, and runtime implementations.
Fixes #63427