|
| 1 | +'use strict'; |
| 2 | +const common = require('../common'); |
| 3 | + |
| 4 | +common.skipIfInspectorDisabled(); |
| 5 | + |
| 6 | +const fixtures = require('../common/fixtures'); |
| 7 | +const startCLI = require('../common/debugger'); |
| 8 | + |
| 9 | +const assert = require('assert'); |
| 10 | + |
| 11 | +const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]); |
| 12 | + |
| 13 | +function onFatal(error) { |
| 14 | + cli.quit(); |
| 15 | + throw error; |
| 16 | +} |
| 17 | + |
| 18 | +cli.waitForInitialBreak() |
| 19 | + .then(() => cli.waitForPrompt()) |
| 20 | + .then(() => cli.command('exec a = function func() {}; a;')) |
| 21 | + .then(() => assert.match(cli.output, /\[Function: func\]/)) |
| 22 | + .then(() => cli.command('exec a = function func () {}; a;')) |
| 23 | + .then(() => assert.match(cli.output, /\[Function\]/)) |
| 24 | + .then(() => cli.command('exec a = function() {}; a;')) |
| 25 | + .then(() => assert.match(cli.output, /\[Function: function\]/)) |
| 26 | + .then(() => cli.command('exec a = () => {}; a;')) |
| 27 | + .then(() => assert.match(cli.output, /\[Function\]/)) |
| 28 | + .then(() => cli.command('exec a = function* func() {}; a;')) |
| 29 | + .then(() => assert.match(cli.output, /\[GeneratorFunction: func\]/)) |
| 30 | + .then(() => cli.command('exec a = function *func() {}; a;')) |
| 31 | + .then(() => assert.match(cli.output, /\[GeneratorFunction: \*func\]/)) |
| 32 | + .then(() => cli.command('exec a = function*func() {}; a;')) |
| 33 | + .then(() => assert.match(cli.output, /\[GeneratorFunction: function\*func\]/)) |
| 34 | + .then(() => cli.command('exec a = function * func() {}; a;')) |
| 35 | + .then(() => assert.match(cli.output, /\[GeneratorFunction\]/)) |
| 36 | + .then(() => cli.quit()) |
| 37 | + .then(null, onFatal); |
0 commit comments