Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Commit

Permalink
fix(*): latest ts nightlies
Browse files Browse the repository at this point in the history
  • Loading branch information
s-panferov committed Mar 29, 2016
1 parent 475c9f9 commit 0d9e687
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"ps-node": "0.0.5",
"rimraf": "^2.5.0",
"tslint": "3.5.0-dev.1",
"typescript": "^1.9.0-dev.20160321",
"typescript": "^1.9.0-dev.20160319",
"webpack": "2.1.0-beta.4"
}
}
2 changes: 1 addition & 1 deletion src/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class FileAnalyzer {
}

async findImportDeclarations(resolver: IResolver, fileName: string): Promise<string[]> {
let sourceFile = this.state.services.getSourceFile(fileName);
let sourceFile = this.state.getSourceFile(fileName);
let isDeclaration = isTypeDeclaration(fileName);

let imports = [];
Expand Down
6 changes: 6 additions & 0 deletions src/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ export class State {
return Object.keys(this.files);
}

getSourceFile(fileName: string): ts.SourceFile {
let services: any = this.services;
// FIXME @spanferov `getNonBoundSourceFile` is internal API
return (services.getSourceFile || services.getNonBoundSourceFile)(fileName);
}

/**
* Returns all the files in this state.
* Don't add new files using this value (eg `allFiles()[newFilePath] = ...`), just use it as a
Expand Down

0 comments on commit 0d9e687

Please sign in to comment.