jssm 5.162.26 → 5.162.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24454,7 +24454,7 @@ function fslSemanticSpans(text) {
24454
24454
  * Useful for runtime diagnostics and for embedding in serialized machine
24455
24455
  * snapshots so that deserializers can detect version-skew.
24456
24456
  */
24457
- const version = "5.162.26";
24457
+ const version = "5.162.27";
24458
24458
 
24459
24459
  /**
24460
24460
  * The FSL Markdown fence convention parser — pure, host-agnostic logic that
@@ -24994,7 +24994,23 @@ const STOCHASTIC_DEFAULT_MAX_STEPS = 1000;
24994
24994
  * @internal
24995
24995
  */
24996
24996
  const DEFAULT_TIME_SOURCE = () => Date.now();
24997
- const DEFAULT_TIMEOUT_SOURCE = (f, a) => setTimeout(f, a);
24997
+ const DEFAULT_TIMEOUT_SOURCE = (f, a) => {
24998
+ const handle = setTimeout(f, a);
24999
+ // In Node, setTimeout returns a Timeout with .unref(), so a pending `after`
25000
+ // timer does NOT by itself keep the process alive -- an abandoned machine can
25001
+ // be collected and the process can exit instead of hanging until the timer
25002
+ // fires go() on it. The browser returns a plain number with no such method.
25003
+ // A consumer who wants the timer to hold the loop open can supply their own
25004
+ // timeout_source. StoneCypher/fsl#1952
25005
+ const maybe_unref = handle;
25006
+ // The no-unref path is the browser's numeric handle; it can't be reached in
25007
+ // the node-only coverage environment, so the false branch is ignored here.
25008
+ /* v8 ignore next */
25009
+ if (typeof maybe_unref.unref === 'function') {
25010
+ maybe_unref.unref();
25011
+ }
25012
+ return handle;
25013
+ };
24998
25014
  const DEFAULT_CLEAR_TIMEOUT_SOURCE = (h) => clearTimeout(h);
24999
25015
  class Machine {
25000
25016
  // whargarbl this badly needs to be broken up, monolith master