mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-27 23:58:38 -06:00
Cast sys.bufferFrom results in cases where global buffer and sys copy of buffer mismatch
This commit is contained in:
parent
5144330c98
commit
283bf999df
@ -211,7 +211,7 @@ namespace ts.server {
|
||||
if (this.fd >= 0) {
|
||||
const buf = sys.bufferFrom!(s);
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
fs.writeSync(this.fd, buf, 0, buf.length, /*position*/ null!); // TODO: GH#18217
|
||||
fs.writeSync(this.fd, buf as globalThis.Buffer, 0, buf.length, /*position*/ null!); // TODO: GH#18217
|
||||
}
|
||||
if (this.traceToConsole) {
|
||||
console.warn(s);
|
||||
@ -884,7 +884,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
// Override sys.write because fs.writeSync is not reliable on Node 4
|
||||
sys.write = (s: string) => writeMessage(sys.bufferFrom!(s, "utf8"));
|
||||
sys.write = (s: string) => writeMessage(sys.bufferFrom!(s, "utf8") as globalThis.Buffer);
|
||||
sys.watchFile = (fileName, callback) => {
|
||||
const watchedFile = pollingWatchedFileSet.addFile(fileName, callback);
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user