microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.08k stars 12.49k forks source link

`Date.getVarDate()` function seems incorrectly defined #51636

Open samchon opened 1 year ago

samchon commented 1 year ago
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;
}
RyanCavanaugh commented 1 year ago

We should just remove it, not tweak the syntax. It doesn't even exist in Chromium.