chore(typescript 1.6 upgrade): fix build.js and docs

This commit is contained in:
Alex Eagle
2015-09-23 15:02:37 -07:00
committed by Victor Savkin
parent 2ee32fb02c
commit 7a53f82516
12 changed files with 148 additions and 124 deletions

View File

@ -56,7 +56,14 @@ module.exports = function createCompilerHost(log) {
},
getNewLine: function() {
return ts.sys.newLine;
},
fileExists: function(fileName) {
var stats;
fs.stat(fileName, function(err, s) {
stats = s;
});
return !!stats;
}
};
};
};
};

View File

@ -38,7 +38,7 @@ describe('createCompilerHost', function() {
describe('getDefaultLibFileName', function() {
it('should return a path to the default library', function() {
expect(host.getDefaultLibFileName(options)).toContain('typescript/bin/lib.d.ts');
expect(host.getDefaultLibFileName(options)).toContain('typescript/lib/lib.d.ts');
});
});
@ -77,4 +77,4 @@ describe('createCompilerHost', function() {
expect(host.getNewLine()).toEqual(require('os').EOL);
});
});
});
});

View File

@ -4,6 +4,9 @@ var ts = require('typescript');
module.exports = function getFileInfo(log) {
return function (symbol, basePath) {
if (!symbol.declarations) {
console.log("ouch", symbol);
}
var fileName = ts.getSourceFileOfNode(symbol.declarations[0]).fileName;
var file = path.resolve(basePath, fileName);
@ -17,4 +20,4 @@ module.exports = function getFileInfo(log) {
};
return fileInfo;
};
};
};