11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ci// Regression test for an integer overflow in inspector.open() when the port 41cb0ef41Sopenharmony_ci// exceeds the range of an unsigned 16-bit integer. 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ciconst common = require('../common'); 71cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled(); 81cb0ef41Sopenharmony_cicommon.skipIfWorker(); 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciconst assert = require('assert'); 111cb0ef41Sopenharmony_ciconst inspector = require('inspector'); 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_ciassert.throws(() => inspector.open(99999), { 141cb0ef41Sopenharmony_ci name: 'RangeError', 151cb0ef41Sopenharmony_ci code: 'ERR_OUT_OF_RANGE', 161cb0ef41Sopenharmony_ci message: 'The value of "port" is out of range. It must be >= 0 && <= 65535. Received 99999' 171cb0ef41Sopenharmony_ci}); 18