mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-13 14:09:06 -05:00
Make BOM a constant
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user