diff options
author | Gus Caplan <me@gus.host> | 2018-02-23 00:19:50 -0600 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2018-03-01 09:18:30 -0600 |
commit | abd0d79304c97911a343f945dde35113012ed291 (patch) | |
tree | d6709e3bf143c2389a98d6a97bc2b9a7978b533b /test | |
parent | 3828fc6289783a632b00270d6b72b5c5bdd6437d (diff) | |
download | android-node-v8-abd0d79304c97911a343f945dde35113012ed291.tar.gz android-node-v8-abd0d79304c97911a343f945dde35113012ed291.tar.bz2 android-node-v8-abd0d79304c97911a343f945dde35113012ed291.zip |
loader: fix --inspect-brk
PR-URL: https://github.com/nodejs/node/pull/18949
Fixes: https://github.com/nodejs/node/issues/18948
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/es-modules/loop.mjs | 4 | ||||
-rw-r--r-- | test/fixtures/es-modules/message.mjs | 1 | ||||
-rw-r--r-- | test/parallel/test-inspector-esm.js | 10 |
3 files changed, 10 insertions, 5 deletions
diff --git a/test/fixtures/es-modules/loop.mjs b/test/fixtures/es-modules/loop.mjs index edd111abb9..1b5cab10ed 100644 --- a/test/fixtures/es-modules/loop.mjs +++ b/test/fixtures/es-modules/loop.mjs @@ -1,6 +1,8 @@ +import { message } from './message'; + var t = 1; var k = 1; -console.log('A message', 5); +console.log(message, 5); while (t > 0) { if (t++ === 1000) { t = 0; diff --git a/test/fixtures/es-modules/message.mjs b/test/fixtures/es-modules/message.mjs new file mode 100644 index 0000000000..d50f57b7b6 --- /dev/null +++ b/test/fixtures/es-modules/message.mjs @@ -0,0 +1 @@ +export const message = 'A message'; diff --git a/test/parallel/test-inspector-esm.js b/test/parallel/test-inspector-esm.js index 696f2af9a7..3171da58cf 100644 --- a/test/parallel/test-inspector-esm.js +++ b/test/parallel/test-inspector-esm.js @@ -5,6 +5,7 @@ const common = require('../common'); common.skipIfInspectorDisabled(); const assert = require('assert'); +const { resolve: UrlResolve } = require('url'); const fixtures = require('../common/fixtures'); const { NodeInstance } = require('../common/inspector-helper.js'); @@ -43,14 +44,15 @@ async function testBreakpointOnStart(session) { ]; await session.send(commands); - await session.waitForBreakOnLine(0, session.scriptURL()); + await session.waitForBreakOnLine( + 0, UrlResolve(session.scriptURL().toString(), 'message.mjs')); } async function testBreakpoint(session) { console.log('[test]', 'Setting a breakpoint and verifying it is hit'); const commands = [ { 'method': 'Debugger.setBreakpointByUrl', - 'params': { 'lineNumber': 5, + 'params': { 'lineNumber': 7, 'url': session.scriptURL(), 'columnNumber': 0, 'condition': '' @@ -66,7 +68,7 @@ async function testBreakpoint(session) { `Script source is wrong: ${scriptSource}`); await session.waitForConsoleOutput('log', ['A message', 5]); - const paused = await session.waitForBreakOnLine(5, session.scriptURL()); + const paused = await session.waitForBreakOnLine(7, session.scriptURL()); const scopeId = paused.params.callFrames[0].scopeChain[0].object.objectId; console.log('[test]', 'Verify we can read current application state'); @@ -79,7 +81,7 @@ async function testBreakpoint(session) { 'generatePreview': true } }); - assertScopeValues(response, { t: 1001, k: 1 }); + assertScopeValues(response, { t: 1001, k: 1, message: 'A message' }); let { result } = await session.send({ 'method': 'Debugger.evaluateOnCallFrame', 'params': { |