Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(Intl): make Intl.Collator.compare a getter that returns a bound function (#62048)#62052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ahsansheikh94 wants to merge2 commits intomicrosoft:main
base:main
Choose a base branch
Loading
fromahsansheikh94:fix-intl-collator-compare-type

Conversation

ahsansheikh94
Copy link

@ahsansheikh94ahsansheikh94 commentedJul 12, 2025
edited
Loading

What this PR does

This PR updates the type definition forIntl.Collator.prototype.compare to align with the ECMAScript specification.

Previously, compare was declared as a method:
compare(x: string, y: string): number;

According to the spec, it is agetter that returns a bound function:
get compare(): (this: void, x: string, y: string) => number;

Changing this to a getter would cause conflicts with the existing implementations as pointed out by@Renegade334.
Instead adding athis: void gets the job done.

Changes made

  • Updated theIntl.Collator interface insrc/lib/es5.d.ts:
  • Added a new conformance test intests/cases/conformance/intl/collatorCompareBoundFunction.ts

Related Issue

Fixes#62048

@ahsansheikh94
Copy link
Author

@microsoft-github-policy-service agree

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

@Renegade334Renegade334Renegade334 left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
For Backlog BugPRs that fix a backlog bug
Projects
Status: Not started
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Intl.Collator#compare method type does not match spec
3 participants
@ahsansheikh94@Renegade334@typescript-bot

[8]ページ先頭

©2009-2025 Movatter.jp