mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Cast sys.bufferFrom results in cases where global buffer and sys copy of buffer mismatch
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user