-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Bug in lib.dom.d.ts - document.evaluate #26437
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixed in TSJS repoFix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yetFix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yetGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixed in TSJS repoFix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yetFix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yetGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
In TypeScript (my version is 2.5), lib.dom.d.ts specifies document.evaluate as follows:
evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;where
So this means the following code
reports function (prefix:string) : string cannot be assigned to XPathNSResolver.
However, as in the comments of this issue under note of DOM-Level-3-XPath-20040226 the DOM spec clearly says
So libdom.d.ts is missing an overload for
(prefix:string) => stringand that leads to a error-message for proper ECMAScript which is not transpiling, which is a bug.