11cb0ef41Sopenharmony_ci// Flags: --no-warnings
21cb0ef41Sopenharmony_ci'use strict';
31cb0ef41Sopenharmony_cirequire('../../../common');
41cb0ef41Sopenharmony_ciconst assert = require('node:assert');
51cb0ef41Sopenharmony_ciconst test = require('node:test');
61cb0ef41Sopenharmony_ciconst util = require('util');
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_citest('sync pass todo', (t) => {
91cb0ef41Sopenharmony_ci  t.todo();
101cb0ef41Sopenharmony_ci});
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_citest('sync pass todo with message', (t) => {
131cb0ef41Sopenharmony_ci  t.todo('this is a passing todo');
141cb0ef41Sopenharmony_ci});
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_citest('sync fail todo', (t) => {
171cb0ef41Sopenharmony_ci  t.todo();
181cb0ef41Sopenharmony_ci  throw new Error('thrown from sync fail todo');
191cb0ef41Sopenharmony_ci});
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_citest('sync fail todo with message', (t) => {
221cb0ef41Sopenharmony_ci  t.todo('this is a failing todo');
231cb0ef41Sopenharmony_ci  throw new Error('thrown from sync fail todo with message');
241cb0ef41Sopenharmony_ci});
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_citest('sync skip pass', (t) => {
271cb0ef41Sopenharmony_ci  t.skip();
281cb0ef41Sopenharmony_ci});
291cb0ef41Sopenharmony_ci
301cb0ef41Sopenharmony_citest('sync skip pass with message', (t) => {
311cb0ef41Sopenharmony_ci  t.skip('this is skipped');
321cb0ef41Sopenharmony_ci});
331cb0ef41Sopenharmony_ci
341cb0ef41Sopenharmony_citest('sync pass', (t) => {
351cb0ef41Sopenharmony_ci  t.diagnostic('this test should pass');
361cb0ef41Sopenharmony_ci});
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_citest('sync throw fail', () => {
391cb0ef41Sopenharmony_ci  throw new Error('thrown from sync throw fail');
401cb0ef41Sopenharmony_ci});
411cb0ef41Sopenharmony_ci
421cb0ef41Sopenharmony_citest('async skip pass', async (t) => {
431cb0ef41Sopenharmony_ci  t.skip();
441cb0ef41Sopenharmony_ci});
451cb0ef41Sopenharmony_ci
461cb0ef41Sopenharmony_citest('async pass', async () => {
471cb0ef41Sopenharmony_ci
481cb0ef41Sopenharmony_ci});
491cb0ef41Sopenharmony_ci
501cb0ef41Sopenharmony_citest('async throw fail', async () => {
511cb0ef41Sopenharmony_ci  throw new Error('thrown from async throw fail');
521cb0ef41Sopenharmony_ci});
531cb0ef41Sopenharmony_ci
541cb0ef41Sopenharmony_citest('async skip fail', async (t) => {
551cb0ef41Sopenharmony_ci  t.skip();
561cb0ef41Sopenharmony_ci  throw new Error('thrown from async throw fail');
571cb0ef41Sopenharmony_ci});
581cb0ef41Sopenharmony_ci
591cb0ef41Sopenharmony_citest('async assertion fail', async () => {
601cb0ef41Sopenharmony_ci  // Make sure the assert module is handled.
611cb0ef41Sopenharmony_ci  assert.strictEqual(true, false);
621cb0ef41Sopenharmony_ci});
631cb0ef41Sopenharmony_ci
641cb0ef41Sopenharmony_citest('resolve pass', () => {
651cb0ef41Sopenharmony_ci  return Promise.resolve();
661cb0ef41Sopenharmony_ci});
671cb0ef41Sopenharmony_ci
681cb0ef41Sopenharmony_citest('reject fail', () => {
691cb0ef41Sopenharmony_ci  return Promise.reject(new Error('rejected from reject fail'));
701cb0ef41Sopenharmony_ci});
711cb0ef41Sopenharmony_ci
721cb0ef41Sopenharmony_citest('unhandled rejection - passes but warns', () => {
731cb0ef41Sopenharmony_ci  Promise.reject(new Error('rejected from unhandled rejection fail'));
741cb0ef41Sopenharmony_ci});
751cb0ef41Sopenharmony_ci
761cb0ef41Sopenharmony_citest('async unhandled rejection - passes but warns', async () => {
771cb0ef41Sopenharmony_ci  Promise.reject(new Error('rejected from async unhandled rejection fail'));
781cb0ef41Sopenharmony_ci});
791cb0ef41Sopenharmony_ci
801cb0ef41Sopenharmony_citest('immediate throw - passes but warns', () => {
811cb0ef41Sopenharmony_ci  setImmediate(() => {
821cb0ef41Sopenharmony_ci    throw new Error('thrown from immediate throw fail');
831cb0ef41Sopenharmony_ci  });
841cb0ef41Sopenharmony_ci});
851cb0ef41Sopenharmony_ci
861cb0ef41Sopenharmony_citest('immediate reject - passes but warns', () => {
871cb0ef41Sopenharmony_ci  setImmediate(() => {
881cb0ef41Sopenharmony_ci    Promise.reject(new Error('rejected from immediate reject fail'));
891cb0ef41Sopenharmony_ci  });
901cb0ef41Sopenharmony_ci});
911cb0ef41Sopenharmony_ci
921cb0ef41Sopenharmony_citest('immediate resolve pass', () => {
931cb0ef41Sopenharmony_ci  return new Promise((resolve) => {
941cb0ef41Sopenharmony_ci    setImmediate(() => {
951cb0ef41Sopenharmony_ci      resolve();
961cb0ef41Sopenharmony_ci    });
971cb0ef41Sopenharmony_ci  });
981cb0ef41Sopenharmony_ci});
991cb0ef41Sopenharmony_ci
1001cb0ef41Sopenharmony_citest('subtest sync throw fail', async (t) => {
1011cb0ef41Sopenharmony_ci  await t.test('+sync throw fail', (t) => {
1021cb0ef41Sopenharmony_ci    t.diagnostic('this subtest should make its parent test fail');
1031cb0ef41Sopenharmony_ci    throw new Error('thrown from subtest sync throw fail');
1041cb0ef41Sopenharmony_ci  });
1051cb0ef41Sopenharmony_ci});
1061cb0ef41Sopenharmony_ci
1071cb0ef41Sopenharmony_citest('sync throw non-error fail', async (t) => {
1081cb0ef41Sopenharmony_ci  throw Symbol('thrown symbol from sync throw non-error fail');
1091cb0ef41Sopenharmony_ci});
1101cb0ef41Sopenharmony_ci
1111cb0ef41Sopenharmony_citest('level 0a', { concurrency: 4 }, async (t) => {
1121cb0ef41Sopenharmony_ci  t.test('level 1a', async (t) => {
1131cb0ef41Sopenharmony_ci    const p1a = new Promise((resolve) => {
1141cb0ef41Sopenharmony_ci      setTimeout(() => {
1151cb0ef41Sopenharmony_ci        resolve();
1161cb0ef41Sopenharmony_ci      }, 100);
1171cb0ef41Sopenharmony_ci    });
1181cb0ef41Sopenharmony_ci
1191cb0ef41Sopenharmony_ci    return p1a;
1201cb0ef41Sopenharmony_ci  });
1211cb0ef41Sopenharmony_ci
1221cb0ef41Sopenharmony_ci  test('level 1b', async (t) => {
1231cb0ef41Sopenharmony_ci    const p1b = new Promise((resolve) => {
1241cb0ef41Sopenharmony_ci      resolve();
1251cb0ef41Sopenharmony_ci    });
1261cb0ef41Sopenharmony_ci
1271cb0ef41Sopenharmony_ci    return p1b;
1281cb0ef41Sopenharmony_ci  });
1291cb0ef41Sopenharmony_ci
1301cb0ef41Sopenharmony_ci  t.test('level 1c', async (t) => {
1311cb0ef41Sopenharmony_ci    const p1c = new Promise((resolve) => {
1321cb0ef41Sopenharmony_ci      setTimeout(() => {
1331cb0ef41Sopenharmony_ci        resolve();
1341cb0ef41Sopenharmony_ci      }, 200);
1351cb0ef41Sopenharmony_ci    });
1361cb0ef41Sopenharmony_ci
1371cb0ef41Sopenharmony_ci    return p1c;
1381cb0ef41Sopenharmony_ci  });
1391cb0ef41Sopenharmony_ci
1401cb0ef41Sopenharmony_ci  t.test('level 1d', async (t) => {
1411cb0ef41Sopenharmony_ci    const p1c = new Promise((resolve) => {
1421cb0ef41Sopenharmony_ci      setTimeout(() => {
1431cb0ef41Sopenharmony_ci        resolve();
1441cb0ef41Sopenharmony_ci      }, 150);
1451cb0ef41Sopenharmony_ci    });
1461cb0ef41Sopenharmony_ci
1471cb0ef41Sopenharmony_ci    return p1c;
1481cb0ef41Sopenharmony_ci  });
1491cb0ef41Sopenharmony_ci
1501cb0ef41Sopenharmony_ci  const p0a = new Promise((resolve) => {
1511cb0ef41Sopenharmony_ci    setTimeout(() => {
1521cb0ef41Sopenharmony_ci      resolve();
1531cb0ef41Sopenharmony_ci    }, 300);
1541cb0ef41Sopenharmony_ci  });
1551cb0ef41Sopenharmony_ci
1561cb0ef41Sopenharmony_ci  return p0a;
1571cb0ef41Sopenharmony_ci});
1581cb0ef41Sopenharmony_ci
1591cb0ef41Sopenharmony_citest('top level', { concurrency: 2 }, async (t) => {
1601cb0ef41Sopenharmony_ci  t.test('+long running', async (t) => {
1611cb0ef41Sopenharmony_ci    return new Promise((resolve, reject) => {
1621cb0ef41Sopenharmony_ci      setTimeout(resolve, 300).unref();
1631cb0ef41Sopenharmony_ci    });
1641cb0ef41Sopenharmony_ci  });
1651cb0ef41Sopenharmony_ci
1661cb0ef41Sopenharmony_ci  t.test('+short running', async (t) => {
1671cb0ef41Sopenharmony_ci    t.test('++short running', async (t) => {});
1681cb0ef41Sopenharmony_ci  });
1691cb0ef41Sopenharmony_ci});
1701cb0ef41Sopenharmony_ci
1711cb0ef41Sopenharmony_citest('invalid subtest - pass but subtest fails', (t) => {
1721cb0ef41Sopenharmony_ci  setImmediate(() => {
1731cb0ef41Sopenharmony_ci    t.test('invalid subtest fail', () => {
1741cb0ef41Sopenharmony_ci      throw new Error('this should not be thrown');
1751cb0ef41Sopenharmony_ci    });
1761cb0ef41Sopenharmony_ci  });
1771cb0ef41Sopenharmony_ci});
1781cb0ef41Sopenharmony_ci
1791cb0ef41Sopenharmony_citest('sync skip option', { skip: true }, (t) => {
1801cb0ef41Sopenharmony_ci  throw new Error('this should not be executed');
1811cb0ef41Sopenharmony_ci});
1821cb0ef41Sopenharmony_ci
1831cb0ef41Sopenharmony_citest('sync skip option with message', { skip: 'this is skipped' }, (t) => {
1841cb0ef41Sopenharmony_ci  throw new Error('this should not be executed');
1851cb0ef41Sopenharmony_ci});
1861cb0ef41Sopenharmony_ci
1871cb0ef41Sopenharmony_citest('sync skip option is false fail', { skip: false }, (t) => {
1881cb0ef41Sopenharmony_ci  throw new Error('this should be executed');
1891cb0ef41Sopenharmony_ci});
1901cb0ef41Sopenharmony_ci
1911cb0ef41Sopenharmony_ci// A test with no arguments provided.
1921cb0ef41Sopenharmony_citest();
1931cb0ef41Sopenharmony_ci
1941cb0ef41Sopenharmony_ci// A test with only a named function provided.
1951cb0ef41Sopenharmony_citest(function functionOnly() {});
1961cb0ef41Sopenharmony_ci
1971cb0ef41Sopenharmony_ci// A test with only an anonymous function provided.
1981cb0ef41Sopenharmony_citest(() => {});
1991cb0ef41Sopenharmony_ci
2001cb0ef41Sopenharmony_ci// A test with only a name provided.
2011cb0ef41Sopenharmony_citest('test with only a name provided');
2021cb0ef41Sopenharmony_ci
2031cb0ef41Sopenharmony_ci// A test with an empty string name.
2041cb0ef41Sopenharmony_citest('');
2051cb0ef41Sopenharmony_ci
2061cb0ef41Sopenharmony_ci// A test with only options provided.
2071cb0ef41Sopenharmony_citest({ skip: true });
2081cb0ef41Sopenharmony_ci
2091cb0ef41Sopenharmony_ci// A test with only a name and options provided.
2101cb0ef41Sopenharmony_citest('test with a name and options provided', { skip: true });
2111cb0ef41Sopenharmony_ci
2121cb0ef41Sopenharmony_ci// A test with only options and a function provided.
2131cb0ef41Sopenharmony_citest({ skip: true }, function functionAndOptions() {});
2141cb0ef41Sopenharmony_ci
2151cb0ef41Sopenharmony_citest('callback pass', (t, done) => {
2161cb0ef41Sopenharmony_ci  setImmediate(done);
2171cb0ef41Sopenharmony_ci});
2181cb0ef41Sopenharmony_ci
2191cb0ef41Sopenharmony_citest('callback fail', (t, done) => {
2201cb0ef41Sopenharmony_ci  setImmediate(() => {
2211cb0ef41Sopenharmony_ci    done(new Error('callback failure'));
2221cb0ef41Sopenharmony_ci  });
2231cb0ef41Sopenharmony_ci});
2241cb0ef41Sopenharmony_ci
2251cb0ef41Sopenharmony_citest('sync t is this in test', function(t) {
2261cb0ef41Sopenharmony_ci  assert.strictEqual(this, t);
2271cb0ef41Sopenharmony_ci});
2281cb0ef41Sopenharmony_ci
2291cb0ef41Sopenharmony_citest('async t is this in test', async function(t) {
2301cb0ef41Sopenharmony_ci  assert.strictEqual(this, t);
2311cb0ef41Sopenharmony_ci});
2321cb0ef41Sopenharmony_ci
2331cb0ef41Sopenharmony_citest('callback t is this in test', function(t, done) {
2341cb0ef41Sopenharmony_ci  assert.strictEqual(this, t);
2351cb0ef41Sopenharmony_ci  done();
2361cb0ef41Sopenharmony_ci});
2371cb0ef41Sopenharmony_ci
2381cb0ef41Sopenharmony_citest('callback also returns a Promise', async (t, done) => {
2391cb0ef41Sopenharmony_ci  throw new Error('thrown from callback also returns a Promise');
2401cb0ef41Sopenharmony_ci});
2411cb0ef41Sopenharmony_ci
2421cb0ef41Sopenharmony_citest('callback throw', (t, done) => {
2431cb0ef41Sopenharmony_ci  throw new Error('thrown from callback throw');
2441cb0ef41Sopenharmony_ci});
2451cb0ef41Sopenharmony_ci
2461cb0ef41Sopenharmony_citest('callback called twice', (t, done) => {
2471cb0ef41Sopenharmony_ci  done();
2481cb0ef41Sopenharmony_ci  done();
2491cb0ef41Sopenharmony_ci});
2501cb0ef41Sopenharmony_ci
2511cb0ef41Sopenharmony_citest('callback called twice in different ticks', (t, done) => {
2521cb0ef41Sopenharmony_ci  setImmediate(done);
2531cb0ef41Sopenharmony_ci  done();
2541cb0ef41Sopenharmony_ci});
2551cb0ef41Sopenharmony_ci
2561cb0ef41Sopenharmony_citest('callback called twice in future tick', (t, done) => {
2571cb0ef41Sopenharmony_ci  setImmediate(() => {
2581cb0ef41Sopenharmony_ci    done();
2591cb0ef41Sopenharmony_ci    done();
2601cb0ef41Sopenharmony_ci  });
2611cb0ef41Sopenharmony_ci});
2621cb0ef41Sopenharmony_ci
2631cb0ef41Sopenharmony_citest('callback async throw', (t, done) => {
2641cb0ef41Sopenharmony_ci  setImmediate(() => {
2651cb0ef41Sopenharmony_ci    throw new Error('thrown from callback async throw');
2661cb0ef41Sopenharmony_ci  });
2671cb0ef41Sopenharmony_ci});
2681cb0ef41Sopenharmony_ci
2691cb0ef41Sopenharmony_citest('callback async throw after done', (t, done) => {
2701cb0ef41Sopenharmony_ci  setImmediate(() => {
2711cb0ef41Sopenharmony_ci    throw new Error('thrown from callback async throw after done');
2721cb0ef41Sopenharmony_ci  });
2731cb0ef41Sopenharmony_ci
2741cb0ef41Sopenharmony_ci  done();
2751cb0ef41Sopenharmony_ci});
2761cb0ef41Sopenharmony_ci
2771cb0ef41Sopenharmony_citest('only is set but not in only mode', { only: true }, async (t) => {
2781cb0ef41Sopenharmony_ci  // All of these subtests should run.
2791cb0ef41Sopenharmony_ci  await t.test('running subtest 1');
2801cb0ef41Sopenharmony_ci  t.runOnly(true);
2811cb0ef41Sopenharmony_ci  await t.test('running subtest 2');
2821cb0ef41Sopenharmony_ci  await t.test('running subtest 3', { only: true });
2831cb0ef41Sopenharmony_ci  t.runOnly(false);
2841cb0ef41Sopenharmony_ci  await t.test('running subtest 4');
2851cb0ef41Sopenharmony_ci});
2861cb0ef41Sopenharmony_ci
2871cb0ef41Sopenharmony_citest('custom inspect symbol fail', () => {
2881cb0ef41Sopenharmony_ci  const obj = {
2891cb0ef41Sopenharmony_ci    [util.inspect.custom]() {
2901cb0ef41Sopenharmony_ci      return 'customized';
2911cb0ef41Sopenharmony_ci    },
2921cb0ef41Sopenharmony_ci    foo: 1,
2931cb0ef41Sopenharmony_ci  };
2941cb0ef41Sopenharmony_ci
2951cb0ef41Sopenharmony_ci  throw obj;
2961cb0ef41Sopenharmony_ci});
2971cb0ef41Sopenharmony_ci
2981cb0ef41Sopenharmony_citest('custom inspect symbol that throws fail', () => {
2991cb0ef41Sopenharmony_ci  const obj = {
3001cb0ef41Sopenharmony_ci    [util.inspect.custom]() {
3011cb0ef41Sopenharmony_ci      throw new Error('bad-inspect');
3021cb0ef41Sopenharmony_ci    },
3031cb0ef41Sopenharmony_ci    foo: 1,
3041cb0ef41Sopenharmony_ci  };
3051cb0ef41Sopenharmony_ci
3061cb0ef41Sopenharmony_ci  throw obj;
3071cb0ef41Sopenharmony_ci});
3081cb0ef41Sopenharmony_ci
3091cb0ef41Sopenharmony_citest('subtest sync throw fails', async (t) => {
3101cb0ef41Sopenharmony_ci  await t.test('sync throw fails at first', (t) => {
3111cb0ef41Sopenharmony_ci    throw new Error('thrown from subtest sync throw fails at first');
3121cb0ef41Sopenharmony_ci  });
3131cb0ef41Sopenharmony_ci  await t.test('sync throw fails at second', (t) => {
3141cb0ef41Sopenharmony_ci    throw new Error('thrown from subtest sync throw fails at second');
3151cb0ef41Sopenharmony_ci  });
3161cb0ef41Sopenharmony_ci});
3171cb0ef41Sopenharmony_ci
3181cb0ef41Sopenharmony_citest('timed out async test', { timeout: 5 }, async (t) => {
3191cb0ef41Sopenharmony_ci  return new Promise((resolve) => {
3201cb0ef41Sopenharmony_ci    setTimeout(resolve, 100);
3211cb0ef41Sopenharmony_ci  });
3221cb0ef41Sopenharmony_ci});
3231cb0ef41Sopenharmony_ci
3241cb0ef41Sopenharmony_citest('timed out callback test', { timeout: 5 }, (t, done) => {
3251cb0ef41Sopenharmony_ci  setTimeout(done, 100);
3261cb0ef41Sopenharmony_ci});
3271cb0ef41Sopenharmony_ci
3281cb0ef41Sopenharmony_ci
3291cb0ef41Sopenharmony_citest('large timeout async test is ok', { timeout: 30_000_000 }, async (t) => {
3301cb0ef41Sopenharmony_ci  return new Promise((resolve) => {
3311cb0ef41Sopenharmony_ci    setTimeout(resolve, 10);
3321cb0ef41Sopenharmony_ci  });
3331cb0ef41Sopenharmony_ci});
3341cb0ef41Sopenharmony_ci
3351cb0ef41Sopenharmony_citest('large timeout callback test is ok', { timeout: 30_000_000 }, (t, done) => {
3361cb0ef41Sopenharmony_ci  setTimeout(done, 10);
3371cb0ef41Sopenharmony_ci});
3381cb0ef41Sopenharmony_ci
3391cb0ef41Sopenharmony_citest('successful thenable', () => {
3401cb0ef41Sopenharmony_ci  let thenCalled = false;
3411cb0ef41Sopenharmony_ci  return {
3421cb0ef41Sopenharmony_ci    get then() {
3431cb0ef41Sopenharmony_ci      if (thenCalled) throw new Error();
3441cb0ef41Sopenharmony_ci      thenCalled = true;
3451cb0ef41Sopenharmony_ci      return (successHandler) => successHandler();
3461cb0ef41Sopenharmony_ci    },
3471cb0ef41Sopenharmony_ci  };
3481cb0ef41Sopenharmony_ci});
3491cb0ef41Sopenharmony_ci
3501cb0ef41Sopenharmony_citest('rejected thenable', () => {
3511cb0ef41Sopenharmony_ci  let thenCalled = false;
3521cb0ef41Sopenharmony_ci  return {
3531cb0ef41Sopenharmony_ci    get then() {
3541cb0ef41Sopenharmony_ci      if (thenCalled) throw new Error();
3551cb0ef41Sopenharmony_ci      thenCalled = true;
3561cb0ef41Sopenharmony_ci      return (_, errorHandler) => errorHandler('custom error');
3571cb0ef41Sopenharmony_ci    },
3581cb0ef41Sopenharmony_ci  };
3591cb0ef41Sopenharmony_ci});
3601cb0ef41Sopenharmony_ci
3611cb0ef41Sopenharmony_citest('unfinished test with uncaughtException', async () => {
3621cb0ef41Sopenharmony_ci  await new Promise(() => {
3631cb0ef41Sopenharmony_ci    setTimeout(() => { throw new Error('foo'); });
3641cb0ef41Sopenharmony_ci  });
3651cb0ef41Sopenharmony_ci});
3661cb0ef41Sopenharmony_ci
3671cb0ef41Sopenharmony_citest('unfinished test with unhandledRejection', async () => {
3681cb0ef41Sopenharmony_ci  await new Promise(() => {
3691cb0ef41Sopenharmony_ci    setTimeout(() => Promise.reject(new Error('bar')));
3701cb0ef41Sopenharmony_ci  });
3711cb0ef41Sopenharmony_ci});
3721cb0ef41Sopenharmony_ci
3731cb0ef41Sopenharmony_ci// Verify that uncaught exceptions outside of any tests are handled after the
3741cb0ef41Sopenharmony_ci// test harness has finished bootstrapping itself.
3751cb0ef41Sopenharmony_cisetImmediate(() => {
3761cb0ef41Sopenharmony_ci  throw new Error('uncaught from outside of a test');
3771cb0ef41Sopenharmony_ci});
3781cb0ef41Sopenharmony_ci
3791cb0ef41Sopenharmony_citest('assertion errors display actual and expected properly', async () => {
3801cb0ef41Sopenharmony_ci  // Make sure the assert module is handled.
3811cb0ef41Sopenharmony_ci  const circular = { bar: 2 };
3821cb0ef41Sopenharmony_ci  circular.c = circular;
3831cb0ef41Sopenharmony_ci  const tmpLimit = Error.stackTraceLimit;
3841cb0ef41Sopenharmony_ci  Error.stackTraceLimit = 1;
3851cb0ef41Sopenharmony_ci  try {
3861cb0ef41Sopenharmony_ci    assert.deepEqual({ foo: 1, bar: 1 }, circular); // eslint-disable-line no-restricted-properties
3871cb0ef41Sopenharmony_ci  } catch (err) {
3881cb0ef41Sopenharmony_ci    Error.stackTraceLimit = tmpLimit;
3891cb0ef41Sopenharmony_ci    throw err;
3901cb0ef41Sopenharmony_ci  }
3911cb0ef41Sopenharmony_ci});
392