11cb0ef41Sopenharmony_ciimport { skipIfInspectorDisabled } from '../common/index.mjs';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciskipIfInspectorDisabled();
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciimport { path } from '../common/fixtures.mjs';
61cb0ef41Sopenharmony_ciimport startCLI from '../common/debugger.js';
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciimport assert from 'assert';
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst cli = startCLI([path('debugger', 'three-lines.js')]);
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_citry {
131cb0ef41Sopenharmony_ci  await cli.waitForInitialBreak();
141cb0ef41Sopenharmony_ci  await cli.waitForPrompt();
151cb0ef41Sopenharmony_ci  await cli.command('exec a = function func() {}; a;');
161cb0ef41Sopenharmony_ci  assert.match(cli.output, /\[Function: func\]/);
171cb0ef41Sopenharmony_ci  await cli.command('exec a = function func () {}; a;');
181cb0ef41Sopenharmony_ci  assert.match(cli.output, /\[Function\]/);
191cb0ef41Sopenharmony_ci  await cli.command('exec a = function() {}; a;');
201cb0ef41Sopenharmony_ci  assert.match(cli.output, /\[Function: function\]/);
211cb0ef41Sopenharmony_ci  await cli.command('exec a = () => {}; a;');
221cb0ef41Sopenharmony_ci  assert.match(cli.output, /\[Function\]/);
231cb0ef41Sopenharmony_ci  await cli.command('exec a = function* func() {}; a;');
241cb0ef41Sopenharmony_ci  assert.match(cli.output, /\[GeneratorFunction: func\]/);
251cb0ef41Sopenharmony_ci  await cli.command('exec a = function *func() {}; a;');
261cb0ef41Sopenharmony_ci  assert.match(cli.output, /\[GeneratorFunction: \*func\]/);
271cb0ef41Sopenharmony_ci  await cli.command('exec a = function*func() {}; a;');
281cb0ef41Sopenharmony_ci  assert.match(cli.output, /\[GeneratorFunction: function\*func\]/);
291cb0ef41Sopenharmony_ci  await cli.command('exec a = function * func() {}; a;');
301cb0ef41Sopenharmony_ci  assert.match(cli.output, /\[GeneratorFunction\]/);
311cb0ef41Sopenharmony_ci} finally {
321cb0ef41Sopenharmony_ci  cli.quit();
331cb0ef41Sopenharmony_ci}
34