refactor(compiler): add createAotCompiler factory

Also adds 2 more methods to the `AotCompilerHost`:
- `loadResource`
- `resolveFileToImport`
This commit is contained in:
Tobias Bosch
2016-11-15 11:13:20 -08:00
committed by Chuck Jazdzewski
parent 0c98f45105
commit 170525a225
13 changed files with 174 additions and 100 deletions

View File

@ -511,6 +511,12 @@ class MockAotCompilerHost implements AotCompilerHost {
constructor() {}
loadResource(filePath: string): Promise<string> { throw new Error('Should not be called!'); }
resolveFileToImport(importedFilePath: string, containingFilePath: string): string {
throw new Error('Should not be called!');
}
// In tests, assume that symbols are not re-exported
resolveImportToFile(modulePath: string, containingFile?: string): string {
function splitPath(path: string): string[] { return path.split(/\/|\\/g); }