Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function CompilerHost(program, options, context) {
this.program = program;
this.options = options;
this.context = context;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
this.resolverCache = new Map();
// normalize the path so that it never ends with '/'.
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
var genPath = path.relative(this.basePath, this.genDir);
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
}
// We use absolute paths on disk as canonical.
function CompilerHost(program, options, context, collectorOptions) {
var _this = this;
this.program = program;
this.options = options;
this.context = context;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
this.resolverCache = new Map();
this.flatModuleIndexCache = new Map();
this.flatModuleIndexNames = new Set();
this.flatModuleIndexRedirectNames = new Set();
this.moduleFileNames = new Map();
// normalize the path so that it never ends with '/'.
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
var genPath = path.relative(this.basePath, this.genDir);
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
this.resolveModuleNameHost = Object.create(this.context);
// When calling ts.resolveModuleName,
// additional allow checks for .d.ts files to be done based on
// checks for .ngsummary.json files,
// so that our codegen depends on fewer inputs and requires to be called
// less often.
function CompilerHost(program, options, context, collectorOptions) {
var _this = this;
this.program = program;
this.options = options;
this.context = context;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
this.resolverCache = new Map();
this.flatModuleIndexCache = new Map();
this.flatModuleIndexNames = new Set();
this.flatModuleIndexRedirectNames = new Set();
this.moduleFileNames = new Map();
// normalize the path so that it never ends with '/'.
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
var genPath = path.relative(this.basePath, this.genDir);
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
this.resolveModuleNameHost = Object.create(this.context);
// When calling ts.resolveModuleName,
// additional allow checks for .d.ts files to be done based on
// checks for .ngsummary.json files,
// so that our codegen depends on fewer inputs and requires to be called
// less often.
function ReflectorHost(program, compilerHost, options, context) {
this.program = program;
this.compilerHost = compilerHost;
this.options = options;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
this.typeCache = new Map();
this.resolverCache = new Map();
// normalize the path so that it never ends with '/'.
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
this.context = context || new NodeReflectorHostContext(compilerHost);
var genPath = path.relative(this.basePath, this.genDir);
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
}
ReflectorHost.prototype.angularImportLocations = function () {
function CompilerHost(program, options, context, collectorOptions) {
var _this = this;
this.program = program;
this.options = options;
this.context = context;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
this.resolverCache = new Map();
this.bundleIndexCache = new Map();
this.bundleIndexNames = new Set();
this.moduleFileNames = new Map();
// normalize the path so that it never ends with '/'.
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
var genPath = path.relative(this.basePath, this.genDir);
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
this.resolveModuleNameHost = Object.create(this.context);
// When calling ts.resolveModuleName,
// additional allow checks for .d.ts files to be done based on
// checks for .ngsummary.json files,
// so that our codegen depends on fewer inputs and requires to be called
// less often.
// This is needed as we use ts.resolveModuleName in reflector_host
function ReflectorHost(program, compilerHost, options, context) {
this.program = program;
this.compilerHost = compilerHost;
this.options = options;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
this.typeCache = new Map();
this.resolverCache = new Map();
// normalize the path so that it never ends with '/'.
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
this.context = context || new NodeReflectorHostContext();
var genPath = path.relative(this.basePath, this.genDir);
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
}
ReflectorHost.prototype.angularImportLocations = function () {
function CompilerHost(program, options, context, collectorOptions) {
var _this = this;
this.program = program;
this.options = options;
this.context = context;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
this.resolverCache = new Map();
this.bundleIndexCache = new Map();
this.bundleIndexNames = new Set();
this.moduleFileNames = new Map();
// normalize the path so that it never ends with '/'.
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
var genPath = path.relative(this.basePath, this.genDir);
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
this.resolveModuleNameHost = Object.create(this.context);
// When calling ts.resolveModuleName,
// additional allow checks for .d.ts files to be done based on
// checks for .ngsummary.json files,
// so that our codegen depends on fewer inputs and requires to be called
// less often.
// This is needed as we use ts.resolveModuleName in reflector_host
function AngularCompilerProgram(rootNames, options, host, oldProgram) {
this.rootNames = rootNames;
this.options = options;
this.host = host;
this.oldProgram = oldProgram;
this._structuralDiagnostics = [];
this.oldTsProgram = oldProgram ? oldProgram.getTsProgram() : undefined;
this.tsProgram = ts.createProgram(rootNames, options, host, this.oldTsProgram);
this.srcNames = this.tsProgram.getSourceFiles().map(function (sf) { return sf.fileName; });
this.aotCompilerHost = new compiler_host_1.CompilerHost(this.tsProgram, options, host);
if (host.readResource) {
this.aotCompilerHost.loadResource = host.readResource.bind(host);
}
var compiler = compiler_1.createAotCompiler(this.aotCompilerHost, options).compiler;
this.compiler = compiler;
this.collector = new tsc_wrapped_1.MetadataCollector({ quotedNames: true });
}
// Program implementation
function ReflectorHost(program, compilerHost, options, context) {
this.program = program;
this.compilerHost = compilerHost;
this.options = options;
this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
this.typeCache = new Map();
this.resolverCache = new Map();
// normalize the path so that it never ends with '/'.
this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
this.context = context || new NodeReflectorHostContext();
var genPath = path.relative(this.basePath, this.genDir);
this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
}
ReflectorHost.prototype.angularImportLocations = function () {