Fix TSLint issues

As this is the starter project it should be provided without any errors.
This commit restructures some code to solve the TSLint issues.
This commit is contained in:
Leo Friedrichs
2017-12-22 14:41:44 +01:00
parent af65405e38
commit 40c482bed8
2 changed files with 7 additions and 6 deletions

View File

@@ -38,8 +38,8 @@ export class ErrorMapper {
while (match = re.exec(stack)) {
if (match[2] === "main") {
const pos = this.consumer.originalPositionFor({
line: parseInt(match[3], 10),
column: parseInt(match[4], 10)
column: parseInt(match[4], 10),
line: parseInt(match[3], 10)
});
if (pos.line != null) {
@@ -75,7 +75,8 @@ export class ErrorMapper {
} catch (e) {
if (e instanceof Error) {
if ("sim" in Game.rooms) {
console.log(`<span style='color:red'>Source maps don't work in the simulator - displaying original error<br>${_.escape(e.stack)}</span>`)
const message = `Source maps don't work in the simulator - displaying original error`;
console.log(`<span style='color:red'>${message}<br>${_.escape(e.stack)}</span>`);
} else {
console.log(`<span style='color:red'>${_.escape(this.sourceMappedStackTrace(e))}</span>`);
}
@@ -84,6 +85,6 @@ export class ErrorMapper {
throw e;
}
}
}
};
}
}