1'use strict'; 2const common = require('../common'); 3 4common.skipIfInspectorDisabled(); 5 6const fixtures = require('../common/fixtures'); 7const startCLI = require('../common/debugger'); 8 9const assert = require('assert'); 10 11const cli = startCLI(['--port=0', fixtures.path('debugger/empty.js')]); 12 13(async () => { 14 await cli.waitForInitialBreak(); 15 await cli.waitForPrompt(); 16 await cli.command('exec new Date(0)'); 17 assert.match(cli.output, /1970-01-01T00:00:00\.000Z/); 18 await cli.command('exec null'); 19 assert.match(cli.output, /null/); 20 await cli.command('exec /regex/g'); 21 assert.match(cli.output, /\/regex\/g/); 22 await cli.command('exec new Map()'); 23 assert.match(cli.output, /Map\(0\) {}/); 24 await cli.command('exec new Map([["a",1],["b",2]])'); 25 assert.match(cli.output, /Map\(2\) { a => 1, b => 2 }/); 26 await cli.command('exec new Set()'); 27 assert.match(cli.output, /Set\(0\) {}/); 28 await cli.command('exec new Set([1,2])'); 29 assert.match(cli.output, /Set\(2\) { 1, 2 }/); 30 await cli.command('exec new Set([{a:1},new Set([1])])'); 31 assert.match(cli.output, /Set\(2\) { { a: 1 }, Set\(1\) { \.\.\. } }/); 32 await cli.command('exec a={}; a'); 33 assert.match(cli.output, /{}/); 34 await cli.command('exec a={a:1,b:{c:1}}; a'); 35 assert.match(cli.output, /{ a: 1, b: Object }/); 36 await cli.command('exec a=[]; a'); 37 assert.match(cli.output, /\[\]/); 38 await cli.command('exec a=[1,2]; a'); 39 assert.match(cli.output, /\[ 1, 2 \]/); 40})() 41.finally(() => cli.quit()) 42.then(common.mustCall()); 43