Fix instrumenter target + deprecation warning (#17973)

This commit is contained in:
Wesley Wigham
2017-08-22 15:39:10 -07:00
committed by GitHub
parent 15e15ab84d
commit 8d44e48dd0
3 changed files with 9 additions and 7 deletions
+5 -3
View File
@@ -1,5 +1,5 @@
const fs: any = require("fs");
const path: any = require("path");
import fs = require("fs");
import path = require("path");
function instrumentForRecording(fn: string, tscPath: string) {
instrument(tscPath, `
@@ -38,7 +38,9 @@ function instrument(tscPath: string, prepareCode: string, cleanupCode = "") {
const index2 = index1 + invocationLine.length;
const newContent = tscContent.substr(0, index1) + loggerContent + prepareCode + invocationLine + cleanupCode + tscContent.substr(index2) + "\r\n";
fs.writeFile(tscPath, newContent);
fs.writeFile(tscPath, newContent, err => {
if (err) throw err;
});
});
});
});