mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 11:54:44 -06:00
Revert BOM emit change
This commit is contained in:
parent
24fcc3f554
commit
46ea4de7bc
@ -120,7 +120,10 @@ namespace ts {
|
||||
};
|
||||
|
||||
export let sys: System = (() => {
|
||||
const utf8ByteOrderMark = "\u00EF\u00BB\u00BF";
|
||||
// NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual
|
||||
// byte order mark from the specified encoding. Using any other byte order mark does
|
||||
// not actually work.
|
||||
const byteOrderMarkIndicator = "\uFEFF";
|
||||
|
||||
function getNodeSystem(): System {
|
||||
const _fs = require("fs");
|
||||
@ -345,7 +348,7 @@ namespace ts {
|
||||
function writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void {
|
||||
// If a BOM is required, emit one
|
||||
if (writeByteOrderMark) {
|
||||
data = utf8ByteOrderMark + data;
|
||||
data = byteOrderMarkIndicator + data;
|
||||
}
|
||||
|
||||
let fd: number;
|
||||
@ -554,7 +557,7 @@ namespace ts {
|
||||
writeFile(path: string, data: string, writeByteOrderMark?: boolean) {
|
||||
// If a BOM is required, emit one
|
||||
if (writeByteOrderMark) {
|
||||
data = utf8ByteOrderMark + data;
|
||||
data = byteOrderMarkIndicator + data;
|
||||
}
|
||||
|
||||
ChakraHost.writeFile(path, data);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user