| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e3f905a commit d42ad64
12 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,11 @@ | |||
| 1 | + ### 1.11.6 | ||
| 2 | + | ||
| 3 | + * fix: replace the deprecated "repl.cli" with "repl" - **[@oyyd](https://github.com/oyyd)** [#66](https://github.com/nodejs/node-inspect/pull/66) | ||
| 4 | + - [`5c1d771`](https://github.com/nodejs/node-inspect/commit/5c1d7716523b73e26f98f4f594ee34b7daa920a0) **fix:** replace the deprecated "repl.cli" with "repl" - see: [26260](Refs: https://github.com/nodejs/node/pull/26260) | ||
| 5 | + * Address regressions due to changes in node - **[@jkrems](https://github.com/jkrems)** [#67](https://github.com/nodejs/node-inspect/pull/67) | ||
| 6 | + - [`5b3511e`](https://github.com/nodejs/node-inspect/commit/5b3511ef21d0eba8304d8b2fed33f33aae22f308) **fix:** Address regressions due to changes in node | ||
| 7 | + | ||
| 8 | + | ||
| 1 | 9 | ### 1.11.5 | |
| 2 | 10 | ||
| 3 | 11 | * Fix eslint issues - **[@jkrems](https://github.com/jkrems)** [#63](https://github.com/nodejs/node-inspect/pull/63) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -198,7 +198,7 @@ class NodeInspector { | |||
| 198 | 198 | ||
| 199 | 199 | suspendReplWhile(fn) { | |
| 200 | 200 | if (this.repl) { | |
| 201 | - this.repl.rli.pause(); | ||
| 201 | + this.repl.pause(); | ||
| 202 | 202 | } | |
| 203 | 203 | this.stdin.pause(); | |
| 204 | 204 | this.paused = true; | |
@@ -207,7 +207,7 @@ class NodeInspector { | |||
| 207 | 207 | }).then(() => { | |
| 208 | 208 | this.paused = false; | |
| 209 | 209 | if (this.repl) { | |
| 210 | - this.repl.rli.resume(); | ||
| 210 | + this.repl.resume(); | ||
| 211 | 211 | this.repl.displayPrompt(); | |
| 212 | 212 | } | |
| 213 | 213 | this.stdin.resume(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,7 @@ const Path = require('path'); | |||
| 25 | 25 | const Repl = require('repl'); | |
| 26 | 26 | const util = require('util'); | |
| 27 | 27 | const vm = require('vm'); | |
| 28 | + const fileURLToPath = require('url').fileURLToPath; | ||
| 28 | 29 | ||
| 29 | 30 | const debuglog = util.debuglog('inspect'); | |
| 30 | 31 | ||
@@ -89,9 +90,12 @@ function isNativeUrl(url) { | |||
| 89 | 90 | return url.replace('.js', '') in NATIVES || url === 'bootstrap_node.js'; | |
| 90 | 91 | } | |
| 91 | 92 | ||
| 92 | - function getRelativePath(filename) { | ||
| 93 | + function getRelativePath(filenameOrURL) { | ||
| 93 | 94 | const dir = Path.join(Path.resolve(), 'x').slice(0, -1); | |
| 94 | 95 | ||
| 96 | + const filename = filenameOrURL.startsWith('file://') ? | ||
| 97 | + fileURLToPath(filenameOrURL) : filenameOrURL; | ||
| 98 | + | ||
| 95 | 99 | // Change path to relative, if possible | |
| 96 | 100 | if (filename.indexOf(dir) === 0) { | |
| 97 | 101 | return filename.slice(dir.length); | |
@@ -958,38 +962,38 @@ function createRepl(inspector) { | |||
| 958 | 962 | ||
| 959 | 963 | get repl() { | |
| 960 | 964 | // Don't display any default messages | |
| 961 | - const listeners = repl.rli.listeners('SIGINT').slice(0); | ||
| 962 | - repl.rli.removeAllListeners('SIGINT'); | ||
| 965 | + const listeners = repl.listeners('SIGINT').slice(0); | ||
| 966 | + repl.removeAllListeners('SIGINT'); | ||
| 963 | 967 | ||
| 964 | 968 | const oldContext = repl.context; | |
| 965 | 969 | ||
| 966 | 970 | exitDebugRepl = () => { | |
| 967 | 971 | // Restore all listeners | |
| 968 | 972 | process.nextTick(() => { | |
| 969 | 973 | listeners.forEach((listener) => { | |
| 970 | - repl.rli.on('SIGINT', listener); | ||
| 974 | + repl.on('SIGINT', listener); | ||
| 971 | 975 | }); | |
| 972 | 976 | }); | |
| 973 | 977 | ||
| 974 | 978 | // Exit debug repl | |
| 975 | 979 | repl.eval = controlEval; | |
| 976 | 980 | ||
| 977 | 981 | // Swap history | |
| 978 | - history.debug = repl.rli.history; | ||
| 979 | - repl.rli.history = history.control; | ||
| 982 | + history.debug = repl.history; | ||
| 983 | + repl.history = history.control; | ||
| 980 | 984 | ||
| 981 | 985 | repl.context = oldContext; | |
| 982 | - repl.rli.setPrompt('debug> '); | ||
| 986 | + repl.setPrompt('debug> '); | ||
| 983 | 987 | repl.displayPrompt(); | |
| 984 | 988 | ||
| 985 | - repl.rli.removeListener('SIGINT', exitDebugRepl); | ||
| 989 | + repl.removeListener('SIGINT', exitDebugRepl); | ||
| 986 | 990 | repl.removeListener('exit', exitDebugRepl); | |
| 987 | 991 | ||
| 988 | 992 | exitDebugRepl = null; | |
| 989 | 993 | }; | |
| 990 | 994 | ||
| 991 | 995 | // Exit debug repl on SIGINT | |
| 992 | - repl.rli.on('SIGINT', exitDebugRepl); | ||
| 996 | + repl.on('SIGINT', exitDebugRepl); | ||
| 993 | 997 | ||
| 994 | 998 | // Exit debug repl on repl exit | |
| 995 | 999 | repl.on('exit', exitDebugRepl); | |
@@ -999,10 +1003,10 @@ function createRepl(inspector) { | |||
| 999 | 1003 | repl.context = {}; | |
| 1000 | 1004 | ||
| 1001 | 1005 | // Swap history | |
| 1002 | - history.control = repl.rli.history; | ||
| 1003 | - repl.rli.history = history.debug; | ||
| 1006 | + history.control = repl.history; | ||
| 1007 | + repl.history = history.debug; | ||
| 1004 | 1008 | ||
| 1005 | - repl.rli.setPrompt('> '); | ||
| 1009 | + repl.setPrompt('> '); | ||
| 1006 | 1010 | ||
| 1007 | 1011 | print('Press Ctrl + C to leave debug repl'); | |
| 1008 | 1012 | repl.displayPrompt(); | |
@@ -1077,7 +1081,7 @@ function createRepl(inspector) { | |||
| 1077 | 1081 | ||
| 1078 | 1082 | repl.defineCommand('interrupt', () => { | |
| 1079 | 1083 | // We want this for testing purposes where sending CTRL-C can be tricky. | |
| 1080 | - repl.rli.emit('SIGINT'); | ||
| 1084 | + repl.emit('SIGINT'); | ||
| 1081 | 1085 | }); | |
| 1082 | 1086 | ||
| 1083 | 1087 | // Init once for the initial connection | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "name": "node-inspect", | |
| 3 | - "version": "1.11.5", | ||
| 3 | + "version": "1.11.6", | ||
| 4 | 4 | "description": "Node Inspect", | |
| 5 | 5 | "license": "MIT", | |
| 6 | 6 | "main": "lib/_inspect.js", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,12 +18,12 @@ test('stepping through breakpoints', (t) => { | |||
| 18 | 18 | .then(() => cli.waitForPrompt()) | |
| 19 | 19 | .then(() => { | |
| 20 | 20 | t.match( | |
| 21 | - cli.output, | ||
| 22 | - `break in ${script}:1`, | ||
| 21 | + cli.breakInfo, | ||
| 22 | + { filename: script, line: 1 }, | ||
| 23 | 23 | 'pauses in the first line of the script'); | |
| 24 | 24 | t.match( | |
| 25 | 25 | cli.output, | |
| 26 | - /> 1 \(function \([^)]+\) \{ const x = 10;/, | ||
| 26 | + /> 1 (?:\(function \([^)]+\) \{ )?const x = 10;/, | ||
| 27 | 27 | 'shows the source and marks the current line'); | |
| 28 | 28 | }) | |
| 29 | 29 | .then(() => cli.stepCommand('n')) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ test('break on (uncaught) exceptions', (t) => { | |||
| 17 | 17 | return cli.waitForInitialBreak() | |
| 18 | 18 | .then(() => cli.waitForPrompt()) | |
| 19 | 19 | .then(() => { | |
| 20 | - t.match(cli.output, `break in ${script}:1`); | ||
| 20 | + t.match(cli.breakInfo, { filename: script, line: 1 }); | ||
| 21 | 21 | }) | |
| 22 | 22 | // making sure it will die by default: | |
| 23 | 23 | .then(() => cli.command('c')) | |
@@ -28,7 +28,7 @@ test('break on (uncaught) exceptions', (t) => { | |||
| 28 | 28 | .then(() => cli.stepCommand('r')) | |
| 29 | 29 | .then(() => cli.waitForInitialBreak()) | |
| 30 | 30 | .then(() => { | |
| 31 | - t.match(cli.output, `break in ${script}:1`); | ||
| 31 | + t.match(cli.breakInfo, { filename: script, line: 1 }); | ||
| 32 | 32 | }) | |
| 33 | 33 | .then(() => cli.command('breakOnException')) | |
| 34 | 34 | .then(() => cli.stepCommand('c')) | |
@@ -45,7 +45,7 @@ test('break on (uncaught) exceptions', (t) => { | |||
| 45 | 45 | .then(() => cli.stepCommand('r')) // also, the setting survives the restart | |
| 46 | 46 | .then(() => cli.waitForInitialBreak()) | |
| 47 | 47 | .then(() => { | |
| 48 | - t.match(cli.output, `break in ${script}:1`); | ||
| 48 | + t.match(cli.breakInfo, { filename: script, line: 1 }); | ||
| 49 | 49 | }) | |
| 50 | 50 | .then(() => cli.stepCommand('c')) | |
| 51 | 51 | .then(() => { | |
@@ -57,7 +57,7 @@ test('break on (uncaught) exceptions', (t) => { | |||
| 57 | 57 | .then(() => cli.stepCommand('r')) | |
| 58 | 58 | .then(() => cli.waitForInitialBreak()) | |
| 59 | 59 | .then(() => { | |
| 60 | - t.match(cli.output, `break in ${script}:1`); | ||
| 60 | + t.match(cli.breakInfo, { filename: script, line: 1 }); | ||
| 61 | 61 | }) | |
| 62 | 62 | .then(() => cli.command('c')) | |
| 63 | 63 | // TODO: Remove FATAL ERROR once node doesn't show a FATAL ERROR anymore | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -137,23 +137,23 @@ test('run after quit / restart', (t) => { | |||
| 137 | 137 | .then(() => cli.waitForPrompt()) | |
| 138 | 138 | .then(() => { | |
| 139 | 139 | t.match( | |
| 140 | - cli.output, | ||
| 141 | - `break in ${script}:1`, | ||
| 140 | + cli.breakInfo, | ||
| 141 | + { filename: script, line: 1 }, | ||
| 142 | 142 | 'is back at the beginning'); | |
| 143 | 143 | }) | |
| 144 | 144 | .then(() => cli.stepCommand('n')) | |
| 145 | 145 | .then(() => { | |
| 146 | 146 | t.match( | |
| 147 | - cli.output, | ||
| 148 | - `break in ${script}:2`, | ||
| 147 | + cli.breakInfo, | ||
| 148 | + { filename: script, line: 2 }, | ||
| 149 | 149 | 'steps to the 2nd line'); | |
| 150 | 150 | }) | |
| 151 | 151 | .then(() => cli.stepCommand('restart')) | |
| 152 | 152 | .then(() => cli.waitForInitialBreak()) | |
| 153 | 153 | .then(() => { | |
| 154 | 154 | t.match( | |
| 155 | - cli.output, | ||
| 156 | - `break in ${script}:1`, | ||
| 155 | + cli.breakInfo, | ||
| 156 | + { filename: script, line: 1 }, | ||
| 157 | 157 | 'is back at the beginning'); | |
| 158 | 158 | }) | |
| 159 | 159 | .then(() => cli.command('kill')) | |
@@ -167,8 +167,8 @@ test('run after quit / restart', (t) => { | |||
| 167 | 167 | .then(() => cli.waitForPrompt()) | |
| 168 | 168 | .then(() => { | |
| 169 | 169 | t.match( | |
| 170 | - cli.output, | ||
| 171 | - `break in ${script}:1`, | ||
| 170 | + cli.breakInfo, | ||
| 171 | + { filename: script, line: 1 }, | ||
| 172 | 172 | 'is back at the beginning'); | |
| 173 | 173 | }) | |
| 174 | 174 | .then(() => cli.quit()) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ test('Debugger agent direct access', (t) => { | |||
| 24 | 24 | .then(() => { | |
| 25 | 25 | t.match( | |
| 26 | 26 | cli.output, | |
| 27 | - /scriptSource: '\(function \(/); | ||
| 27 | + /scriptSource:[ \n]*'(?:\(function \(|let x = 1)/); | ||
| 28 | 28 | t.match( | |
| 29 | 29 | cli.output, | |
| 30 | 30 | /let x = 1;/); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,20 +30,20 @@ test('run after quit / restart', (t) => { | |||
| 30 | 30 | .then(() => cli.stepCommand('c')) // hit line 2 | |
| 31 | 31 | .then(() => cli.stepCommand('c')) // hit line 3 | |
| 32 | 32 | .then(() => { | |
| 33 | - t.match(cli.output, `break in ${script}:3`); | ||
| 33 | + t.match(cli.breakInfo, { filename: script, line: 3 }); | ||
| 34 | 34 | }) | |
| 35 | 35 | .then(() => cli.command('restart')) | |
| 36 | 36 | .then(() => cli.waitForInitialBreak()) | |
| 37 | 37 | .then(() => { | |
| 38 | - t.match(cli.output, `break in ${script}:1`); | ||
| 38 | + t.match(cli.breakInfo, { filename: script, line: 1 }); | ||
| 39 | 39 | }) | |
| 40 | 40 | .then(() => cli.stepCommand('c')) | |
| 41 | 41 | .then(() => { | |
| 42 | - t.match(cli.output, `break in ${script}:2`); | ||
| 42 | + t.match(cli.breakInfo, { filename: script, line: 2 }); | ||
| 43 | 43 | }) | |
| 44 | 44 | .then(() => cli.stepCommand('c')) | |
| 45 | 45 | .then(() => { | |
| 46 | - t.match(cli.output, `break in ${script}:3`); | ||
| 46 | + t.match(cli.breakInfo, { filename: script, line: 3 }); | ||
| 47 | 47 | }) | |
| 48 | 48 | .then(() => cli.command('breakpoints')) | |
| 49 | 49 | .then(() => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ test('list scripts', (t) => { | |||
| 24 | 24 | 'lists the user script'); | |
| 25 | 25 | t.notMatch( | |
| 26 | 26 | cli.output, | |
| 27 | - /\d+: module\.js <native>/, | ||
| 27 | + /\d+: buffer\.js <native>/, | ||
| 28 | 28 | 'omits node-internal scripts'); | |
| 29 | 29 | }) | |
| 30 | 30 | .then(() => cli.command('scripts(true)')) | |
@@ -35,7 +35,7 @@ test('list scripts', (t) => { | |||
| 35 | 35 | 'lists the user script'); | |
| 36 | 36 | t.match( | |
| 37 | 37 | cli.output, | |
| 38 | - /\d+: module\.js <native>/, | ||
| 38 | + /\d+: buffer\.js <native>/, | ||
| 39 | 39 | 'includes node-internal scripts'); | |
| 40 | 40 | }) | |
| 41 | 41 | .then(() => cli.quit()) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments