experimental support for hiding scripts from view
This commit is contained in:
Родитель
8650e43c46
Коммит
62dccc42ce
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
v0.1.1
|
||||
|
||||
* Fixed pause button with node 0.3.1+
|
||||
|
||||
* Fixed page refresh with node 0.3.1+
|
||||
|
||||
* Shortened script file names in script list
|
||||
|
||||
* Updated node-websocket-server library
|
||||
|
||||
|
||||
v0.1.0
|
||||
|
||||
* Require node 0.3+
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var dserver = require('../lib/debug-server'),
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
options = {};
|
||||
|
||||
process.argv.forEach(function (arg) {
|
||||
|
@ -27,7 +29,16 @@ process.argv.forEach(function (arg) {
|
|||
}
|
||||
});
|
||||
|
||||
dserver.create(options).on('close', function () {
|
||||
console.log('session closed');
|
||||
process.exit();
|
||||
fs.readFile(path.join(__dirname, '../config.json'), function(err, data) {
|
||||
var config;
|
||||
if (err) {
|
||||
config = {};
|
||||
}
|
||||
else {
|
||||
config = JSON.parse(data);
|
||||
}
|
||||
dserver.create(options, config).on('close', function () {
|
||||
console.log('session closed');
|
||||
process.exit();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"hidden": [
|
||||
"buffer.js",
|
||||
"dns.js",
|
||||
"events.js",
|
||||
"freelist.js",
|
||||
"fs.js",
|
||||
"http.js",
|
||||
"net.js",
|
||||
"node.js",
|
||||
"path.js",
|
||||
"stream.js",
|
||||
"timers.js",
|
||||
"util.js"
|
||||
]
|
||||
}
|
|
@ -19,7 +19,7 @@ function override(options, defaults) {
|
|||
return result;
|
||||
}
|
||||
|
||||
exports.create = function(options) {
|
||||
exports.create = function(options, config) {
|
||||
var defaults = { webPort: 8080 },
|
||||
settings = override(options || {}, defaults),
|
||||
httpServer = Http.createServer(staticFile),
|
||||
|
@ -27,7 +27,7 @@ exports.create = function(options) {
|
|||
|
||||
wsServer.on('connection', function (conn) {
|
||||
var port = parseInt((/\?port=(\d+)/.exec(conn._req.url) || [null,'5858'])[1], 10),
|
||||
session = Session.create(conn, port);
|
||||
session = Session.create(conn, port, config);
|
||||
|
||||
conn.on('message', function (data) {
|
||||
session.handleRequest(data);
|
||||
|
|
|
@ -6,7 +6,7 @@ var http = require('http'),
|
|||
///////////////////////////////////////////////////////////
|
||||
// exports
|
||||
|
||||
exports.create = function (conn, debuggerPort) {
|
||||
exports.create = function (conn, debuggerPort, config) {
|
||||
var debug = null,
|
||||
//map from sourceID:lineNumber to breakpoint
|
||||
breakpoints = {},
|
||||
|
@ -171,7 +171,9 @@ exports.create = function (conn, debuggerPort) {
|
|||
sourceIDs[s.sourceID] = s.url;
|
||||
s.url = shorten(s.path);
|
||||
delete s.path;
|
||||
sendEvent('parsedScriptSource', s);
|
||||
if (!config.hidden || config.hidden.indexOf(s.url) === -1) {
|
||||
sendEvent('parsedScriptSource', s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче