2022-09-27 01:26:58 -05:00
|
|
|
import { skipIfInspectorDisabled } from '../common/index.mjs';
|
|
|
|
|
|
|
|
skipIfInspectorDisabled();
|
|
|
|
|
|
|
|
import { path } from '../common/fixtures.mjs';
|
|
|
|
import startCLI from '../common/debugger.js';
|
|
|
|
|
|
|
|
import assert from 'assert';
|
|
|
|
|
2023-03-28 00:03:40 +02:00
|
|
|
const cli = startCLI(['--port=0', path('debugger/backtrace.js')]);
|
2022-09-27 01:26:58 -05:00
|
|
|
|
|
|
|
try {
|
|
|
|
await cli.waitForInitialBreak();
|
|
|
|
await cli.waitForPrompt();
|
|
|
|
await cli.stepCommand('c');
|
|
|
|
await cli.command('exec .scope');
|
|
|
|
assert.match(cli.output, /'moduleScoped'/, 'displays closure from module body');
|
|
|
|
assert.match(cli.output, /'a'/, 'displays local / function arg');
|
|
|
|
assert.match(cli.output, /'l1'/, 'displays local scope');
|
|
|
|
assert.doesNotMatch(cli.output, /'encodeURIComponent'/, 'omits global scope');
|
|
|
|
} finally {
|
|
|
|
await cli.quit();
|
|
|
|
}
|