@@ -10,28 +10,25 @@ const assert = require('assert'); |
10 | 10 |
|
11 | 11 | const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]); |
12 | 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); |
| 13 | +(async () => { |
| 14 | + await cli.waitForInitialBreak(); |
| 15 | + await cli.waitForPrompt(); |
| 16 | + await cli.command('exec a = function func() {}; a;'); |
| 17 | + assert.match(cli.output, /\[Function: func\]/); |
| 18 | + await cli.command('exec a = function func () {}; a;'); |
| 19 | + assert.match(cli.output, /\[Function\]/); |
| 20 | + await cli.command('exec a = function() {}; a;'); |
| 21 | + assert.match(cli.output, /\[Function: function\]/); |
| 22 | + await cli.command('exec a = () => {}; a;'); |
| 23 | + assert.match(cli.output, /\[Function\]/); |
| 24 | + await cli.command('exec a = function* func() {}; a;'); |
| 25 | + assert.match(cli.output, /\[GeneratorFunction: func\]/); |
| 26 | + await cli.command('exec a = function *func() {}; a;'); |
| 27 | + assert.match(cli.output, /\[GeneratorFunction: \*func\]/); |
| 28 | + await cli.command('exec a = function*func() {}; a;'); |
| 29 | + assert.match(cli.output, /\[GeneratorFunction: function\*func\]/); |
| 30 | + await cli.command('exec a = function * func() {}; a;'); |
| 31 | + assert.match(cli.output, /\[GeneratorFunction\]/); |
| 32 | +})() |
| 33 | +.finally(() => cli.quit()) |
| 34 | +.then(common.mustCall()); |