TypeScript/tests/baselines/reference/undeclaredModuleError.js
2014-07-12 17:30:19 -07:00

39 lines
1.3 KiB
JavaScript

//// [undeclaredModuleError.ts]
import fs = require('fs');
function readdir(path: string, accept: (stat: fs.Stats, name: string) => boolean, callback: (error: Error, results: { name: string; stat: fs.Stats; }[]) => void ) {}
function join(...paths: string[]) {}
function instrumentFile(covFileDir: string, covFileName: string, originalFilePath: string) {
fs.readFile(originalFilePath, () => {
readdir(covFileDir, () => {
} , (error: Error, files: {}[]) => {
files.forEach((file) => {
var fullPath = join(IDoNotExist);
} );
} );
} );
}
//// [undeclaredModuleError.js]
define(["require", "exports", 'fs'], function (require, exports, fs) {
function readdir(path, accept, callback) {
}
function join() {
var paths = [];
for (var _i = 0; _i < arguments.length; _i++) {
paths[_i - 0] = arguments[_i];
}
}
function instrumentFile(covFileDir, covFileName, originalFilePath) {
fs.readFile(originalFilePath, function () {
readdir(covFileDir, function () {
}, function (error, files) {
files.forEach(function (file) {
var fullPath = join(IDoNotExist);
});
});
});
}
});