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 11// exec .scope 12{ 13 const cli = startCLI([fixtures.path('debugger/backtrace.js')]); 14 15 function onFatal(error) { 16 cli.quit(); 17 throw error; 18 } 19 20 cli.waitForInitialBreak() 21 .then(() => cli.waitForPrompt()) 22 .then(() => cli.stepCommand('c')) 23 .then(() => cli.command('exec .scope')) 24 .then(() => { 25 assert.match( 26 cli.output, 27 /'moduleScoped'/, 'displays closure from module body'); 28 assert.match(cli.output, /'a'/, 'displays local / function arg'); 29 assert.match(cli.output, /'l1'/, 'displays local scope'); 30 assert.doesNotMatch( 31 cli.output, 32 /'encodeURIComponent'/, 33 'omits global scope' 34 ); 35 }) 36 .then(() => cli.quit()) 37 .then(null, onFatal); 38} 39