Skip to content

fix(lib): remove callable signature without new from Intl.PluralRules…#63608

Open
SiddGud wants to merge 1 commit into
microsoft:mainfrom
SiddGud:fix-63606-pluralrules-new
Open

fix(lib): remove callable signature without new from Intl.PluralRules…#63608
SiddGud wants to merge 1 commit into
microsoft:mainfrom
SiddGud:fix-63606-pluralrules-new

Conversation

@SiddGud

@SiddGud SiddGud commented Jul 4, 2026

Copy link
Copy Markdown

Fixes #63606

  • There is an associated issue in the Backlog milestone (required)
  • Code is up-to-date with the main branch
  • You've successfully run hereby runtests locally
  • There are new or updated unit tests validating the change

Per ECMA-402 section 18.1.1 (Intl.PluralRules(...)), if NewTarget is undefined, a TypeError exception is thrown. Unlike legacy constructors (DateTimeFormat, NumberFormat, Collator) which have legacy fallback call behavior, modern Intl constructors require new.

This PR removes the callable signature from PluralRulesConstructor in both es2018.intl.d.ts and es2020.intl.d.ts. Other ES2020+ constructors (such as RelativeTimeFormat and Locale) were audited and correctly only require new.

Copilot AI review requested due to automatic review settings July 4, 2026 10:59
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Jul 4, 2026
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jul 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@SiddGud

SiddGud commented Jul 4, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

Intl.PluralRules constructor should not be callable without new

2 participants