From 1013ab1ab70ffcd089c2aef5f71c32a561681bdf Mon Sep 17 00:00:00 2001 From: James Long Date: Thu, 3 Dec 2015 00:22:32 -0500 Subject: [PATCH 1/2] very basic, brittle node support --- client/debugger/content/actions/breakpoints.js | 5 +++-- client/debugger/content/components/Sources.js | 10 ++++++---- client/definitions.js | 8 ++++---- client/framework/index.js | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/client/debugger/content/actions/breakpoints.js b/client/debugger/content/actions/breakpoints.js index 95fc494..80ac2d3 100644 --- a/client/debugger/content/actions/breakpoints.js +++ b/client/debugger/content/actions/breakpoints.js @@ -40,6 +40,7 @@ function _getOrCreateBreakpoint(state, location, condition) { return getBreakpoint(state, location) || { location, condition }; } +let fakeBpId = 1; function addBreakpoint(location, condition) { return (dispatch, getState) => { if (_breakpointExists(getState(), location)) { @@ -64,7 +65,7 @@ function addBreakpoint(location, condition) { let { isPending, actualLocation } = response; // Save the client instance - setBreakpointClient(bpClient.actor, bpClient); + // setBreakpointClient(bpClient.actor, bpClient); return { //text: DebuggerView.editor.getText(bp.location.line - 1).trim(), @@ -74,7 +75,7 @@ function addBreakpoint(location, condition) { // the original requested placement for the breakpoint wasn't // accepted. actualLocation: isPending ? null : actualLocation, - actor: bpClient.actor + actor: 'bp' + (fakeBpId++) }; }) }); diff --git a/client/debugger/content/components/Sources.js b/client/debugger/content/components/Sources.js index e3e4bc7..f8a15d4 100644 --- a/client/debugger/content/components/Sources.js +++ b/client/debugger/content/components/Sources.js @@ -14,10 +14,12 @@ const Sources = React.createClass({ if(!source.url) { return; } - const location = parseURL(source.url); + const url = source.url.replace(/^file:\/\//, 'http://app'); + const location = parseURL(url); + const group = location.host || 'Internal'; - if(!groups[location.host]) { - groups[location.host] = []; + if(!groups[group]) { + groups[group] = []; } let label; if(location.pathname !== '/') { @@ -27,7 +29,7 @@ const Sources = React.createClass({ else { label = location.pathname; } - groups[location.host].push({ source, label }); + groups[group].push({ source, label }); }); return groups; }, diff --git a/client/definitions.js b/client/definitions.js index d672be2..6d06bf5 100644 --- a/client/definitions.js +++ b/client/definitions.js @@ -151,10 +151,10 @@ Tools.jsdebugger = { }; var defaultTools = [ - Tools.options, - Tools.webConsole, - Tools.inspector, - Tools.jsdebugger, + // Tools.options, + // Tools.webConsole, + // Tools.inspector, + Tools.jsdebugger ]; exports.defaultTools = defaultTools; diff --git a/client/framework/index.js b/client/framework/index.js index 03f26d8..51ec6a1 100644 --- a/client/framework/index.js +++ b/client/framework/index.js @@ -2,6 +2,6 @@ const Toolbox = require("devtools/client/framework/toolbox"); Toolbox.getWSTarget().then(target => { - const toolbox = new Toolbox.Toolbox(target, "inspector", "bottom"); + const toolbox = new Toolbox.Toolbox(target, "jsdebugger", "bottom"); return toolbox.open().then(() => console.log("Open finished")); }); From 38d6dc99a2499655b5151ad65323473e9ebb08ca Mon Sep 17 00:00:00 2001 From: James Long Date: Thu, 3 Dec 2015 00:28:30 -0500 Subject: [PATCH 2/2] modify valence to not force outstanding pauses to get node to work --- valence/lib/chromium/thread.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/valence/lib/chromium/thread.js b/valence/lib/chromium/thread.js index c37a28a..d9382be 100644 --- a/valence/lib/chromium/thread.js +++ b/valence/lib/chromium/thread.js @@ -620,18 +620,18 @@ var ChromiumThreadActor = protocol.ActorClass({ console.log("Resuming"); var wasKicked = false; - if (this.pauseOutstanding) { - this.resuming = true; - // The engine has a pause requested but doesn't actually pause - // until something happens. Evaluate a script to kick it into - // the pause state, and `onPaused` which simply resume from here - yield this.rpc.request("Runtime.evaluate", { - expression: "5" - }); - this.resuming = false; - this.pauseOutstanding = false; - wasKicked = true; - } + // if (this.pauseOutstanding) { + // this.resuming = true; + // // The engine has a pause requested but doesn't actually pause + // // until something happens. Evaluate a script to kick it into + // // the pause state, and `onPaused` which simply resume from here + // yield this.rpc.request("Runtime.evaluate", { + // expression: "5" + // }); + // this.resuming = false; + // this.pauseOutstanding = false; + // wasKicked = true; + // } this.state = "running"; yield this.updateExceptionState(this.getDesiredExceptionState());