forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest-debugger-exec-scope.js
More file actions
38 lines (32 loc) · 954 Bytes
/
test-debugger-exec-scope.js
File metadata and controls
38 lines (32 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');
const assert = require('assert');
// exec .scope
{
const cli = startCLI([fixtures.path('debugger/backtrace.js')]);
function onFatal(error) {
cli.quit();
throw error;
}
cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => cli.stepCommand('c'))
.then(() => cli.command('exec .scope'))
.then(() => {
assert.match(
cli.output,
/'moduleScoped'/, 'displays closure from module body');
assert.match(cli.output, /'a'/, 'displays local / function arg');
assert.match(cli.output, /'l1'/, 'displays local scope');
assert.doesNotMatch(
cli.output,
/'encodeURIComponent'/,
'omits global scope'
);
})
.then(() => cli.quit())
.then(null, onFatal);
}