Adds backwards compatability for diagnostic chains

This commit is contained in:
Orta Therox 2019-08-29 12:30:59 -04:00
parent 7e5cb3e7ac
commit c8b92c097f
8 changed files with 15576 additions and 8652 deletions

View file

@ -30,6 +30,12 @@ const TYPESCRIPT_LIB_DESTINATION = path.join(__dirname, '../src/lib');
tsServices.replace(/return require\(fileNameToRequire\);/, `// MONACOCHANGE\n return undefined;\n // END MONACOCHANGE`)
);
// Make sure process.args don't get called in the browser, this
// should only happen in TS 2.6.2
const beforeProcess = `ts.perfLogger.logInfoEvent("Starting TypeScript v" + ts.versionMajorMinor + " with command line: " + JSON.stringify(process.argv));`
const afterProcess = `// MONACOCHANGE\n ts.perfLogger.logInfoEvent("Starting TypeScript v" + ts.versionMajorMinor + " with command line: " + JSON.stringify([]));\n// END MONACOCHANGE`
tsServices = tsServices.replace(beforeProcess, afterProcess);
var tsServices_amd = tsServices +
`
// MONACOCHANGE
@ -64,6 +70,7 @@ export = ts;
// END MONACOCHANGE
`;
fs.writeFileSync(path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices.d.ts'), dtsServices);
})();
function importLibs() {