Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
14e3ad0
inspector: proper WS URLs when bound to 0.0.0.0
Mar 1, 2017
5b1d61c
child_process: fix deoptimizing use of arguments
vsemozhetbyt Feb 19, 2017
9a59913
util: avoid using forEach
jasnell Feb 27, 2017
5408301
tls: keep track of stream that is closed
jBarz Mar 9, 2017
646ee55
tls: avoid using forEach
jasnell Feb 26, 2017
5f6025b
test: fail when child dies in fork-net
joyeecheung Mar 4, 2017
c9cf922
test: add regex to assert.throws
matejkrajcovic Mar 12, 2017
d2c9111
test: fix repl-function-redefinition-edge-case
aqrln Mar 8, 2017
2df662c
test: test resolveObject with an empty path
watilde Mar 14, 2017
2649dab
test: added test for indexed properties
AnnaMag Mar 9, 2017
f9c831f
test: fix flaky test-domain-abort-on-uncaught
Trott Mar 12, 2017
560d8ee
test: delay child exit in AIX for pseudo-tty tests
gireeshpunathil Mar 6, 2017
3ae58ac
test: failing behaviour on sandboxed Proxy
AnnaMag Mar 2, 2017
8bda7b8
test: add coverage for child_process bounds check
Trott Mar 11, 2017
2cab00a
test: fix assertion in vm test
AnnaMag Mar 14, 2017
90be5a1
stream: avoid using forEach
jasnell Feb 26, 2017
62e7261
repl: avoid using forEach
jasnell Feb 27, 2017
e19ca8b
readline: remove unneeded eslint-disable comment
Trott Mar 14, 2017
a0b1aa1
readline: avoid using forEach
jasnell Feb 27, 2017
c0a2e02
net: avoid using forEach
jasnell Feb 27, 2017
7e23072
module: avoid using forEach
jasnell Feb 27, 2017
77c69f7
lib, test: add duplicate symbol checking in E()
davidtaikocha Mar 13, 2017
9cc712c
lib: remove unused msg parameter in debug_agent
mr-spd Mar 13, 2017
fbbcd1a
lib: Fix swallowed events in inspect integration
Mar 15, 2017
cde5d71
doc: var -> let / const in events.md
vsemozhetbyt Mar 12, 2017
e6f113d
doc: console.log() -> console.error() in events.md
vsemozhetbyt Mar 12, 2017
ae52b63
doc: correct comment error in stream.md
Alex-Sokolov Mar 11, 2017
75fcf53
doc: missing argument types for events methods
ameliavoncat Mar 11, 2017
e84e33c
doc: fix a typo in api/process.md
sabakugaara Mar 10, 2017
78ca15d
doc: argument types for dns methods
ameliavoncat Mar 9, 2017
54879ab
doc: fix mistakes in stream doc (object mode)
chdh Mar 12, 2017
9861ec9
doc: increase Buffer.concat() documentation
cjihrig Mar 14, 2017
7c7228e
doc: gcc version is at least 4.8.5 in BUILDING.md
detailyang Mar 14, 2017
6d6a65e
doc: linkable commit message guidelines
sam-github Mar 10, 2017
0c09126
doc: add note that vm module is not a security mechanism
krydos Feb 25, 2017
a5f7393
doc: add vsemozhetbyt to collaborators
vsemozhetbyt Mar 20, 2017
a7e4b02
deps: Add node-inspect 1.10.6
Mar 15, 2017
5244ee3
build: mac OBJ_DIR should point to obj.target
danbev Mar 15, 2017
80949f3
build: add cpp linting to windows build
Mar 15, 2017
d0fb578
fs: avoid using forEach
jasnell Feb 26, 2017
dcac2d8
benchmark: benchmark comparing forEach with for
jasnell Feb 26, 2017
ca31986
deps: cherry-pick ca0f9573 from V8 upstream
ofrobots Mar 20, 2017
f48763c
benchmark: remove benchmarks forced optimizations
bzoz Feb 28, 2017
60ad7af
doc: deprecate debug protocol
Dec 17, 2016
0c00b65
Fix #7065: cli help documentation for --inspect
Mar 16, 2017
c626734
tls: fix segfault on destroy after partial read
bnoordhuis Mar 17, 2017
44b4c0b
2017-03-21, Version 7.7.4 (Current)
cjihrig Mar 21, 2017
bc664cb
Working on v7.7.5
cjihrig Mar 21, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: Add node-inspect 1.10.6
This updates the bundled `node-inspect` to 1.10.6.

Highlights:

* `node --debug-port=1234 inspect` respects the custom port.
* Test stability improvements on various platforms.

Compare: nodejs/node-inspect@v1.10.4...v1.10.6

PR-URL: #11869
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Jan Krems authored and Italo A. Casas committed Mar 20, 2017
commit a7e4b029da9018a468fcf28e9e19a9b6a3b6f997
27 changes: 27 additions & 0 deletions deps/node-inspect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
### 1.10.6

* chore: Fix usage text for embedded mode - **[@addaleax](https://github.com/addaleax)** [#20](https://github.com/nodejs/node-inspect/pull/20)
- [`b0779f5`](https://github.com/nodejs/node-inspect/commit/b0779f597104e9ada5681f64d7e714525b753511) **chore:** Fix usage text for embedded mode
* print 'ok' after connection - **[@ofrobots](https://github.com/ofrobots)** [#25](https://github.com/nodejs/node-inspect/pull/25)
- [`2a47125`](https://github.com/nodejs/node-inspect/commit/2a4712577f6996fbb078dcfcd7320c397685d76a) **fix:** print 'ok' after connection
* Make autocompletion in REPL work - **[@aqrln](https://github.com/aqrln)** [#28](https://github.com/nodejs/node-inspect/pull/28)
- [`ccab737`](https://github.com/nodejs/node-inspect/commit/ccab737399249a8c2230ed6adfec579c7d724364) **fix:** Make autocompletion in REPL work
* Remove console.error() statement - **[@aqrln](https://github.com/aqrln)** [#30](https://github.com/nodejs/node-inspect/pull/30)
- [`032b045`](https://github.com/nodejs/node-inspect/commit/032b045d4d73622c77b7ebcc26781c6ad98200b3) **style:** Remove console.error() statement
* Take --debug-port into account - **[@jkrems](https://github.com/jkrems)** [#26](https://github.com/nodejs/node-inspect/pull/26)
- [`054d4b1`](https://github.com/nodejs/node-inspect/commit/054d4b10e65f12a3a4b10b4c0ab2a4768cc5e893) **fix:** Take --debug-port into account
* Delay run until breakpoints are restored - **[@jkrems](https://github.com/jkrems)** [#34](https://github.com/nodejs/node-inspect/pull/34)
- [`802b88c`](https://github.com/nodejs/node-inspect/commit/802b88c8ad0a57608cb9e0cb4bf46ed683bb6344) **fix:** Delay run until breakpoints are restored
- [`2b93173`](https://github.com/nodejs/node-inspect/commit/2b93173d95e7f8b30d85603613cb2ae3b3ec18db) **fix:** Use single string for paused notice
- [`b4d5ee2`](https://github.com/nodejs/node-inspect/commit/b4d5ee2a3d25613b35a2e8e10a0eb75582cc5654) **fix:** Work around inconsistent handling of strict directive
- [`f6ccfc7`](https://github.com/nodejs/node-inspect/commit/f6ccfc7f4d00ad4fdf3b581b677f8d7f1699c44c) **fix:** Only restart after port is free
- [`8b101bf`](https://github.com/nodejs/node-inspect/commit/8b101bf669ca102df4980bfad3e0436ef1c2f1a4) **test:** Skip exact match on AIX
* [`a4e4b6f`](https://github.com/nodejs/node-inspect/commit/a4e4b6feeba4dedfd2c89ef32f39e813314d3bbd) **chore:** Fix repo info in package.json


### 1.10.5

* docs: minor edits to governance docs - **[@joshgav](https://github.com/joshgav)** [#17](https://github.com/buggerjs/node-inspect/pull/17)
- [`a70fe04`](https://github.com/buggerjs/node-inspect/commit/a70fe04bdde9b7c74588685066291f9b11183328) **docs:** minor edits to governance docs


### 1.10.4

* [`1c31bf7`](https://github.com/buggerjs/node-inspect/commit/1c31bf7d1b3ea1b424ae0662526596670cb506c9) **chore:** Support embedded mode
Expand Down
14 changes: 6 additions & 8 deletions deps/node-inspect/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@

This document outlines some of the practices we care about.
If you have any questions or suggestions about the process,
feel free to [open an issue](#reporting-issues)
.
feel free to [open an issue](#reporting-issues).

## Code of Conduct

The [Node.js Code of Conduct][] applies to this repo.

[Node.js Code of Conduct]: https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md

## Code Contributions
## Governance

The nodereport project falls under the governance of the diagnostics
working group which is documented in:
https://github.com/nodejs/diagnostics/blob/master/GOVERNANCE.md.
This project falls under the governance of the Node.js Diagnostics WG as
described at <https://github.com/nodejs/diagnostics/blob/master/GOVERNANCE.md>.

## Developer's Certificate of Origin 1.1

Expand Down Expand Up @@ -51,7 +49,7 @@ By making a contribution to this project, I certify that:

If you find any mistakes in the docs or a bug in the code,
please [open an issue in Github](https://github.com/nodejs/node-inspect/issues/new) so we can look into it.
You can also [create a PR](#contributing-code) fixing it yourself, or course.
You can also [create a PR](#contributing-code) fixing it yourself of course.

If you report a bug, please follow these guidelines:

Expand All @@ -67,7 +65,7 @@ If you report a bug, please follow these guidelines:

For small documentation changes, you can use [Github's editing feature](https://help.github.com/articles/editing-files-in-another-user-s-repository/).
The only thing to keep in mind is to prefix the commit message with "docs: ".
The detault commit message generated by Github will lead to a failing CI build.
The default commit message generated by Github will lead to a failing CI build.

For larger updates to the documentation
it might be better to follow the [instructions for contributing code below](#contributing-code).
Expand Down
5 changes: 2 additions & 3 deletions deps/node-inspect/GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# node-inspect Project Governance

The node-inspect project falls under the governance of the diagnostics
working group which is documented in:
https://github.com/nodejs/diagnostics/blob/master/GOVERNANCE.md.
The node-inspect project is governed by the Node.js Diagnostics WG as described
at <https://github.com/nodejs/diagnostics/blob/master/GOVERNANCE.md>.
1 change: 0 additions & 1 deletion deps/node-inspect/examples/alive.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
let x = 0;
function heartbeat() {
++x;
Expand Down
1 change: 0 additions & 1 deletion deps/node-inspect/examples/backtrace.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
const { exports: moduleScoped } = module;

function topFn(a, b = false) {
Expand Down
4 changes: 2 additions & 2 deletions deps/node-inspect/examples/cjs/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const fourty = 40;
const { add } = require('./other');

const sum = add(40, 2);
const sum = add(fourty, 2);
module.exports = sum;
1 change: 0 additions & 1 deletion deps/node-inspect/examples/cjs/other.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
exports.add = function add(a, b) {
return a + b;
};
1 change: 0 additions & 1 deletion deps/node-inspect/examples/exceptions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
let error = null;
try {
throw new Error('Caught');
Expand Down
1 change: 0 additions & 1 deletion deps/node-inspect/examples/three-lines.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
let x = 1;
x = x + 1;
module.exports = x;
2 changes: 2 additions & 0 deletions deps/node-inspect/examples/use-strict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use strict';
console.log('first real line');
91 changes: 79 additions & 12 deletions deps/node-inspect/lib/_inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@
'use strict';
const { spawn } = require('child_process');
const { EventEmitter } = require('events');
const net = require('net');
const util = require('util');

const runAsStandalone = typeof __dirname !== 'undefined';

const [ InspectClient, createRepl ] =
(typeof __dirname !== 'undefined') ?
runAsStandalone ?
// This copy of node-inspect is on-disk, relative paths make sense.
[
require('./internal/inspect_client'),
Expand All @@ -39,7 +42,16 @@ const [ InspectClient, createRepl ] =

const debuglog = util.debuglog('inspect');

exports.port = 9229;
const DEBUG_PORT_PATTERN = /^--(?:debug|inspect)-port=(\d+)$/;
function getDefaultPort() {
for (const arg of process.execArgv) {
const match = arg.match(DEBUG_PORT_PATTERN);
if (match) {
return +match[1];
}
}
return 9229;
}

function runScript(script, scriptArgs, inspectPort, childPrint) {
return new Promise((resolve) => {
Expand Down Expand Up @@ -88,6 +100,45 @@ function createAgentProxy(domain, client) {
});
}

function portIsFree(host, port, timeout = 2000) {
const retryDelay = 150;
let didTimeOut = false;

return new Promise((resolve, reject) => {
setTimeout(() => {
didTimeOut = true;
reject(new Error(
`Timeout (${timeout}) waiting for ${host}:${port} to be free`));
}, timeout);

function pingPort() {
if (didTimeOut) return;

const socket = net.connect(port, host);
let didRetry = false;
function retry() {
if (!didRetry && !didTimeOut) {
didRetry = true;
setTimeout(pingPort, retryDelay);
}
}

socket.on('error', (error) => {
if (error.code === 'ECONNREFUSED') {
resolve();
} else {
retry();
}
});
socket.on('connect', () => {
socket.destroy();
retry();
});
}
pingPort();
});
}

class NodeInspector {
constructor(options, stdin, stdout) {
this.options = options;
Expand Down Expand Up @@ -128,8 +179,9 @@ class NodeInspector {
process.once('SIGHUP', process.exit.bind(process, 0));

this.run()
.then(() => {
this.repl = startRepl();
.then(() => startRepl())
.then((repl) => {
this.repl = repl;
this.repl.on('exit', () => {
process.exit(0);
});
Expand All @@ -139,15 +191,19 @@ class NodeInspector {
}

suspendReplWhile(fn) {
this.repl.rli.pause();
if (this.repl) {
this.repl.rli.pause();
}
this.stdin.pause();
this.paused = true;
return new Promise((resolve) => {
resolve(fn());
}).then(() => {
this.paused = false;
this.repl.rli.resume();
this.repl.displayPrompt();
if (this.repl) {
this.repl.rli.resume();
this.repl.displayPrompt();
}
this.stdin.resume();
}).then(null, (error) => process.nextTick(() => { throw error; }));
}
Expand All @@ -162,7 +218,14 @@ class NodeInspector {

run() {
this.killChild();
return this._runScript().then((child) => {
const { host, port } = this.options;

const runOncePortIsFree = () => {
return portIsFree(host, port)
.then(() => this._runScript());
};

return runOncePortIsFree().then((child) => {
this.child = child;

let connectionAttempts = 0;
Expand All @@ -173,6 +236,7 @@ class NodeInspector {
return this.client.connect()
.then(() => {
debuglog('connection established');
this.stdout.write(' ok');
}, (error) => {
debuglog('connect failed', error);
// If it's failed to connect 10 times then print failed message
Expand All @@ -186,7 +250,6 @@ class NodeInspector {
});
};

const { host, port } = this.options;
this.print(`connecting to ${host}:${port} ..`, true);
return attemptConnect();
});
Expand Down Expand Up @@ -225,7 +288,7 @@ class NodeInspector {

function parseArgv([target, ...args]) {
let host = '127.0.0.1';
let port = exports.port;
let port = getDefaultPort();
let isRemote = false;
let script = target;
let scriptArgs = args;
Expand Down Expand Up @@ -258,8 +321,12 @@ function startInspect(argv = process.argv.slice(2),
stdout = process.stdout) {
/* eslint-disable no-console */
if (argv.length < 1) {
console.error('Usage: node-inspect script.js');
console.error(' node-inspect <host>:<port>');
const invokedAs = runAsStandalone ?
'node-inspect' :
`${process.argv0} ${process.argv[1]}`;

console.error(`Usage: ${invokedAs} script.js`);
console.error(` ${invokedAs} <host>:<port>`);
process.exit(1);
}

Expand Down
15 changes: 1 addition & 14 deletions deps/node-inspect/lib/internal/inspect_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,20 +334,7 @@ class Client extends EventEmitter {
this.emit('close');
});

Promise.all([
this.callMethod('Runtime.enable'),
this.callMethod('Debugger.enable'),
this.callMethod('Debugger.setPauseOnExceptions', { state: 'none' }),
this.callMethod('Debugger.setAsyncCallStackDepth', { maxDepth: 0 }),
this.callMethod('Profiler.enable'),
this.callMethod('Profiler.setSamplingInterval', { interval: 100 }),
this.callMethod('Debugger.setBlackboxPatterns', { patterns: [] }),
this.callMethod('Runtime.runIfWaitingForDebugger'),
]).then(() => {
this.emit('ready');
}, (error) => {
this.emit('error', error);
});
this.emit('ready');
};

return new Promise((resolve, reject) => {
Expand Down
Loading