@agoric/swingset-vat 0.32.3-dev-1a00282.0 → 0.32.3-dev-8093cf6.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/swingset-vat",
3
- "version": "0.32.3-dev-1a00282.0+1a00282",
3
+ "version": "0.32.3-dev-8093cf6.0+8093cf6",
4
4
  "description": "Vat/Container Launcher",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -27,15 +27,15 @@
27
27
  "@types/yargs-parser": "^21.0.0"
28
28
  },
29
29
  "dependencies": {
30
- "@agoric/internal": "0.3.3-dev-1a00282.0+1a00282",
31
- "@agoric/kmarshal": "0.1.1-dev-1a00282.0+1a00282",
32
- "@agoric/store": "0.9.3-dev-1a00282.0+1a00282",
33
- "@agoric/swing-store": "0.9.2-dev-1a00282.0+1a00282",
34
- "@agoric/swingset-liveslots": "0.10.3-dev-1a00282.0+1a00282",
35
- "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-1a00282.0+1a00282",
36
- "@agoric/time": "0.3.3-dev-1a00282.0+1a00282",
37
- "@agoric/vat-data": "0.5.3-dev-1a00282.0+1a00282",
38
- "@agoric/xsnap-lockdown": "0.14.1-dev-1a00282.0+1a00282",
30
+ "@agoric/internal": "0.3.3-dev-8093cf6.0+8093cf6",
31
+ "@agoric/kmarshal": "0.1.1-dev-8093cf6.0+8093cf6",
32
+ "@agoric/store": "0.9.3-dev-8093cf6.0+8093cf6",
33
+ "@agoric/swing-store": "0.9.2-dev-8093cf6.0+8093cf6",
34
+ "@agoric/swingset-liveslots": "0.10.3-dev-8093cf6.0+8093cf6",
35
+ "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-8093cf6.0+8093cf6",
36
+ "@agoric/time": "0.3.3-dev-8093cf6.0+8093cf6",
37
+ "@agoric/vat-data": "0.5.3-dev-8093cf6.0+8093cf6",
38
+ "@agoric/xsnap-lockdown": "0.14.1-dev-8093cf6.0+8093cf6",
39
39
  "@endo/base64": "^1.0.9",
40
40
  "@endo/bundle-source": "^3.5.1",
41
41
  "@endo/captp": "^4.4.4",
@@ -102,5 +102,5 @@
102
102
  "typeCoverage": {
103
103
  "atLeast": 76.28
104
104
  },
105
- "gitHead": "1a00282001484febed3554bc231ae1d284295292"
105
+ "gitHead": "8093cf63e76c44a830bd5eabd58e7bad58f5f9f3"
106
106
  }
@@ -1,5 +1,6 @@
1
1
  import { Nat, isNat } from '@endo/nat';
2
2
  import { assert, Fail } from '@endo/errors';
3
+ import { naturalCompare } from '@agoric/internal/src/natural-sort.js';
3
4
  import {
4
5
  initializeVatState,
5
6
  makeVatKeeper,
@@ -1886,39 +1887,12 @@ export default function makeKernelKeeper(
1886
1887
  }
1887
1888
  }
1888
1889
 
1889
- function compareNumbers(a, b) {
1890
- return Number(a - b);
1891
- }
1892
-
1893
- function compareStrings(a, b) {
1894
- // natural-sort strings having a shared prefix followed by digits
1895
- // (e.g., 'ko42' and 'ko100')
1896
- const [_a, aPrefix, aDigits] = /^(\D+)(\d+)$/.exec(a) || [];
1897
- if (aPrefix) {
1898
- const [_b, bPrefix, bDigits] = /^(\D+)(\d+)$/.exec(b) || [];
1899
- if (bPrefix === aPrefix) {
1900
- return compareNumbers(aDigits, bDigits);
1901
- }
1902
- }
1903
-
1904
- // otherwise use the default string ordering
1905
- if (a > b) {
1906
- return 1;
1907
- }
1908
- if (a < b) {
1909
- return -1;
1910
- }
1911
- return 0;
1912
- }
1913
-
1890
+ // Perform an element-by-element natural sort.
1914
1891
  kernelTable.sort(
1915
1892
  (a, b) =>
1916
- compareStrings(a[0], b[0]) ||
1917
- compareStrings(a[1], b[1]) ||
1918
- compareNumbers(a[2], b[2]) ||
1919
- compareStrings(a[3], b[3]) ||
1920
- compareNumbers(a[4], b[4]) ||
1921
- compareNumbers(a[5], b[5]) ||
1893
+ naturalCompare(a[0], b[0]) ||
1894
+ naturalCompare(a[1], b[1]) ||
1895
+ naturalCompare(a[2], b[2]) ||
1922
1896
  0,
1923
1897
  );
1924
1898
 
@@ -1931,7 +1905,7 @@ export default function makeKernelKeeper(
1931
1905
  promises.push({ id: kpid, ...getKernelPromise(kpid) });
1932
1906
  }
1933
1907
  }
1934
- promises.sort((a, b) => compareStrings(a.id, b.id));
1908
+ promises.sort((a, b) => naturalCompare(a.id, b.id));
1935
1909
 
1936
1910
  const objects = [];
1937
1911
  const nextObjectID = Nat(BigInt(getRequired('ko.nextID')));