Use arrow functions to bind globals correctly in web scenarios (#45242)

* Use arrow functions to bind globals correctly in web scenarios

https://github.com/microsoft/vscode/issues/127700#issuecomment-889443607

* Add missing spread operators
This commit is contained in:
Andrew Casey
2021-07-30 14:22:30 -07:00
committed by GitHub
parent 8cdcec4454
commit bbd9c3a6e6

View File

@@ -130,10 +130,10 @@ namespace ts.server {
getCurrentDirectory: returnEmptyString, // For inferred project root if projectRoot path is not set, normalizing the paths
/* eslint-disable no-restricted-globals */
setTimeout,
clearTimeout,
setTimeout: (cb, ms, ...args) => setTimeout(cb, ms, ...args),
clearTimeout: handle => clearTimeout(handle),
setImmediate: x => setTimeout(x, 0),
clearImmediate: clearTimeout,
clearImmediate: handle => clearTimeout(handle),
/* eslint-enable no-restricted-globals */
require: () => ({ module: undefined, error: new Error("Not implemented") }),