11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled();
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
71cb0ef41Sopenharmony_ciconst startCLI = require('../common/debugger');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst assert = require('assert');
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci// Test for files that start with strict directive.
121cb0ef41Sopenharmony_ci{
131cb0ef41Sopenharmony_ci  const script = fixtures.path('debugger', 'use-strict.js');
141cb0ef41Sopenharmony_ci  const cli = startCLI(['--port=0', script]);
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_ci  function onFatal(error) {
171cb0ef41Sopenharmony_ci    cli.quit();
181cb0ef41Sopenharmony_ci    throw error;
191cb0ef41Sopenharmony_ci  }
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci  return cli.waitForInitialBreak()
221cb0ef41Sopenharmony_ci    .then(() => cli.waitForPrompt())
231cb0ef41Sopenharmony_ci    .then(() => {
241cb0ef41Sopenharmony_ci      const brk = cli.breakInfo;
251cb0ef41Sopenharmony_ci      assert.match(
261cb0ef41Sopenharmony_ci        `${brk.line}`,
271cb0ef41Sopenharmony_ci        /^(1|2)$/,
281cb0ef41Sopenharmony_ci        'pauses either on strict directive or first "real" line');
291cb0ef41Sopenharmony_ci    })
301cb0ef41Sopenharmony_ci    .then(() => cli.quit())
311cb0ef41Sopenharmony_ci    .then(null, onFatal);
321cb0ef41Sopenharmony_ci}
33