|
Lines 351-369
define([
Link Here
|
| 351 |
if (!/(\.js)$/.test(modulePath)) { |
351 |
if (!/(\.js)$/.test(modulePath)) { |
| 352 |
fileToLoad += ".js"; |
352 |
fileToLoad += ".js"; |
| 353 |
} |
353 |
} |
| 354 |
if (!/(\.js)$/.test(modulePath)) { |
354 |
return fileclient.read(fileToLoad).then(function(contents) { |
| 355 |
fileToLoad += ".js"; |
|
|
| 356 |
} |
| 357 |
return fileclient.read(filePath).then(function(contents) { |
| 358 |
if (contents) { |
355 |
if (contents) { |
| 359 |
response.args.contents = contents; |
356 |
response.args.contents = contents; |
| 360 |
ternWorker.postMessage(response); |
357 |
response.args.file = fileToLoad; |
| 361 |
} else { |
358 |
return ternWorker.postMessage(response); |
| 362 |
_nodeRead(response, moduleName, filePath, fileclient, "No contents", depth, false); |
|
|
| 363 |
} |
359 |
} |
|
|
360 |
_failedRead(response, moduleName, 'Could not read module: ' + moduleName); |
| 364 |
}, |
361 |
}, |
| 365 |
function(err) { |
362 |
function(err) { |
| 366 |
_nodeRead(response, moduleName, filePath, fileclient, err, depth, false); |
363 |
_failedRead(response, moduleName, err); |
| 367 |
}); |
364 |
}); |
| 368 |
} |
365 |
} |
| 369 |
return fileclient.read(modulePath + "/package.json", false, false, { |
366 |
return fileclient.read(modulePath + "/package.json", false, false, { |