-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(debugger): make element explorer work with node 0.12.0 #1898
Conversation
0625426
to
1d40a24
Compare
}, function() {}); | ||
}); | ||
|
||
process.debugPort = opt_port || 5858 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a trailing ';' here.
oops, forgot to run through linter. Made some style changes thanks @tullmann |
That indeed unlocked the |
Node versions above 0.10.30 is affected by the nodejs bug described here: #1890 (i.e. elementexplorer/pause works but suffer delays) |
Yes but I was experiencing a different bug, the debugger wouldn't work at all, it was impossible to enter any command. With these commits I fall back to that sluggish bug indeed. Using protractor 1.6.1 didn't work for me either (may do with these commits if compatible though), so just saying for any potential iojs user. Thanks for your work. |
2bd6f14
to
85e18f0
Compare
@juliemr when you review this, please take note of how I check the port for whether it is in use or not, as I'm not sure if that's the best way to do it. |
252d7d3
to
fd05ef1
Compare
544d59e
to
1709e62
Compare
Node has changed its debugger significantly in 0.12.0, and these changes are necessary to get it to work now. Specifically here are the key points to take note: * Before, the process continues running after `process._debugProcess(pid);` is called, but now, the process stops. > To over come this, the call to `process._debugProcess(pid)` is moved from protractor into the debugger client. Secondly, because the process stops after the call, we call `reqContinue` once the debugger connection is established, so that protractor continues into the first break point (for backwards compatibility, we added an extra empty webdriver command so that in earlier versions of node, protractor doesn't go past the first break point from the reqContinue). * Before repl provides '(foobar\n)' when an user inputs 'foobar'. Now it is just 'foobar\n'. > We will parse and strip away both the parenthesis and '\n' to support all versions of node. * Additionally (non-related to node 0.12.0), this change makes debugger processes fail fast if the port is taken.
+1 |
1 similar comment
👍 |
@@ -103,6 +99,11 @@ WdDebugger.prototype.initRepl_ = function() { | |||
|
|||
// We want the prompt to show up only after the controlflow text prints. | |||
this.dbgRepl.printControlFlow_(function() { | |||
// Backward compatibility: node version 0.8.14 has a number of built in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to worry about versions <10 anymore, feel free to remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping this, as discussed offline.
Looks good, just a couple questions to make sure I understand the changes. |
merged: de49969 |
Node has changed its debugger significantly in 0.12.0, and these changes are necessary to get it to work now.
Specifically here are the key points to take note:
process._debugProcess(pid);
is called, but now, the process stops.To over come this, the call to
process._debugProcess(pid)
is moved from protractor into the debugger client. Secondly, because the process stops after the call, we callreqContinue
once the debugger connection is established, so that protractor continues into the first break point (for backwards compatibility, we added an extra empty webdriver command so that in earlier versions of node, protractor doesn't go past the first break point from the reqContinue).We will parse and strip away both the parenthesis and '\n' to support all versions of node.
Additionally, this change makes debugger processes fail fast if the port is taken.