Skip to content

Commit

Permalink
Merge pull request #1594 from Microsoft/allowNonTsExtensionsVsNoExten…
Browse files Browse the repository at this point in the history
…sions

fixes #1593
  • Loading branch information
mhegazy committed Jan 13, 2015
2 parents 1ebf905 + b399ce8 commit d8468f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5231,7 +5231,10 @@ module ts {
}
}
else {
if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) {
if(options.allowNonTsExtensions && !findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) {
diagnostic = Diagnostics.File_0_not_found;
}
else if (!findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) && !findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd)) {
diagnostic = Diagnostics.File_0_not_found;
filename += ".ts";
}
Expand Down

0 comments on commit d8468f7

Please sign in to comment.