@systemfsoftware/stryker-js 10.1.0 → 10.1.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @systemfsoftware/stryker-js
2
2
 
3
+ ## 10.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - `@systemfsoftware/stryker-vm-harness` is the in-memory V8 VM test-runner harness that powers `testRunner: 'vm'`. `@systemfsoftware/stryker-js` now depends on it.
8
+
9
+ - The in-memory V8 VM runner (`testRunner: 'vm'`) now executes suites written for `vitest`, `@effect/vitest`, and `@systemfsoftware/effect-gherkin-spec` out of the box: the usual test surface — `describe`/`it`, `.skip`, `.only`, `.todo`, `.each`, `it.fails`, and hooks — behaves as it does under vitest, and each test is reported on its own with its real failure message instead of one all-tests result. Mutant runs attribute a kill to the exact test that caught the change. A suite that never finishes yields a timeout result instead of hanging the run, unhandled rejections are captured in the run report, module state is fresh on every run, and a suite that cannot compile still fails the run with a typed failure naming the file.
10
+
11
+ ## 10.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Exported declarations that previously took `unknown` now take a defaulted type parameter: calls that omit the type argument are unchanged, and calls that were previously rejected for passing an unconstrained value are accepted. No runtime behaviour changes.
16
+
3
17
  ## 10.1.0
4
18
 
5
19
  ### Minor Changes
@@ -3107,24 +3107,29 @@ const COMMENT_KEYS = /* @__PURE__ */ new Set(["leadingComments", "trailingCommen
3107
3107
  function isCommentKey(key) {
3108
3108
  return typeof key === "string" && COMMENT_KEYS.has(key);
3109
3109
  }
3110
+ function walkTraverse(root, stack, visitors) {
3111
+ walk(walkableNode(root), {
3112
+ enter(node, _parent, context) {
3113
+ readPath(stack, node, this, context, visitors);
3114
+ },
3115
+ leave(_node, _parent, context) {
3116
+ closePath(stack, context, visitors);
3117
+ }
3118
+ });
3119
+ }
3120
+ const toTraverseError = (error) => error instanceof Error ? error : new Error("Traversal failed", { cause: error });
3121
+ const handleTraverseError = (error) => {
3122
+ const err = toTraverseError(error);
3123
+ if (!S.is(TraversalStopped)(err)) throw err;
3124
+ };
3110
3125
  function traverse(root, visitors) {
3111
3126
  const stack = [];
3112
3127
  try {
3113
- walk(walkableNode(root), {
3114
- enter(node, _parent, context) {
3115
- readPath(stack, node, this, context, visitors);
3116
- },
3117
- leave(_node, _parent, context) {
3118
- closePath(stack, context, visitors);
3119
- }
3120
- });
3128
+ walkTraverse(root, stack, visitors);
3121
3129
  } catch (error) {
3122
- rethrowUnlessStopped(error);
3130
+ handleTraverseError(error);
3123
3131
  }
3124
3132
  }
3125
- const rethrowUnlessStopped = (error) => {
3126
- if (!S.is(TraversalStopped)(error)) throw error;
3127
- };
3128
3133
  const readPath = (stack, node, controls, context, visitors) => {
3129
3134
  if (isCommentKey(context.key)) return;
3130
3135
  const path = createPath(node, parentOf(stack), controls, context);
@@ -3192,7 +3197,7 @@ function writeInto(parent, key, index, replacement) {
3192
3197
  writeAtKey(parent, key, index, replacement);
3193
3198
  }
3194
3199
  function writeAtKey(parent, key, index, replacement) {
3195
- Match.value(key).pipe(Match.when(Predicate.isString, (slot) => writeAtSlot(parent, slot, index, replacement)), Match.orElse(() => void 0));
3200
+ if (Predicate.isString(key)) writeAtSlot(parent, key, index, replacement);
3196
3201
  }
3197
3202
  function writeAtSlot(parent, key, index, replacement) {
3198
3203
  Match.value(index).pipe(Match.when(Match.null, () => overwrite(parent, key, replacement)), Match.orElse((position) => writeElement(parent[key], position, replacement)));
@@ -3272,17 +3277,16 @@ function isRangedBaseNode(value) {
3272
3277
  function isNonEmptyArray(value) {
3273
3278
  return Array.isArray(value) && value.length > 0;
3274
3279
  }
3275
- function hasField(value, key) {
3276
- return isPlainRecord(value) && key in value;
3277
- }
3278
- function hasContent(value) {
3279
- return hasField(value, "content");
3280
+ function hasContentField(value) {
3281
+ return isPlainRecord(value) && "content" in value;
3280
3282
  }
3281
- function hasHtml(value) {
3282
- return hasField(value, "html");
3283
+ function hasHtmlField(value) {
3284
+ return isPlainRecord(value) && "html" in value;
3283
3285
  }
3286
+ const readRecordField = (record, key) => record[key];
3284
3287
  function fieldOf$1(value, key) {
3285
- return Match.value(value).pipe(Match.when(isPlainRecord, (record) => record[key]), Match.orElse(() => void 0));
3288
+ if (!isPlainRecord(value)) return void 0;
3289
+ return readRecordField(value, key);
3286
3290
  }
3287
3291
  function appendIfDefined(values, value) {
3288
3292
  if (value !== void 0) values.push(value);
@@ -3557,12 +3561,12 @@ function isTextRange(value) {
3557
3561
  function isTemplateExpressionTag(value) {
3558
3562
  return isTypedRecord(value) && TEMPLATE_EXPRESSION_TYPES[value["type"]] === true;
3559
3563
  }
3560
- /**
3561
- * The first child of a `<script>` element node. A template `<script>` tag
3562
- * carries its code as that single `Text` child.
3563
- */
3564
+ const firstChild = (element) => {
3565
+ const children = element["children"];
3566
+ return isNonEmptyArray(children) ? Option.getOrUndefined(Arr.head(children)) : void 0;
3567
+ };
3564
3568
  function scriptChild(node) {
3565
- return Match.value(node).pipe(Match.when(isScriptElement, (element) => Match.value(element["children"]).pipe(Match.when(isNonEmptyArray, (values) => Option.getOrUndefined(Arr.head(values))), Match.orElse(() => void 0))), Match.orElse(() => void 0));
3569
+ return isScriptElement(node) ? firstChild(node) : void 0;
3566
3570
  }
3567
3571
  function tryGetScriptRangeFromElement(node) {
3568
3572
  return Match.value(scriptChild(node)).pipe(Match.when(isTextRange, (range) => ({
@@ -3572,14 +3576,14 @@ function tryGetScriptRangeFromElement(node) {
3572
3576
  })), Match.orElse(() => void 0));
3573
3577
  }
3574
3578
  function templateExpressionRange(node) {
3575
- return Match.value(node).pipe(Match.when(isTemplateExpressionTag, (tag) => rangedExpressionOf(tag["expression"])), Match.orElse(() => void 0));
3579
+ return isTemplateExpressionTag(node) ? rangedExpressionOf(node["expression"]) : void 0;
3576
3580
  }
3577
3581
  function rangedExpressionOf(payload) {
3578
- return Match.value(payload).pipe(Match.when(isRangedBaseNode, (expression) => ({
3579
- start: expression.start,
3580
- end: expression.end,
3582
+ if (isRangedBaseNode(payload)) return {
3583
+ start: payload.start,
3584
+ end: payload.end,
3581
3585
  isExpression: true
3582
- })), Match.orElse(() => void 0));
3586
+ };
3583
3587
  }
3584
3588
  /**
3585
3589
  * Allow instrumentation of Svelte 5 projects without dropping support for Svelte 4.
@@ -3591,9 +3595,10 @@ const loadWalker = (version, fileName) => Match.value(isAtLeast(version, SVELTE_
3591
3595
  * The specifier is chosen at run time and both modules are optional peers of
3592
3596
  * this package, so neither can be a static import.
3593
3597
  */
3598
+ const findWalker = (module) => isRecordWithWalk(module) ? module.walk : void 0;
3594
3599
  const loadWalkerModule = (specifier, fileName, cause) => Effect$1.gen(function* () {
3595
3600
  const module = yield* Effect$1.promise(() => import(specifier));
3596
- const walk = Match.value(module).pipe(Match.when(isRecordWithWalk, (record) => record.walk), Match.orElse(() => void 0));
3601
+ const walk = findWalker(module);
3597
3602
  if (walk === void 0) return yield* SvelteWalkerNotFound.make({
3598
3603
  fileName,
3599
3604
  cause
@@ -3601,7 +3606,7 @@ const loadWalkerModule = (specifier, fileName, cause) => Effect$1.gen(function*
3601
3606
  return walk;
3602
3607
  });
3603
3608
  const parseSvelte = (text, fileName, context) => Effect$1.gen(function* () {
3604
- const { parse: svelteParse, preprocess, VERSION } = yield* Effect$1.promise(() => import("./compiler-Faeg70AC.mjs"));
3609
+ const { parse: svelteParse, preprocess, VERSION } = yield* Effect$1.promise(() => import("./compiler-BTpMWGqK.mjs"));
3605
3610
  if (!isAtLeast(VERSION, MINIMUM_SVELTE_VERSION)) return yield* SvelteVersionNotSupported.make({
3606
3611
  version: VERSION,
3607
3612
  fileName,
@@ -3668,29 +3673,31 @@ function getTemplateScriptRanges(ast, walker) {
3668
3673
  return ranges;
3669
3674
  }
3670
3675
  function htmlRootOf(ast) {
3671
- return Match.value(ast).pipe(Match.when(hasHtml, (record) => record["html"]), Match.orElse(() => {
3672
- throw new Error("Svelte AST without html");
3673
- }));
3676
+ if (!hasHtmlField(ast)) throw new Error("Svelte AST without html");
3677
+ return ast["html"];
3674
3678
  }
3675
3679
  function instanceScriptRange(ast) {
3676
- return Match.value(fieldOf$1(ast, "instance")).pipe(Match.when(hasContent, (instance) => scriptContentRange(instance["content"], INSTANCE_RANGE_MISSING)), Match.orElse(() => void 0));
3680
+ const record = contentFieldOf(fieldOf$1(ast, "instance"));
3681
+ return record === void 0 ? void 0 : scriptContentRange(record["content"], INSTANCE_RANGE_MISSING);
3677
3682
  }
3678
3683
  function scriptContentRange(content, missingRange) {
3679
- return Match.value(content).pipe(Match.when(isRange, (range) => ({
3680
- start: range.start,
3681
- end: range.end,
3684
+ if (isRange(content)) return {
3685
+ start: content.start,
3686
+ end: content.end,
3682
3687
  isExpression: false
3683
- })), Match.orElse(() => {
3684
- throw new Error(missingRange);
3685
- }));
3688
+ };
3689
+ throw new Error(missingRange);
3686
3690
  }
3687
3691
  function getModuleScriptRange(svelteAst) {
3688
3692
  return Match.value(fieldOf$1(svelteAst, "module")).pipe(Match.when(void 0, () => void 0), Match.when(null, () => void 0), Match.orElse((block) => moduleBlockRange(block)));
3689
3693
  }
3694
+ function contentFieldOf(value) {
3695
+ return Option.getOrUndefined(Option.filter(Option.fromNullishOr(value), hasContentField));
3696
+ }
3690
3697
  function moduleBlockRange(block) {
3691
- return Match.value(block).pipe(Match.when(hasContent, (record) => scriptContentRange(record["content"], MODULE_RANGE_MISSING)), Match.orElse(() => {
3692
- throw new Error(MODULE_RANGE_MISSING);
3693
- }));
3698
+ const record = contentFieldOf(block);
3699
+ if (record === void 0) throw new Error(MODULE_RANGE_MISSING);
3700
+ return scriptContentRange(record["content"], MODULE_RANGE_MISSING);
3694
3701
  }
3695
3702
  /**
3696
3703
  * Remaps script locations back to the original places using the script map
@@ -5888,16 +5895,19 @@ function literalWithoutRegex(node) {
5888
5895
  return valueLiteralText(node.value);
5889
5896
  }
5890
5897
  function valueLiteralText(value) {
5891
- switch (typeof value) {
5892
- case "string": return JSON.stringify(value);
5893
- case "number": return String(value);
5894
- case "boolean": return String(value);
5895
- case "bigint": return `${value}n`;
5896
- case "symbol":
5897
- case "undefined":
5898
- case "object":
5899
- case "function": return "null";
5900
- }
5898
+ if (typeof value === "string") return JSON.stringify(value);
5899
+ return nonStringLiteralText(value);
5900
+ }
5901
+ function nonStringLiteralText(value) {
5902
+ if (typeof value === "number") return String(value);
5903
+ return booleanOrBigintText(value);
5904
+ }
5905
+ function booleanOrBigintText(value) {
5906
+ if (typeof value === "boolean") return String(value);
5907
+ return bigintText(value);
5908
+ }
5909
+ function bigintText(value) {
5910
+ return typeof value === "bigint" ? `${value}n` : "null";
5901
5911
  }
5902
5912
  function flagText(present, text) {
5903
5913
  switch (Boolean(present)) {
@@ -5949,13 +5959,12 @@ const HASHBANG_FIELDS = {
5949
5959
  function isHashbang(value) {
5950
5960
  return Predicate.isObject(value) && Object.entries(HASHBANG_FIELDS).every(([key, accepts]) => accepts(value[key]));
5951
5961
  }
5952
- const hashbangOf = (root) => {
5953
- const hashbang = Reflect.get(root, "hashbang");
5954
- if (!isHashbang(hashbang)) return null;
5955
- return hashbang;
5956
- };
5957
- const jsPrint = (file) => printProgram(file.root, { hashbang: hashbangOf(file.root) });
5958
- const tsPrint = (file) => printProgram(file.root, { hashbang: hashbangOf(file.root) });
5962
+ const toHashbang = (hashbang) => isHashbang(hashbang) ? hashbang : null;
5963
+ function getHashbang(root) {
5964
+ return toHashbang("hashbang" in root ? root.hashbang : null);
5965
+ }
5966
+ const jsPrint = (file) => printProgram(file.root, { hashbang: getHashbang(file.root) });
5967
+ const tsPrint = (file) => printProgram(file.root, { hashbang: getHashbang(file.root) });
5959
5968
  function getScriptStart$1(script) {
5960
5969
  const span = spanOf(script.root);
5961
5970
  if (span === void 0) throw new Error("Script AST root without start");
@@ -6019,9 +6028,14 @@ function normalizeFileName(fileName) {
6019
6028
  }
6020
6029
  const hasText = (value) => Predicate.isString(value) && value.length > 0;
6021
6030
  const textIfNonEmpty = (value) => Option.getOrUndefined(Option.filter(Option.fromUndefinedOr(value), hasText));
6022
- const fieldOf = (value, key) => Match.value(key in value).pipe(Match.when(true, () => {
6023
- return Reflect.get(value, key);
6024
- }), Match.orElse(() => void 0));
6031
+ function readFieldOf(record, key) {
6032
+ return record[key];
6033
+ }
6034
+ const hasFieldIn = (value, key) => key in value;
6035
+ const fieldOf = (value, key) => {
6036
+ if (!hasFieldIn(value, key)) return;
6037
+ return readFieldOf(value, key);
6038
+ };
6025
6039
  const hasStringCode = (error) => Match.value(fieldOf(error, "code")).pipe(Match.when(Match.string, () => true), Match.orElse(() => false));
6026
6040
  function isErrnoException(error) {
6027
6041
  return Match.value(error).pipe(Match.when(Match.instanceOf(Error), hasStringCode), Match.orElse(() => false));
@@ -6046,7 +6060,7 @@ const isNonPlaceholderText = (text) => Match.value({
6046
6060
  isPlaceholder: false
6047
6061
  }, () => true), Match.orElse(() => false));
6048
6062
  const isUsableText = (value) => Match.value(value).pipe(Match.when(Match.string, isNonPlaceholderText), Match.orElse(() => false));
6049
- const usableText = (value) => Match.value(value).pipe(Match.when(isUsableText, (text) => text), Match.orElse(() => ""));
6063
+ const usableText = (value) => isUsableText(value) ? value : "";
6050
6064
  const objectToStringText = (value) => Match.value(fieldOf(value, "toString")).pipe(Match.when(Match.instanceOf(Function), (callable) => {
6051
6065
  try {
6052
6066
  return usableText(Reflect.apply(callable, value, []));
@@ -6055,9 +6069,19 @@ const objectToStringText = (value) => Match.value(fieldOf(value, "toString")).pi
6055
6069
  }
6056
6070
  }), Match.orElse(() => ""));
6057
6071
  const isObjectType = (cause) => typeof cause === "object";
6058
- const toStringText = (error) => Match.value(error).pipe(Match.when(Match.null, () => ""), Match.when(isObjectType, (value) => objectToStringText(value)), Match.orElse(() => ""));
6059
- const stringifyRest = (error) => Match.value(jsonText(error)).pipe(Match.when(hasText, (json) => json), Match.orElse(() => toStringText(error)));
6060
- const stringifyNonError = (error) => Match.value(error).pipe(Match.when(Match.string, (text) => text), Match.when(isJsonPrimitive, (primitive) => JSON.stringify(primitive)), Match.orElse(() => stringifyRest(error)));
6072
+ const isNonNullObjectType = (error) => error !== null && isObjectType(error);
6073
+ const toStringText = (error) => isNonNullObjectType(error) ? objectToStringText(error) : "";
6074
+ const stringifyRest = (error) => {
6075
+ const json = jsonText(error);
6076
+ return hasText(json) ? json : toStringText(error);
6077
+ };
6078
+ function primitiveJsonOf(error) {
6079
+ return isJsonPrimitive(error) ? JSON.stringify(error) : void 0;
6080
+ }
6081
+ const stringifyNonError = (error) => typeof error === "string" ? error : nonStringTextOf(error);
6082
+ function nonStringTextOf(error) {
6083
+ return primitiveJsonOf(error) ?? stringifyRest(error);
6084
+ }
6061
6085
  const errorText = (error) => Match.value(error).pipe(Match.when(isErrnoException, formatErrnoException), Match.orElse(() => formatError(error)));
6062
6086
  function errorToString(error) {
6063
6087
  return Match.value(error).pipe(Match.when(isEmptyError, () => ""), Match.when(Match.instanceOf(Error), errorText), Match.orElse(() => stringifyNonError(error)));
@@ -6349,9 +6373,10 @@ function withOperator(node, operator) {
6349
6373
  function mutantsWhen(holds, build) {
6350
6374
  return Match.value(holds).pipe(Match.when(true, build), Match.orElse(() => NO_MUTANTS));
6351
6375
  }
6352
- /** A named property of a node that may or may not carry it. */
6376
+ const hasPropertyIn = (node, key) => key in node;
6377
+ const readPropertyOf = (node, key) => hasPropertyIn(node, key) ? node[key] : void 0;
6353
6378
  function propertyOf(node, key) {
6354
- return Match.value(node).pipe(Match.when((candidate) => Predicate.hasProperty(candidate, key), (host) => host[key]), Match.orElse(() => void 0));
6379
+ return Predicate.isObject(node) ? readPropertyOf(node, key) : void 0;
6355
6380
  }
6356
6381
  function isIdentifier(node) {
6357
6382
  return nodeType(node) === "Identifier";
@@ -7415,7 +7440,8 @@ function frozenContainer(value) {
7415
7440
  freezableChildren(object).forEach((child) => {
7416
7441
  deepFreeze(child);
7417
7442
  });
7418
- return Object.freeze(object);
7443
+ Object.freeze(object);
7444
+ return value;
7419
7445
  });
7420
7446
  }
7421
7447
  function freezableChildren(value) {
@@ -1,4 +1,4 @@
1
- import { C as Metrics, _ as ExitClass } from "./index-BopuZXrl.mjs";
1
+ import { C as Metrics, _ as ExitClass } from "./index-CogNSD0V.mjs";
2
2
  import * as S from "effect/Schema";
3
3
  //#region src/RunEvent.schema.d.ts
4
4
  declare const RunPhase: S.Literals<readonly ["prepare", "instrument", "dry-run", "mutation-test"]>;
@@ -1,4 +1,5 @@
1
1
  import { n as __exportAll, t as __commonJSMin } from "./rolldown-runtime-XITHOX9H.mjs";
2
+ import { n as encode, t as decode } from "./sourcemap-codec-qFD3eFBj.mjs";
2
3
  //#region ../../node_modules/.pnpm/zimmerframe@1.1.5/node_modules/zimmerframe/src/walk.js
3
4
  /** @import { Context, Visitor, Visitors } from './types.js' */
4
5
  /**
@@ -35774,176 +35775,6 @@ function order_reactive_statements(unsorted_reactive_declarations) {
35774
35775
  for (const [node, declaration] of unsorted_reactive_declarations) add_declaration(node, declaration);
35775
35776
  return reactive_declarations;
35776
35777
  }
35777
- //#endregion
35778
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
35779
- var comma = ",".charCodeAt(0);
35780
- var semicolon = ";".charCodeAt(0);
35781
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
35782
- var intToChar = /* @__PURE__ */ new Uint8Array(64);
35783
- var charToInt = /* @__PURE__ */ new Uint8Array(128);
35784
- for (let i = 0; i < chars.length; i++) {
35785
- const c = chars.charCodeAt(i);
35786
- intToChar[i] = c;
35787
- charToInt[c] = i;
35788
- }
35789
- function decodeInteger(reader) {
35790
- let value = 0;
35791
- let shift = 0;
35792
- let integer = 0;
35793
- do {
35794
- integer = charToInt[reader.next()];
35795
- value |= (integer & 31) << shift;
35796
- shift += 5;
35797
- } while (integer & 32);
35798
- return value;
35799
- }
35800
- function decodeSign(num) {
35801
- return num & 1 ? -2147483648 | -(num >>> 1) : num >>> 1;
35802
- }
35803
- function encodeInteger(builder, num) {
35804
- do {
35805
- let clamped = num & 31;
35806
- num >>>= 5;
35807
- if (num > 0) clamped |= 32;
35808
- builder.write(intToChar[clamped]);
35809
- } while (num > 0);
35810
- }
35811
- function encodeSign(num) {
35812
- return num < 0 ? -num << 1 | 1 : num << 1;
35813
- }
35814
- function hasMoreVlq(reader, max) {
35815
- if (reader.pos >= max) return false;
35816
- return reader.peek() !== comma;
35817
- }
35818
- var bufLength = 16384;
35819
- var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
35820
- return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
35821
- } } : { decode(buf) {
35822
- let out = "";
35823
- for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
35824
- return out;
35825
- } };
35826
- var StringWriter = class {
35827
- constructor() {
35828
- this.pos = 0;
35829
- this.out = "";
35830
- this.buffer = new Uint8Array(bufLength);
35831
- }
35832
- write(v) {
35833
- const { buffer } = this;
35834
- buffer[this.pos++] = v;
35835
- if (this.pos === bufLength) {
35836
- this.out += td.decode(buffer);
35837
- this.pos = 0;
35838
- }
35839
- }
35840
- flush() {
35841
- const { buffer, out, pos } = this;
35842
- return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
35843
- }
35844
- };
35845
- var StringReader = class {
35846
- constructor(buffer) {
35847
- this.pos = 0;
35848
- this.buffer = buffer;
35849
- }
35850
- next() {
35851
- return this.buffer.charCodeAt(this.pos++);
35852
- }
35853
- peek() {
35854
- return this.buffer.charCodeAt(this.pos);
35855
- }
35856
- indexOf(char) {
35857
- const { buffer, pos } = this;
35858
- const idx = buffer.indexOf(char, pos);
35859
- return idx === -1 ? buffer.length : idx;
35860
- }
35861
- };
35862
- function decode(mappings) {
35863
- const { length } = mappings;
35864
- const reader = new StringReader(mappings);
35865
- const decoded = [];
35866
- let genColumn = 0;
35867
- let sourcesIndex = 0;
35868
- let sourceLine = 0;
35869
- let sourceColumn = 0;
35870
- let namesIndex = 0;
35871
- do {
35872
- const semi = reader.indexOf(";");
35873
- const line = [];
35874
- let sorted = true;
35875
- let lastCol = 0;
35876
- genColumn = 0;
35877
- while (reader.pos < semi) {
35878
- let seg;
35879
- genColumn += decodeSign(decodeInteger(reader));
35880
- if (genColumn < lastCol) sorted = false;
35881
- lastCol = genColumn;
35882
- if (hasMoreVlq(reader, semi)) {
35883
- sourcesIndex += decodeSign(decodeInteger(reader));
35884
- sourceLine += decodeSign(decodeInteger(reader));
35885
- sourceColumn += decodeSign(decodeInteger(reader));
35886
- if (hasMoreVlq(reader, semi)) {
35887
- namesIndex += decodeSign(decodeInteger(reader));
35888
- seg = [
35889
- genColumn,
35890
- sourcesIndex,
35891
- sourceLine,
35892
- sourceColumn,
35893
- namesIndex
35894
- ];
35895
- } else seg = [
35896
- genColumn,
35897
- sourcesIndex,
35898
- sourceLine,
35899
- sourceColumn
35900
- ];
35901
- } else seg = [genColumn];
35902
- line.push(seg);
35903
- reader.pos++;
35904
- }
35905
- if (!sorted) sort(line);
35906
- decoded.push(line);
35907
- reader.pos = semi + 1;
35908
- } while (reader.pos <= length);
35909
- return decoded;
35910
- }
35911
- function sort(line) {
35912
- line.sort(sortComparator$1);
35913
- }
35914
- function sortComparator$1(a, b) {
35915
- return a[0] - b[0];
35916
- }
35917
- function encode(decoded) {
35918
- const writer = new StringWriter();
35919
- let sourcesIndex = 0;
35920
- let sourceLine = 0;
35921
- let sourceColumn = 0;
35922
- let namesIndex = 0;
35923
- for (let i = 0; i < decoded.length; i++) {
35924
- const line = decoded[i];
35925
- if (i > 0) writer.write(semicolon);
35926
- if (line.length === 0) continue;
35927
- let genColumn = 0;
35928
- for (let j = 0; j < line.length; j++) {
35929
- const segment = line[j];
35930
- if (j > 0) writer.write(comma);
35931
- encodeInteger(writer, encodeSign(segment[0] - genColumn));
35932
- genColumn = segment[0];
35933
- if (segment.length === 1) continue;
35934
- encodeInteger(writer, encodeSign(segment[1] - sourcesIndex));
35935
- encodeInteger(writer, encodeSign(segment[2] - sourceLine));
35936
- encodeInteger(writer, encodeSign(segment[3] - sourceColumn));
35937
- sourcesIndex = segment[1];
35938
- sourceLine = segment[2];
35939
- sourceColumn = segment[3];
35940
- if (segment.length === 4) continue;
35941
- encodeInteger(writer, encodeSign(segment[4] - namesIndex));
35942
- namesIndex = segment[4];
35943
- }
35944
- }
35945
- return writer.flush();
35946
- }
35947
35778
  var Context = class Context {
35948
35779
  #visitors;
35949
35780
  #commands;