Microsoft/TypeScript

`Date.getVarDate()` function seems incorrectly defined

Aperta

#51.636 aperta il 24 nov 2022

 (1 commento) (0 reazioni) (0 assegnatari)TypeScript (13.395 fork)batch import
BugDomain: lib.d.tsHelp Wanted

Metriche repository

Star
 (108.860 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

interface Date {
    getVarDate: () => VarDate;
}

https://contest-server.cs.uchicago.edu/ref/JavaScript/developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.html

TypeScript has defined Date type to has a functional property getVarDate, but such function does not exist in the real Date instance. Looking at some API documents, the Date.getVarDate() is a non-standard method forActiveX. Therefore, I hope TypeScript to remove the functional property or change it like below:

interface Date {
    // no reason to be property assigned functional value
    getVarDate?(): VarDate;
}

Guida contributor