PageAgent: fix for main script without extension
Fixed a bug where `node --debug app` caused node-inspector to add a non-existent file `app` into the resource tree.
This commit is contained in:
Родитель
93905ac7f2
Коммит
fdc55decf6
|
@ -51,12 +51,22 @@ PageAgent.prototype = {
|
|||
function(evaluateResult, cb) {
|
||||
cb(null, evaluateResult[0], evaluateResult[1]);
|
||||
},
|
||||
this._resolveMainAppScript.bind(this),
|
||||
this._getResourceTreeForAppScript.bind(this)
|
||||
],
|
||||
done
|
||||
);
|
||||
},
|
||||
|
||||
_resolveMainAppScript: function(startDirectory, mainAppScript, done) {
|
||||
fs.stat(mainAppScript, function(err, stat) {
|
||||
if (err && !/\.js$/.test(mainAppScript)) {
|
||||
mainAppScript += '.js';
|
||||
}
|
||||
return done(null, startDirectory, mainAppScript);
|
||||
});
|
||||
},
|
||||
|
||||
_getResourceTreeForAppScript: function(startDirectory, mainAppScript, done) {
|
||||
async.waterfall(
|
||||
[
|
||||
|
|
Загрузка…
Ссылка в новой задаче