• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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// Test for files that start with strict directive.
12{
13  const script = fixtures.path('debugger', 'use-strict.js');
14  const cli = startCLI([script]);
15
16  function onFatal(error) {
17    cli.quit();
18    throw error;
19  }
20
21  return cli.waitForInitialBreak()
22    .then(() => cli.waitForPrompt())
23    .then(() => {
24      const brk = cli.breakInfo;
25      assert.match(
26        `${brk.line}`,
27        /^(1|2)$/,
28        'pauses either on strict directive or first "real" line');
29    })
30    .then(() => cli.quit())
31    .then(null, onFatal);
32}
33