Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.getSourceFile = function (fileName, languageVersion, onError) {
var originalContent = _this.delegate.readFile(fileName);
var newContent = originalContent;
if (!/\.d\.ts$/.test(fileName)) {
try {
var converted = tsickle_1.convertDecorators(_this.program.getTypeChecker(), _this.program.getSourceFile(fileName));
if (converted.diagnostics) {
(_a = _this.diagnostics).push.apply(_a, converted.diagnostics);
}
newContent = converted.output + _this.TSICKLE_SUPPORT;
}
catch (e) {
console.error('Cannot convertDecorators on file', fileName);
throw e;
}
}
return ts.createSourceFile(fileName, newContent, languageVersion, true);
var _a;
};
}
this.getSourceFile = function (fileName, languageVersion, onError) {
var originalContent = _this.delegate.readFile(fileName);
var newContent = originalContent;
if (!/\.d\.ts$/.test(fileName)) {
try {
var converted = tsickle.convertDecorators(_this.program.getTypeChecker(), _this.program.getSourceFile(fileName));
if (converted.diagnostics) {
(_a = _this.diagnostics).push.apply(_a, converted.diagnostics);
}
newContent = converted.output + _this.ANNOTATION_SUPPORT;
}
catch (e) {
console.error('Cannot convertDecorators on file', fileName);
throw e;
}
}
return ts.createSourceFile(fileName, newContent, languageVersion, true);
var _a;
};
}