Make BOM a constant

This commit is contained in:
Ron Buckton
2017-11-13 16:36:13 -08:00
parent ce29b4c36d
commit 2f941f33e2

View File

@@ -125,6 +125,8 @@ namespace ts {
};
export let sys: System = (() => {
const utf8ByteOrderMark = "\u00EF\u00BB\u00BF";
function getNodeSystem(): System {
const _fs = require("fs");
const _path = require("path");
@@ -348,7 +350,7 @@ namespace ts {
function writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void {
// If a BOM is required, emit one
if (writeByteOrderMark) {
data = "\u00EF\u00BB\u00BF" + data;
data = utf8ByteOrderMark + data;
}
let fd: number;
@@ -549,7 +551,7 @@ namespace ts {
writeFile(path: string, data: string, writeByteOrderMark?: boolean) {
// If a BOM is required, emit one
if (writeByteOrderMark) {
data = "\u00EF\u00BB\u00BF" + data;
data = utf8ByteOrderMark + data;
}
ChakraHost.writeFile(path, data);