@velarscript/compiler 0.12.0 → 0.13.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.
Files changed (109) hide show
  1. package/dist/advisory-suppression.d.ts +62 -0
  2. package/dist/advisory-suppression.d.ts.map +1 -0
  3. package/dist/advisory-suppression.js +179 -0
  4. package/dist/advisory-suppression.js.map +1 -0
  5. package/dist/analyzer.d.ts +405 -17
  6. package/dist/analyzer.d.ts.map +1 -1
  7. package/dist/analyzer.js +1755 -211
  8. package/dist/analyzer.js.map +1 -1
  9. package/dist/ast.d.ts +6 -3
  10. package/dist/ast.d.ts.map +1 -1
  11. package/dist/ast.js.map +1 -1
  12. package/dist/binding-stability.d.ts +22 -0
  13. package/dist/binding-stability.d.ts.map +1 -0
  14. package/dist/binding-stability.js +63 -0
  15. package/dist/binding-stability.js.map +1 -0
  16. package/dist/collection-lowering-runtime.d.ts +1 -1
  17. package/dist/collection-lowering-runtime.d.ts.map +1 -1
  18. package/dist/collection-lowering-runtime.js +183 -56
  19. package/dist/collection-lowering-runtime.js.map +1 -1
  20. package/dist/diagnostic.d.ts +34 -0
  21. package/dist/diagnostic.d.ts.map +1 -1
  22. package/dist/diagnostic.js +11 -1
  23. package/dist/diagnostic.js.map +1 -1
  24. package/dist/embedded-javascript.d.ts +12 -1
  25. package/dist/embedded-javascript.d.ts.map +1 -1
  26. package/dist/embedded-javascript.js +111 -2
  27. package/dist/embedded-javascript.js.map +1 -1
  28. package/dist/embedded-module.d.ts.map +1 -1
  29. package/dist/embedded-module.js +22 -0
  30. package/dist/embedded-module.js.map +1 -1
  31. package/dist/emitter.d.ts +83 -1
  32. package/dist/emitter.d.ts.map +1 -1
  33. package/dist/emitter.js +518 -41
  34. package/dist/emitter.js.map +1 -1
  35. package/dist/error-runtime.d.ts +9 -0
  36. package/dist/error-runtime.d.ts.map +1 -1
  37. package/dist/error-runtime.js +21 -0
  38. package/dist/error-runtime.js.map +1 -1
  39. package/dist/extension.d.ts +5 -2
  40. package/dist/extension.d.ts.map +1 -1
  41. package/dist/extension.js +2 -1
  42. package/dist/extension.js.map +1 -1
  43. package/dist/formatter.d.ts.map +1 -1
  44. package/dist/formatter.js +222 -91
  45. package/dist/formatter.js.map +1 -1
  46. package/dist/index.d.ts +10 -2
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +43 -5
  49. package/dist/index.js.map +1 -1
  50. package/dist/interpolated-string.d.ts.map +1 -1
  51. package/dist/interpolated-string.js +29 -2
  52. package/dist/interpolated-string.js.map +1 -1
  53. package/dist/json-runtime.d.ts.map +1 -1
  54. package/dist/json-runtime.js +27 -3
  55. package/dist/json-runtime.js.map +1 -1
  56. package/dist/lexer.d.ts +217 -1
  57. package/dist/lexer.d.ts.map +1 -1
  58. package/dist/lexer.js +799 -37
  59. package/dist/lexer.js.map +1 -1
  60. package/dist/limits.d.ts +9 -0
  61. package/dist/limits.d.ts.map +1 -1
  62. package/dist/limits.js +9 -0
  63. package/dist/limits.js.map +1 -1
  64. package/dist/mechanical-fix.d.ts.map +1 -1
  65. package/dist/mechanical-fix.js +38 -0
  66. package/dist/mechanical-fix.js.map +1 -1
  67. package/dist/parser.d.ts +30 -1
  68. package/dist/parser.d.ts.map +1 -1
  69. package/dist/parser.js +137 -21
  70. package/dist/parser.js.map +1 -1
  71. package/dist/promise-runtime.d.ts +20 -1
  72. package/dist/promise-runtime.d.ts.map +1 -1
  73. package/dist/promise-runtime.js +38 -3
  74. package/dist/promise-runtime.js.map +1 -1
  75. package/dist/reactive-bridge-runtime.d.ts.map +1 -1
  76. package/dist/reactive-bridge-runtime.js +7 -1
  77. package/dist/reactive-bridge-runtime.js.map +1 -1
  78. package/dist/runtime-abi.d.ts +21 -1
  79. package/dist/runtime-abi.d.ts.map +1 -1
  80. package/dist/runtime-abi.js +23 -3
  81. package/dist/runtime-abi.js.map +1 -1
  82. package/dist/source-names.d.ts +26 -0
  83. package/dist/source-names.d.ts.map +1 -1
  84. package/dist/source-names.js +49 -5
  85. package/dist/source-names.js.map +1 -1
  86. package/dist/source.d.ts.map +1 -1
  87. package/dist/source.js +13 -0
  88. package/dist/source.js.map +1 -1
  89. package/dist/stable-order.d.ts +16 -0
  90. package/dist/stable-order.d.ts.map +1 -0
  91. package/dist/stable-order.js +18 -0
  92. package/dist/stable-order.js.map +1 -0
  93. package/dist/text-runtime.d.ts.map +1 -1
  94. package/dist/text-runtime.js +182 -41
  95. package/dist/text-runtime.js.map +1 -1
  96. package/dist/token.d.ts +11 -0
  97. package/dist/token.d.ts.map +1 -1
  98. package/dist/token.js.map +1 -1
  99. package/dist/type-registry-runtime.d.ts.map +1 -1
  100. package/dist/type-registry-runtime.js +8 -1
  101. package/dist/type-registry-runtime.js.map +1 -1
  102. package/dist/type-validation-runtime.d.ts.map +1 -1
  103. package/dist/type-validation-runtime.js +129 -1
  104. package/dist/type-validation-runtime.js.map +1 -1
  105. package/dist/types.d.ts +17 -1
  106. package/dist/types.d.ts.map +1 -1
  107. package/dist/types.js +161 -17
  108. package/dist/types.js.map +1 -1
  109. package/package.json +1 -1
@@ -1,4 +1,23 @@
1
- /** Compiler-owned Promise normalization and async-result host ABI. */
1
+ /**
2
+ * Compiler-owned Promise normalization and async-result host ABI.
3
+ *
4
+ * Normalization proves its input by invoking the captured `then` intrinsic on
5
+ * it and then builds the normalized value with the captured `%Promise%`
6
+ * constructor rather than returning what `then` handed back: `then` derives
7
+ * its result through `SpeciesConstructor`, so one assignment to a Promise's
8
+ * `constructor` would otherwise make the normalized identity an arbitrary
9
+ * foreign thenable. The hostile species is still constructed by `then` and its
10
+ * capability discarded; only the `%Promise%`-owned value is cached.
11
+ *
12
+ * The cache is one immutable per-realm WeakMap found under
13
+ * `VELAR_PROMISE_NORMALIZATION_REGISTRY_KEY`, whose trailing `v` component is
14
+ * the generation in `VELAR_PROMISE_NORMALIZATION_REGISTRY_VERSION`. Whichever
15
+ * module of a generation loads first installs that generation's WeakMap; a
16
+ * generation with a different normalized identity bumps the version and gets
17
+ * its own slot rather than reading entries a foreign generation cached. Nothing
18
+ * evicts, and nothing should: the map is keyed by the source Promise, so an
19
+ * entry lives exactly as long as the Promise it normalizes.
20
+ */
2
21
  export declare const VELAR_PROMISE_NORMALIZATION_RUNTIME: string;
3
22
  export declare const VELAR_PROMISE_NORMALIZATION_MODULE = "velar/compiler-runtime-promises-v1";
4
23
  /** Project-shared implementation of compiler-lowered Promise boundaries. */
@@ -1 +1 @@
1
- {"version":3,"file":"promise-runtime.d.ts","sourceRoot":"","sources":["../src/promise-runtime.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,eAAO,MAAM,mCAAmC,QAyEnC,CAAC;AAEd,eAAO,MAAM,kCAAkC,uCAAuC,CAAC;AAEvF,4EAA4E;AAC5E,eAAO,MAAM,yCAAyC,QAMzC,CAAC"}
1
+ {"version":3,"file":"promise-runtime.d.ts","sourceRoot":"","sources":["../src/promise-runtime.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mCAAmC,QAyFnC,CAAC;AAEd,eAAO,MAAM,kCAAkC,uCAAuC,CAAC;AAEvF,4EAA4E;AAC5E,eAAO,MAAM,yCAAyC,QAMzC,CAAC"}
@@ -1,5 +1,24 @@
1
1
  import { VELAR_PROMISE_NORMALIZATION_REGISTRY_KEY } from "./runtime-abi.js";
2
- /** Compiler-owned Promise normalization and async-result host ABI. */
2
+ /**
3
+ * Compiler-owned Promise normalization and async-result host ABI.
4
+ *
5
+ * Normalization proves its input by invoking the captured `then` intrinsic on
6
+ * it and then builds the normalized value with the captured `%Promise%`
7
+ * constructor rather than returning what `then` handed back: `then` derives
8
+ * its result through `SpeciesConstructor`, so one assignment to a Promise's
9
+ * `constructor` would otherwise make the normalized identity an arbitrary
10
+ * foreign thenable. The hostile species is still constructed by `then` and its
11
+ * capability discarded; only the `%Promise%`-owned value is cached.
12
+ *
13
+ * The cache is one immutable per-realm WeakMap found under
14
+ * `VELAR_PROMISE_NORMALIZATION_REGISTRY_KEY`, whose trailing `v` component is
15
+ * the generation in `VELAR_PROMISE_NORMALIZATION_REGISTRY_VERSION`. Whichever
16
+ * module of a generation loads first installs that generation's WeakMap; a
17
+ * generation with a different normalized identity bumps the version and gets
18
+ * its own slot rather than reading entries a foreign generation cached. Nothing
19
+ * evicts, and nothing should: the map is keyed by the source Promise, so an
20
+ * entry lives exactly as long as the Promise it normalizes.
21
+ */
3
22
  export const VELAR_PROMISE_NORMALIZATION_RUNTIME = String.raw `
4
23
  const __velarNormalizeGlobal = globalThis;
5
24
  const __velarNormalizeNativeObject = globalThis.Object;
@@ -43,13 +62,29 @@ const __velarNormalizedPromiseValues = (() => {
43
62
  }]);
44
63
  return registry;
45
64
  })();
65
+ function __velarNormalizeOwnsPromise(candidate) {
66
+ if ((typeof candidate !== "object" && typeof candidate !== "function") || candidate === null) return false;
67
+ let prototype;
68
+ try { prototype = __velarNormalizeCall(__velarNormalizeGetPrototypeOf, __velarNormalizeNativeObject, [candidate]); }
69
+ catch { return false; }
70
+ return prototype === __velarNormalizePromisePrototype;
71
+ }
46
72
  function __velarNormalizePromiseValue(value) {
47
73
  if ((typeof value !== "object" && typeof value !== "function") || value === null) throw new __velarNormalizeTypeError("Expected an actual Promise");
48
74
  const known = __velarNormalizeCall(__velarNormalizeWeakMapGet, __velarNormalizedPromiseValues, [value]);
49
75
  if (known) return known;
50
- let normalized;
51
- try { normalized = __velarNormalizeCall(__velarNormalizePromiseThen, value, [(resolved) => resolved ?? null]); }
76
+ let settle;
77
+ let fail;
78
+ try {
79
+ __velarNormalizeCall(__velarNormalizePromiseThen, value, [
80
+ (resolved) => { if (typeof settle === "function") settle(resolved ?? null); },
81
+ (reason) => { if (typeof fail === "function") fail(reason); },
82
+ ]);
83
+ }
52
84
  catch { throw new __velarNormalizeTypeError("Expected an actual Promise"); }
85
+ if (typeof __velarNormalizeNativePromise !== "function") throw new __velarNormalizeTypeError("The JavaScript Promise normalization runtime is unavailable");
86
+ const normalized = new __velarNormalizeNativePromise((resolve, reject) => { settle = resolve; fail = reject; });
87
+ if (typeof settle !== "function" || typeof fail !== "function" || !__velarNormalizeOwnsPromise(normalized)) throw new __velarNormalizeTypeError("The JavaScript Promise normalization runtime is unavailable");
53
88
  __velarNormalizeCall(__velarNormalizeWeakMapSet, __velarNormalizedPromiseValues, [value, normalized]);
54
89
  __velarNormalizeCall(__velarNormalizeWeakMapSet, __velarNormalizedPromiseValues, [normalized, normalized]);
55
90
  return normalized;
@@ -1 +1 @@
1
- {"version":3,"file":"promise-runtime.js","sourceRoot":"","sources":["../src/promise-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,kBAAkB,CAAC;AAE5E,sEAAsE;AACtE,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;6HAuBgE,IAAI,CAAC,SAAS,CAAC,wCAAwC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDpL,CAAC,SAAS,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,kCAAkC,GAAG,oCAAoC,CAAC;AAEvF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yCAAyC,GAAG,MAAM,CAAC,GAAG,CAAA;EACjE,mCAAmC;;;;;CAKpC,CAAC,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"promise-runtime.js","sourceRoot":"","sources":["../src/promise-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,kBAAkB,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;6HAuBgE,IAAI,CAAC,SAAS,CAAC,wCAAwC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEpL,CAAC,SAAS,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,kCAAkC,GAAG,oCAAoC,CAAC;AAEvF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yCAAyC,GAAG,MAAM,CAAC,GAAG,CAAA;EACjE,mCAAmC;;;;;CAKpC,CAAC,SAAS,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"reactive-bridge-runtime.d.ts","sourceRoot":"","sources":["../src/reactive-bridge-runtime.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,uCAAuC,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAKjC,CAAC;AAEd,eAAO,MAAM,4CAA4C,QAM5C,CAAC;AAEd,6FAA6F;AAC7F,eAAO,MAAM,6BAA6B,QAmD7B,CAAC;AAEd,6DAA6D;AAC7D,eAAO,MAAM,wCAAwC,QAuCxC,CAAC;AAEd,eAAO,MAAM,mCAAmC,QAcnC,CAAC;AAEd,eAAO,MAAM,uCAAuC,QAcvC,CAAC"}
1
+ {"version":3,"file":"reactive-bridge-runtime.d.ts","sourceRoot":"","sources":["../src/reactive-bridge-runtime.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,uCAAuC,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAKjC,CAAC;AAEd,eAAO,MAAM,4CAA4C,QAM5C,CAAC;AAEd,6FAA6F;AAC7F,eAAO,MAAM,6BAA6B,QAyD7B,CAAC;AAEd,6DAA6D;AAC7D,eAAO,MAAM,wCAAwC,QAuCxC,CAAC;AAEd,eAAO,MAAM,mCAAmC,QAcnC,CAAC;AAEd,eAAO,MAAM,uCAAuC,QAcvC,CAAC"}
@@ -59,7 +59,13 @@ function __velarResolveReactiveBridge() {
59
59
  }
60
60
  const version = __velarReactiveBridgeField(runtime, "version");
61
61
  const toRaw = __velarReactiveBridgeField(runtime, "toRaw");
62
- if (version !== ${JSON.stringify(VELAR_RUNTIME_SCHEMA_VERSION)} || typeof toRaw !== "function") {
62
+ // The generation mismatch gets its own message: it is the one failure an
63
+ // author can act on, and the shared "values are invalid" wording never named
64
+ // either version.
65
+ if (version !== ${JSON.stringify(VELAR_RUNTIME_SCHEMA_VERSION)}) {
66
+ throw new __velarReactiveBridgeNativeTypeError("VelarScript reactive runtime schema " + (typeof version === "string" ? version : "(unknown)") + " does not match this module's schema ${VELAR_RUNTIME_SCHEMA_VERSION}; one build mixed two generations of @velarscript/* — run 'npm ls @velarscript/compiler' and pin one version");
67
+ }
68
+ if (typeof toRaw !== "function") {
63
69
  throw new __velarReactiveBridgeNativeTypeError("VelarScript reactive runtime values are invalid");
64
70
  }
65
71
  __velarReactiveBridge = { runtime, toRaw };
@@ -1 +1 @@
1
- {"version":3,"file":"reactive-bridge-runtime.js","sourceRoot":"","sources":["../src/reactive-bridge-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAE5F,MAAM,CAAC,MAAM,4BAA4B,GAAG,oCAAoC,CAAC;AAEjF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAK1D,CAAC,SAAS,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,4CAA4C,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMrE,CAAC,SAAS,EAAE,CAAC;AAEd,6FAA6F;AAC7F,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;mEAaY,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA2BzF,IAAI,CAAC,SAAS,CAAC,4BAA4B,CAAC;;;;;;;;;;;CAW/D,CAAC,SAAS,EAAE,CAAC;AAEd,6DAA6D;AAC7D,MAAM,CAAC,MAAM,wCAAwC,GAAG,MAAM,CAA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AEd,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC,GAAG,CAAA;EAC3D,6BAA6B;EAC7B,wCAAwC;;;;;;;;;;;;CAYzC,CAAC,SAAS,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,uCAAuC,GAAG,MAAM,CAAC,GAAG,CAAA;EAC/D,iCAAiC;EACjC,4CAA4C;;;;;;;;;;;;CAY7C,CAAC,SAAS,EAAE,CAAC"}
@@ -9,12 +9,32 @@ export declare const VELAR_RUNTIME_REGISTRY_KEY = "velar.runtime.v1";
9
9
  * registry. This version is independent from npm package and language versions.
10
10
  */
11
11
  export declare const VELAR_RUNTIME_SCHEMA_VERSION = "0.12";
12
+ /**
13
+ * Generation of the compiler-known runtime Type surface. It is deliberately
14
+ * not `VELAR_RUNTIME_SCHEMA_VERSION`: Type identity is shared by Core and every
15
+ * extension, including targets with no reactive runtime, so it moves on its own
16
+ * schedule. Bump it whenever the shape a registered Type presents changes, so
17
+ * two generations converge on two registries instead of one mixed one.
18
+ */
19
+ export declare const VELAR_TYPE_REGISTRY_VERSION = "1";
12
20
  /**
13
21
  * Global identity for compiler-known runtime Type objects. The registry is
14
22
  * separate from the reactive runtime schema because Type identity is shared by
15
- * Core and every extension, including targets with no Web runtime.
23
+ * Core and every extension, including targets with no Web runtime. The
24
+ * generation above is the key's trailing `v` component, so a bump renames the
25
+ * global slot rather than reusing a foreign generation's WeakSet.
16
26
  */
17
27
  export declare const VELAR_TYPE_REGISTRY_KEY = "velar.type.registry.v1";
28
+ /**
29
+ * Generation of the Promise normalization cache. Independent of both versions
30
+ * above: it moves when the normalized identity a cached entry stands for
31
+ * changes. Bumping it gives the next generation its own WeakMap instead of
32
+ * letting whichever module loaded first hand its cached values to every other
33
+ * generation in the realm. Eviction is not part of this contract and must not
34
+ * be added — the cache is a WeakMap keyed by the source Promise, so an entry is
35
+ * released with the Promise it belongs to.
36
+ */
37
+ export declare const VELAR_PROMISE_NORMALIZATION_REGISTRY_VERSION = "1";
18
38
  /**
19
39
  * Global identity for Promise values already normalized at a checked
20
40
  * JavaScript boundary. Multiple generated modules must converge on one cache
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-abi.d.ts","sourceRoot":"","sources":["../src/runtime-abi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,4BAA4B,SAAS,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,wCAAwC,mCAAmC,CAAC"}
1
+ {"version":3,"file":"runtime-abi.d.ts","sourceRoot":"","sources":["../src/runtime-abi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,4BAA4B,SAAS,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,2BAAwD,CAAC;AAE7F;;;;;;;;GAQG;AACH,eAAO,MAAM,4CAA4C,MAAM,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,wCAAwC,mCAC2B,CAAC"}
@@ -9,16 +9,36 @@ export const VELAR_RUNTIME_REGISTRY_KEY = "velar.runtime.v1";
9
9
  * registry. This version is independent from npm package and language versions.
10
10
  */
11
11
  export const VELAR_RUNTIME_SCHEMA_VERSION = "0.12";
12
+ /**
13
+ * Generation of the compiler-known runtime Type surface. It is deliberately
14
+ * not `VELAR_RUNTIME_SCHEMA_VERSION`: Type identity is shared by Core and every
15
+ * extension, including targets with no reactive runtime, so it moves on its own
16
+ * schedule. Bump it whenever the shape a registered Type presents changes, so
17
+ * two generations converge on two registries instead of one mixed one.
18
+ */
19
+ export const VELAR_TYPE_REGISTRY_VERSION = "1";
12
20
  /**
13
21
  * Global identity for compiler-known runtime Type objects. The registry is
14
22
  * separate from the reactive runtime schema because Type identity is shared by
15
- * Core and every extension, including targets with no Web runtime.
23
+ * Core and every extension, including targets with no Web runtime. The
24
+ * generation above is the key's trailing `v` component, so a bump renames the
25
+ * global slot rather than reusing a foreign generation's WeakSet.
26
+ */
27
+ export const VELAR_TYPE_REGISTRY_KEY = `velar.type.registry.v${VELAR_TYPE_REGISTRY_VERSION}`;
28
+ /**
29
+ * Generation of the Promise normalization cache. Independent of both versions
30
+ * above: it moves when the normalized identity a cached entry stands for
31
+ * changes. Bumping it gives the next generation its own WeakMap instead of
32
+ * letting whichever module loaded first hand its cached values to every other
33
+ * generation in the realm. Eviction is not part of this contract and must not
34
+ * be added — the cache is a WeakMap keyed by the source Promise, so an entry is
35
+ * released with the Promise it belongs to.
16
36
  */
17
- export const VELAR_TYPE_REGISTRY_KEY = "velar.type.registry.v1";
37
+ export const VELAR_PROMISE_NORMALIZATION_REGISTRY_VERSION = "1";
18
38
  /**
19
39
  * Global identity for Promise values already normalized at a checked
20
40
  * JavaScript boundary. Multiple generated modules must converge on one cache
21
41
  * without exposing it as a language-level registry.
22
42
  */
23
- export const VELAR_PROMISE_NORMALIZATION_REGISTRY_KEY = "velar.promise.normalization.v1";
43
+ export const VELAR_PROMISE_NORMALIZATION_REGISTRY_KEY = `velar.promise.normalization.v${VELAR_PROMISE_NORMALIZATION_REGISTRY_VERSION}`;
24
44
  //# sourceMappingURL=runtime-abi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-abi.js","sourceRoot":"","sources":["../src/runtime-abi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,gCAAgC,CAAC"}
1
+ {"version":3,"file":"runtime-abi.js","sourceRoot":"","sources":["../src/runtime-abi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,2BAA2B,EAAE,CAAC;AAE7F;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4CAA4C,GAAG,GAAG,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,wCAAwC,GACnD,gCAAgC,4CAA4C,EAAE,CAAC"}
@@ -12,6 +12,18 @@ export interface ForbiddenSourceIdentifierRule {
12
12
  * 'var' offers 'let' or 'const', which is the author's choice to make.
13
13
  */
14
14
  readonly fix: string | null;
15
+ /**
16
+ * D90 (compiler-front-9): the spelling is refused as a binding, a parameter
17
+ * and a type, but is an ordinary member name and record key. The charter's
18
+ * reserved-spelling paragraph already promises this of the words JavaScript
19
+ * reserves — external data and Web APIs do not need renamed fields — and
20
+ * `int` (velar/random owns `Random.int(...)`) and `with`
21
+ * (`Array.prototype.with`, `Temporal.PlainDate.prototype.with`, and every
22
+ * builder API spelled that way) are the two rules here that answer to it.
23
+ * Execution-capability spellings such as `eval` deliberately do not: the
24
+ * charter keeps them unavailable through direct member syntax.
25
+ */
26
+ readonly memberLegal: boolean;
15
27
  }
16
28
  /**
17
29
  * Source spellings rejected before they can acquire ordinary VelarScript
@@ -29,4 +41,18 @@ export declare function memberNameRestriction(name: string, owner: "class" | "en
29
41
  export declare function isCoreReservedBinding(name: string): boolean;
30
42
  export declare function isJavaScriptReservedBinding(name: string): boolean;
31
43
  export declare function isForbiddenPrototypeMember(name: string): boolean;
44
+ /**
45
+ * D90 (compiler-front-15): whether a name standing between `<` and `>` is
46
+ * evidence that the pair is a type argument list rather than a comparison.
47
+ * `<` and `>` are comparison operators everywhere the grammar can tell, so the
48
+ * only names that tip the reading are the ones a type argument list is made of:
49
+ * a builtin type spelling, or a capitalized name, which is how VelarScript
50
+ * writes every type it declares.
51
+ *
52
+ * Two readers ask this question and both must answer it identically — the
53
+ * parser, deciding which grammar `Map<string, number>()` is, and the formatter,
54
+ * deciding whether to space those brackets as operators. When they disagreed,
55
+ * `velar format` rewrote the line into the spelling of the *other* reading.
56
+ */
57
+ export declare function isTypeEvidenceName(value: string): boolean;
32
58
  //# sourceMappingURL=source-names.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-names.d.ts","sourceRoot":"","sources":["../src/source-names.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,IAAI,CAAC;IAC1F;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAUD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAcxF,CAAC;AA6BH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AACzH,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAExG,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM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,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AACzH,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAExG,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,yBAAyB,GAAE,WAAW,CAAC,MAAM,CAAa,GACzD,sBAAsB,GAAG,IAAI,CAW/B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAUlH;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIzD"}
@@ -1,8 +1,8 @@
1
1
  import { CORE_VOCABULARY_NAMES } from "./core-vocabulary.js";
2
2
  import { VELAR_HOST_ERROR_NAMES } from "./error-runtime.js";
3
3
  import { keywordKinds } from "./token.js";
4
- function forbidden(guidance, recovery, fix = null) {
5
- return { guidance, recovery, fix };
4
+ function forbidden(guidance, recovery, fix = null, memberLegal = false) {
5
+ return { guidance, recovery, fix, memberLegal };
6
6
  }
7
7
  /**
8
8
  * Source spellings rejected before they can acquire ordinary VelarScript
@@ -17,12 +17,30 @@ export const forbiddenSourceIdentifiers = new Map([
17
17
  ["True", forbidden("Use 'true'; VelarScript keywords are lowercase", [{ kind: "true", value: "true" }], "true")],
18
18
  ["False", forbidden("Use 'false'; VelarScript keywords are lowercase", [{ kind: "false", value: "false" }], "false")],
19
19
  ["elif", forbidden("Use 'else if'; VelarScript keeps ordinary readable if chains", [{ kind: "else", value: "else" }, { kind: "if", value: "if" }], "else if")],
20
- ["int", forbidden("Use 'number'; VelarScript has one JavaScript numeric type", [{ kind: "identifier", value: "number" }], "number")],
20
+ ["int", forbidden("Use 'number'; VelarScript has one JavaScript numeric type", [{ kind: "identifier", value: "number" }], "number", true)],
21
21
  ["float", forbidden("Use 'number'; VelarScript has one JavaScript numeric type", [{ kind: "identifier", value: "number" }], "number")],
22
22
  ["switch", forbidden("Use 'match' for strict pattern dispatch", [{ kind: "identifier", value: "match" }], "match")],
23
23
  ["this", forbidden("Use explicit 'self' inside methods; VelarScript does not expose dynamic 'this'", [{ kind: "identifier", value: "self" }], "self")],
24
24
  ["new", forbidden("Call a class directly; VelarScript does not expose 'new'", [], "")], ["eval", forbidden("VelarScript does not expose 'eval'", null)],
25
- ["with", forbidden("Use a record spread such as '{...value, field: next}' to build an updated record; VelarScript does not expose 'with'", null)],
25
+ // D89 (message correction): the author who writes 'with' is writing Python's
26
+ // context manager, not a record update. 'using name = expression' owns the
27
+ // value and releases it when the scope ends, which is the whole of what
28
+ // 'with X as y:' does.
29
+ // D90 (compiler-front-9): the ban is on the infix record-update spelling and
30
+ // on any binding named 'with'. `value.with(...)`, `{with: 1}` and a member
31
+ // declared `with` are ordinary code, so `Array.prototype.with` and the
32
+ // builder APIs spelled that way stay callable.
33
+ ["with", forbidden("Use 'using name = expression'; it owns the value and releases it when the scope ends, and VelarScript does not expose 'with'", null, null, true)],
34
+ // D90 (coherence): the last Python statement reflex in this curated list.
35
+ // `const f = lambda x: x` used to land on the newline diagnostic — a
36
+ // sentence about statement layout for a spelling that is simply the wrong
37
+ // word. It carries no fix: rewriting `lambda x: x` into `x => x` means
38
+ // reading the parameter list and the colon, which is judgment rather than a
39
+ // mechanical substitution, and a fix that guesses is worse than none.
40
+ // `memberLegal` for the same reason `int` carries it: a rate or a
41
+ // regularization weight arrives from external data spelled `lambda`, and a
42
+ // record key is never the Python statement.
43
+ ["lambda", forbidden("Use an arrow — 'value => expression'; VelarScript does not expose 'lambda'", null, null, true)],
26
44
  ]);
27
45
  const coreReservedBindings = new Set([
28
46
  // D57 rule 135: Core's own vocabulary is *derived* from its roster, never
@@ -79,7 +97,10 @@ export function bindingNameRestriction(name, extensionReservedBindings = new Set
79
97
  export function memberNameRestriction(name, owner) {
80
98
  if (!isValidSourceIdentifier(name))
81
99
  return "invalid";
82
- if (forbiddenSourceIdentifiers.has(name))
100
+ // A rule that is legal in member position declares as well as it reads:
101
+ // refusing `def with(...)` while accepting `q.with(...)` would leave an
102
+ // extern declaration unable to describe the API it is there to describe.
103
+ if (forbiddenSourceIdentifiers.get(name)?.memberLegal === false)
83
104
  return "source";
84
105
  if (forbiddenPrototypeMembers.has(name))
85
106
  return "prototype";
@@ -98,4 +119,27 @@ export function isJavaScriptReservedBinding(name) {
98
119
  export function isForbiddenPrototypeMember(name) {
99
120
  return forbiddenPrototypeMembers.has(name);
100
121
  }
122
+ /**
123
+ * D90 (compiler-front-15): whether a name standing between `<` and `>` is
124
+ * evidence that the pair is a type argument list rather than a comparison.
125
+ * `<` and `>` are comparison operators everywhere the grammar can tell, so the
126
+ * only names that tip the reading are the ones a type argument list is made of:
127
+ * a builtin type spelling, or a capitalized name, which is how VelarScript
128
+ * writes every type it declares.
129
+ *
130
+ * Two readers ask this question and both must answer it identically — the
131
+ * parser, deciding which grammar `Map<string, number>()` is, and the formatter,
132
+ * deciding whether to space those brackets as operators. When they disagreed,
133
+ * `velar format` rewrote the line into the spelling of the *other* reading.
134
+ */
135
+ export function isTypeEvidenceName(value) {
136
+ if (builtinTypeEvidenceNames.has(value))
137
+ return true;
138
+ const first = value[0] ?? "";
139
+ return first >= "A" && first <= "Z";
140
+ }
141
+ const builtinTypeEvidenceNames = new Set([
142
+ "string", "number", "bool", "null", "unknown", "any",
143
+ "List", "Set", "Map", "Record", "Promise", "Function", "Type", "readonly",
144
+ ]);
101
145
  //# sourceMappingURL=source-names.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-names.js","sourceRoot":"","sources":["../src/source-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAkB,MAAM,YAAY,CAAC;AAc1D,SAAS,SAAS,CAChB,QAAgB,EAChB,QAAmD,EACnD,GAAG,GAAkB,IAAI;IAEzB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAuD,IAAI,GAAG,CAAC;IACpG,CAAC,KAAK,EAAE,SAAS,CAAC,yDAAyD,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC9G,CAAC,WAAW,EAAE,SAAS,CAAC,qDAAqD,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1H,CAAC,MAAM,EAAE,SAAS,CAAC,kEAAkE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAClI,CAAC,MAAM,EAAE,SAAS,CAAC,+DAA+D,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/H,CAAC,MAAM,EAAE,SAAS,CAA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M,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,GAAG,CAAC;AACtC,CAAC;AAED,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IACvC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK;IACpD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU;CAC1E,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,CAErD;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAEvC,YAAY,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,UAAO,EAexD;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAoBvC;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa7B;CACF;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAErD"}
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,CAErD;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAEvC,YAAY,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,UAAO,EAexD;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAoBvC;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyB7B;CACF;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAErD"}
package/dist/source.js CHANGED
@@ -48,6 +48,19 @@ export class SourceText {
48
48
  if (start === undefined) {
49
49
  return "";
50
50
  }
51
+ const nextStart = this.lineStarts[line];
52
+ if (nextStart !== undefined) {
53
+ // The index already holds where the next line begins, so the terminator
54
+ // is the one or two characters in front of it. Searching for it again
55
+ // makes every diagnostic render scan the rest of the file, because
56
+ // `indexOf("\r")` on a text with no carriage return never stops early.
57
+ let end = nextStart - 1;
58
+ if (this.text[end] === "\n" && this.text[end - 1] === "\r")
59
+ end -= 1;
60
+ return this.text.slice(start, end);
61
+ }
62
+ // The last line has no successor to bound it, and an unindexed SourceText
63
+ // has no successors at all; both scan, and both stop inside their own line.
51
64
  const carriageReturn = this.text.indexOf("\r", start);
52
65
  const lineFeed = this.text.indexOf("\n", start);
53
66
  const end = carriageReturn === -1
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,YAAY,CAAC,UAAgB;IAC3C,OAAO,GAAG,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;AACjD,CAAC;AAOD,MAAM,OAAO,UAAU;IACZ,IAAI,CAAS;IACb,IAAI,CAAS;IACb,UAAU,CAAoB;IAEvC,YAAY,IAAY,EAAE,IAAY,EAAE,UAAU,GAAG,IAAI;QACvD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACnB,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;gBACpD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;oBACzB,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI;wBAAE,KAAK,IAAI,CAAC,CAAC;oBACzC,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBACzB,CAAC;qBAAM,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;oBAChC,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;QACH,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;IAC3B,CAAC;IAED,QAAQ,CAAC,MAAc;QACrB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC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EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;CACF;AAED,MAAM,UAAU,IAAI,CAAC,KAAa,EAAE,GAAW;IAC7C,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * UTF-16 code-unit order — what `<` and `>` compare, and what
3
+ * `Array.prototype.sort` gives with no comparator. It differs from true code
4
+ * point order only for astral characters, and it is deliberately this order
5
+ * rather than that one, so a producer agrees with any consumer that reorders
6
+ * the same names with a bare `.sort()`.
7
+ *
8
+ * D90 R3(a) rules the locale dependence out at the root: `localeCompare`
9
+ * follows the collation the process environment selects, so any list ordered
10
+ * with it reorders when the machine's `LC_ALL` changes. Core orders two lists
11
+ * this way — a Runtime Type's metadata entries, which decide a type identity
12
+ * string, and the diagnostic tiebreaker, which decides what a reader sees
13
+ * first — and neither may move with the environment.
14
+ */
15
+ export declare function byCodeUnit(left: string, right: string): number;
16
+ //# sourceMappingURL=stable-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stable-order.d.ts","sourceRoot":"","sources":["../src/stable-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * UTF-16 code-unit order — what `<` and `>` compare, and what
3
+ * `Array.prototype.sort` gives with no comparator. It differs from true code
4
+ * point order only for astral characters, and it is deliberately this order
5
+ * rather than that one, so a producer agrees with any consumer that reorders
6
+ * the same names with a bare `.sort()`.
7
+ *
8
+ * D90 R3(a) rules the locale dependence out at the root: `localeCompare`
9
+ * follows the collation the process environment selects, so any list ordered
10
+ * with it reorders when the machine's `LC_ALL` changes. Core orders two lists
11
+ * this way — a Runtime Type's metadata entries, which decide a type identity
12
+ * string, and the diagnostic tiebreaker, which decides what a reader sees
13
+ * first — and neither may move with the environment.
14
+ */
15
+ export function byCodeUnit(left, right) {
16
+ return left < right ? -1 : left > right ? 1 : 0;
17
+ }
18
+ //# sourceMappingURL=stable-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stable-order.js","sourceRoot":"","sources":["../src/stable-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,KAAa;IACpD,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"text-runtime.d.ts","sourceRoot":"","sources":["../src/text-runtime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,QA2RzB,CAAC"}
1
+ {"version":3,"file":"text-runtime.d.ts","sourceRoot":"","sources":["../src/text-runtime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,QAwazB,CAAC"}