11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_cirequire('../common');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciconst assert = require('assert');
61cb0ef41Sopenharmony_ciconst { compileFunction } = require('node:vm');
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciconst min = -2147483648;
91cb0ef41Sopenharmony_ciconst max = 2147483647;
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_cicompileFunction('', [], { lineOffset: min, columnOffset: min });
121cb0ef41Sopenharmony_cicompileFunction('', [], { lineOffset: max, columnOffset: max });
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ciassert.throws(
151cb0ef41Sopenharmony_ci  () => {
161cb0ef41Sopenharmony_ci    compileFunction('', [], { lineOffset: min - 1, columnOffset: max });
171cb0ef41Sopenharmony_ci  },
181cb0ef41Sopenharmony_ci  {
191cb0ef41Sopenharmony_ci    code: 'ERR_OUT_OF_RANGE',
201cb0ef41Sopenharmony_ci    name: 'RangeError',
211cb0ef41Sopenharmony_ci    message: /The value of "options\.lineOffset" is out of range/,
221cb0ef41Sopenharmony_ci  }
231cb0ef41Sopenharmony_ci);
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ciassert.throws(
261cb0ef41Sopenharmony_ci  () => {
271cb0ef41Sopenharmony_ci    compileFunction('', [], { lineOffset: min, columnOffset: min - 1 });
281cb0ef41Sopenharmony_ci  },
291cb0ef41Sopenharmony_ci  {
301cb0ef41Sopenharmony_ci    code: 'ERR_OUT_OF_RANGE',
311cb0ef41Sopenharmony_ci    name: 'RangeError',
321cb0ef41Sopenharmony_ci    message: /The value of "options\.columnOffset" is out of range/,
331cb0ef41Sopenharmony_ci  }
341cb0ef41Sopenharmony_ci);
35