Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2f941f3

Browse filesBrowse files
committed
Make BOM a constant
1 parent ce29b4c commit 2f941f3
Copy full SHA for 2f941f3

1 file changed

+4-2Lines changed: 4 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/sys.ts‎

Copy file name to clipboardExpand all lines: src/compiler/sys.ts
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ namespace ts {
125125
};
126126

127127
export let sys: System = (() => {
128+
const utf8ByteOrderMark = "\u00EF\u00BB\u00BF";
129+
128130
function getNodeSystem(): System {
129131
const _fs = require("fs");
130132
const _path = require("path");
@@ -348,7 +350,7 @@ namespace ts {
348350
function writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void {
349351
// If a BOM is required, emit one
350352
if (writeByteOrderMark) {
351-
data = "\u00EF\u00BB\u00BF" + data;
353+
data = utf8ByteOrderMark + data;
352354
}
353355

354356
let fd: number;
@@ -549,7 +551,7 @@ namespace ts {
549551
writeFile(path: string, data: string, writeByteOrderMark?: boolean) {
550552
// If a BOM is required, emit one
551553
if (writeByteOrderMark) {
552-
data = "\u00EF\u00BB\u00BF" + data;
554+
data = utf8ByteOrderMark + data;
553555
}
554556

555557
ChakraHost.writeFile(path, data);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.