mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
cca897ef5d
Report the actual source code when running with `--eval` and `--inspect-brk`, by telling the vm module to break on the first line of the script being executed rather than wrapping the source code in a function. PR-URL: https://github.com/nodejs/node/pull/25832 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
23 lines
694 B
JavaScript
23 lines
694 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const assert = require('assert');
|
|
const { NodeInstance } = require('../common/inspector-helper.js');
|
|
|
|
async function runTests() {
|
|
const instance = new NodeInstance(undefined, 'console.log(10)');
|
|
const session = await instance.connectInspectorSession();
|
|
await session.send([
|
|
{ 'method': 'Runtime.enable' },
|
|
{ 'method': 'Debugger.enable' },
|
|
{ 'method': 'Runtime.runIfWaitingForDebugger' }
|
|
]);
|
|
await session.waitForBreakOnLine(0, '[eval]');
|
|
await session.runToCompletion();
|
|
assert.strictEqual((await instance.expectShutdown()).exitCode, 0);
|
|
}
|
|
|
|
runTests();
|