1import { skipIfInspectorDisabled } from '../common/index.mjs';
2
3skipIfInspectorDisabled();
4
5import { path } from '../common/fixtures.mjs';
6import startCLI from '../common/debugger.js';
7
8import assert from 'assert';
9
10const cli = startCLI([path('debugger', 'three-lines.js')]);
11
12try {
13  await cli.waitForInitialBreak();
14  await cli.waitForPrompt();
15  await cli.command('exec a = function func() {}; a;');
16  assert.match(cli.output, /\[Function: func\]/);
17  await cli.command('exec a = function func () {}; a;');
18  assert.match(cli.output, /\[Function\]/);
19  await cli.command('exec a = function() {}; a;');
20  assert.match(cli.output, /\[Function: function\]/);
21  await cli.command('exec a = () => {}; a;');
22  assert.match(cli.output, /\[Function\]/);
23  await cli.command('exec a = function* func() {}; a;');
24  assert.match(cli.output, /\[GeneratorFunction: func\]/);
25  await cli.command('exec a = function *func() {}; a;');
26  assert.match(cli.output, /\[GeneratorFunction: \*func\]/);
27  await cli.command('exec a = function*func() {}; a;');
28  assert.match(cli.output, /\[GeneratorFunction: function\*func\]/);
29  await cli.command('exec a = function * func() {}; a;');
30  assert.match(cli.output, /\[GeneratorFunction\]/);
31} finally {
32  cli.quit();
33}
34