Skip to content

Commit bbd9c3a

Browse files
authored
Use arrow functions to bind globals correctly in web scenarios (microsoft#45242)
* Use arrow functions to bind globals correctly in web scenarios microsoft/vscode#127700 (comment) * Add missing spread operators
1 parent 8cdcec4 commit bbd9c3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/webServer/webServer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ namespace ts.server {
130130
getCurrentDirectory: returnEmptyString, // For inferred project root if projectRoot path is not set, normalizing the paths
131131

132132
/* eslint-disable no-restricted-globals */
133-
setTimeout,
134-
clearTimeout,
133+
setTimeout: (cb, ms, ...args) => setTimeout(cb, ms, ...args),
134+
clearTimeout: handle => clearTimeout(handle),
135135
setImmediate: x => setTimeout(x, 0),
136-
clearImmediate: clearTimeout,
136+
clearImmediate: handle => clearTimeout(handle),
137137
/* eslint-enable no-restricted-globals */
138138

139139
require: () => ({ module: undefined, error: new Error("Not implemented") }),

0 commit comments

Comments
 (0)