eliscript 0.0.4 → 0.1.1
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/README.md +9 -8
- package/bootstrap/compiler/emitter.eli +161 -63
- package/bootstrap/host/check-cli.mjs +0 -1
- package/bootstrap/host/check-cli.mjs.map +1 -1
- package/bootstrap/host/compiler-session.eli +2 -1
- package/bootstrap/host/eliscript-cli.mjs +2 -9
- package/bootstrap/host/eliscript-cli.mjs.map +1 -1
- package/bootstrap/host/project-cli.mjs +1 -11
- package/bootstrap/host/project-cli.mjs.map +1 -1
- package/bootstrap/host/project.mjs +2 -8
- package/bootstrap/host/project.mjs.map +1 -1
- package/browser/README.md +1 -1
- package/compiler/README.md +2 -2
- package/compiler/eliscript-emitter.el +229 -85
- package/compiler/eliscript-ir-emitter.el +64 -34
- package/compiler/eliscript-project.el +20 -5
- package/dist/backends/async.mjs +1 -90
- package/dist/backends/async.mjs.map +1 -1
- package/dist/backends/binary.mjs +1 -91
- package/dist/backends/binary.mjs.map +1 -1
- package/dist/backends/capabilities.mjs +1 -90
- package/dist/backends/capabilities.mjs.map +1 -1
- package/dist/backends/elf.mjs +1 -90
- package/dist/backends/elf.mjs.map +1 -1
- package/dist/backends/managed.mjs +1 -94
- package/dist/backends/managed.mjs.map +1 -1
- package/dist/backends/memory.mjs +1 -90
- package/dist/backends/memory.mjs.map +1 -1
- package/dist/backends/native.mjs +1 -91
- package/dist/backends/native.mjs.map +1 -1
- package/dist/backends/numeric.mjs +1 -90
- package/dist/backends/numeric.mjs.map +1 -1
- package/dist/backends/optimize.mjs +1 -90
- package/dist/backends/optimize.mjs.map +1 -1
- package/dist/backends/regexp.mjs +1 -91
- package/dist/backends/regexp.mjs.map +1 -1
- package/dist/backends/sha256.mjs +2 -96
- package/dist/backends/sha256.mjs.map +1 -1
- package/dist/backends/wasm.mjs +1 -90
- package/dist/backends/wasm.mjs.map +1 -1
- package/dist/bootstrap/analyzer.mjs +1 -95
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +1 -105
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +848 -807
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +1 -96
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/formatter.mjs +1 -104
- package/dist/bootstrap/formatter.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +18 -172
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/lower.mjs +1 -92
- package/dist/bootstrap/lower.mjs.map +1 -1
- package/dist/bootstrap/project.mjs +23 -209
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +1 -96
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/source-map.mjs +7 -112
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/symbol.mjs +7 -114
- package/dist/bootstrap/symbol.mjs.map +1 -1
- package/dist/bootstrap/syntax.mjs +10 -176
- package/dist/bootstrap/syntax.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +1 -93
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +105 -104
- package/dist/browser/loader.js +1 -1
- package/dist/browser/loader.mjs +5 -124
- package/dist/compiler-artifact.json +1 -1
- package/dist/host/compiler-session.mjs +205 -297
- package/dist/host/compiler-session.mjs.map +1 -1
- package/dist/host/compiler-tools.mjs +1 -91
- package/dist/host/compiler-tools.mjs.map +1 -1
- package/dist/literal-sources/runtime/core/order.eli +32 -10
- package/dist/literal-sources/runtime/core/sequence.eli +69 -28
- package/dist/literal-sources/runtime/core/vector.eli +2 -4
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +5 -5
- package/dist/literal-sources/stdlib/managed-literals.eli +1 -1
- package/dist/package.json +1 -0
- package/dist/runtime/math.mjs +62 -252
- package/dist/runtime/math.mjs.map +1 -1
- package/dist/runtime/prelude.mjs +95 -0
- package/dist/runtime/prelude.mjs.macro-origins.json +1 -0
- package/dist/runtime/prelude.mjs.map +1 -0
- package/dist/runtime/unicode-case-data.mjs +1 -95
- package/dist/runtime/unicode-case-data.mjs.map +1 -1
- package/dist/runtime/unicode-case.mjs +3 -97
- package/dist/runtime/unicode-case.mjs.map +1 -1
- package/dist/stage3-release.json +1 -1
- package/editor/README.md +9 -4
- package/editor/eliscript-abi.el +170 -0
- package/editor/eliscript-async.el +375 -0
- package/editor/eliscript-bind.el +822 -0
- package/editor/eliscript-compat.el +346 -0
- package/editor/eliscript-contract.el +334 -0
- package/editor/eliscript-data.el +1544 -0
- package/editor/eliscript-js.el +318 -0
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-module.el +340 -0
- package/editor/eliscript-repl.el +1 -1
- package/package.json +4 -1
- package/runtime/README.md +21 -1
- package/runtime/core/protocol-impl.mjs +1 -115
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/text-impl.mjs +1 -90
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/vector.eli +1 -1
- package/runtime/core/vector.mjs +0 -9
- package/runtime/emacs-compat.eli +5957 -0
- package/runtime/emacs-compat.mjs +13734 -0
- package/runtime/emacs-compat.mjs.map +1 -0
- package/runtime/math.mjs +62 -252
- package/runtime/math.mjs.map +1 -1
- package/runtime/prelude.eli +4 -0
- package/runtime/prelude.mjs +95 -0
- package/runtime/prelude.mjs.map +1 -0
- package/runtime/unicode-case-data.mjs +1 -95
- package/runtime/unicode-case-data.mjs.map +1 -1
- package/runtime/unicode-case.mjs +3 -97
- package/runtime/unicode-case.mjs.map +1 -1
- package/stdlib/managed-literals.eli +1 -1
- package/stdlib/managed-runtime-vector.eli +2 -4
- package/tools/backends/compiler-build.mjs +3 -93
- package/tools/backends/compiler-cli.mjs +2 -15
- package/tools/backends/compiler-corpus-bit.mjs +2 -95
- package/tools/backends/compiler-corpus-cli-adapters.mjs +1 -97
- package/tools/backends/compiler-corpus-debugging.mjs +2 -95
- package/tools/backends/compiler-corpus-emitter.mjs +1 -97
- package/tools/backends/compiler-corpus-execution.mjs +2 -108
- package/tools/backends/compiler-corpus-fuzz.mjs +2 -95
- package/tools/backends/compiler-corpus-host-context.mjs +2 -99
- package/tools/backends/compiler-corpus-identity-host.mjs +18 -123
- package/tools/backends/compiler-corpus-identity-value-adapters.mjs +0 -9
- package/tools/backends/compiler-corpus-literal-provider.mjs +1 -91
- package/tools/backends/compiler-corpus-managed-adapters.mjs +1 -99
- package/tools/backends/compiler-corpus-managed-fixtures.mjs +2 -113
- package/tools/backends/compiler-corpus-matchers.mjs +3 -106
- package/tools/backends/compiler-corpus-original-program.mjs +1 -91
- package/tools/backends/compiler-corpus-process.mjs +1 -92
- package/tools/backends/compiler-corpus-program-driver.mjs +1 -3
- package/tools/backends/compiler-corpus-project-adapters.mjs +1 -95
- package/tools/backends/compiler-corpus-project-entry-host.mjs +2 -92
- package/tools/backends/compiler-corpus-project-transport.mjs +1 -90
- package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1 -91
- package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1 -92
- package/tools/backends/compiler-corpus-raw-math-fixture.mjs +1 -91
- package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +1 -91
- package/tools/backends/compiler-corpus-reference.mjs +1 -90
- package/tools/backends/compiler-corpus-runtime-adapters.mjs +2 -110
- package/tools/backends/compiler-corpus-tools-cli.mjs +1 -95
- package/tools/backends/compiler-corpus-tools-reference.mjs +22 -163
- package/tools/backends/compiler-corpus.mjs +3 -125
- package/tools/backends/compiler-matrix.mjs +1 -92
- package/tools/backends/compiler-package-browser.mjs +1 -90
- package/tools/backends/compiler-package.mjs +3 -95
- package/tools/backends/compiler-unicode-profile-host.mjs +1 -91
- package/tools/backends/dist/bootstrap-js-stages.mjs +1 -91
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs +1 -91
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
- package/tools/backends/dist/record-grid.mjs +1 -91
- package/tools/backends/dist/record-grid.mjs.map +1 -1
- package/tools/backends/dist/release-cli.mjs +4 -94
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/dist/run-artifact.mjs +1 -91
- package/tools/backends/dist/run-artifact.mjs.map +1 -1
- package/tools/backends/eliscript/compiler-corpus-bit.eli +1 -0
- package/tools/backends/managed-foreign-binding.mjs +1 -95
- package/tools/backends/managed-host-lifecycle.mjs +1 -91
- package/tools/backends/managed-host-object-provider.mjs +18 -59
- package/tools/backends/managed-host-object-realm.mjs +1 -91
- package/tools/backends/managed-host-proxy.mjs +9 -18
- package/tools/backends/managed-host-runtime.mjs +3 -105
- package/tools/backends/managed-host.mjs +1 -104
- package/tools/backends/managed-module-graph.mjs +1 -97
- package/tools/backends/managed-runtime.mjs +1 -96
- package/tools/backends/managed-source-view.mjs +13 -108
- package/tools/backends/native-managed-runtime.mjs +1 -91
- package/tools/backends/native-memory.mjs +1 -91
- package/tools/backends/stage3-targets.mjs +1 -91
- package/tools/bootstrap-runtime.el +3 -2
- package/tools/project/project.eli +1 -1
- package/tools/testing/stdlib-bit-corpus-host.mjs +1 -90
- package/tools/testing/stdlib-bit.mjs +1 -90
- package/dist/bootstrap/package.json +0 -1
- package/dist/bootstrap/runtime/math.mjs +0 -1117
- package/dist/bootstrap/runtime/math.mjs.map +0 -1
- package/dist/bootstrap/runtime/unicode-case-data.mjs +0 -10125
- package/dist/bootstrap/runtime/unicode-case-data.mjs.map +0 -1
- package/dist/bootstrap/runtime/unicode-case.mjs +0 -281
- package/dist/bootstrap/runtime/unicode-case.mjs.map +0 -1
|
@@ -2,99 +2,9 @@
|
|
|
2
2
|
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
3
|
var __eliscript_tdz_ready_0;
|
|
4
4
|
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("format"); return format; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("format"); return __eliscript_const_error(); }
|
|
6
5
|
import "eliscript/runtime/unicode-case.mjs";
|
|
6
|
+
import { __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
7
7
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
8
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
9
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
10
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
11
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
12
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
13
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
14
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
15
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
16
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
17
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
18
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
19
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
20
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
21
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
22
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
23
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
24
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
25
|
-
}
|
|
26
|
-
for (let index = 0; index < 2; index++) {
|
|
27
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
28
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
29
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
30
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
34
|
-
};
|
|
35
|
-
const __eliscript_to_number = (value) => {
|
|
36
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
37
|
-
if (typeof primitive === "string") {
|
|
38
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
39
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
40
|
-
let first = 2;
|
|
41
|
-
while (first < text.length && text[first] === "0") first++;
|
|
42
|
-
if (first === text.length) return 0;
|
|
43
|
-
const prefix = text[1];
|
|
44
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
45
|
-
if (text.length - first > limit) return 1 / 0;
|
|
46
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
47
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return __eliscript_number_intrinsic(primitive);
|
|
51
|
-
};
|
|
52
|
-
const __eliscript_numeric = (value) => {
|
|
53
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
54
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
55
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
56
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
57
|
-
};
|
|
58
|
-
const __eliscript_implicit_number = (value) => {
|
|
59
|
-
if (typeof value === "number") return value;
|
|
60
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
61
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
62
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
63
|
-
};
|
|
64
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
65
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
66
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
67
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
68
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
69
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
70
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
71
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
72
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
73
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
74
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
75
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
76
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
77
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
78
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
79
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
80
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
81
|
-
if (operator === "<") return left < right;
|
|
82
|
-
if (operator === "<=") return left <= right;
|
|
83
|
-
if (operator === ">") return left > right;
|
|
84
|
-
return left >= right;
|
|
85
|
-
}
|
|
86
|
-
let a = __eliscript_numeric_primitive(left);
|
|
87
|
-
let b = __eliscript_numeric_primitive(right);
|
|
88
|
-
const x = typeof a, y = typeof b;
|
|
89
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
90
|
-
a = __eliscript_numeric(a);
|
|
91
|
-
b = __eliscript_numeric(b);
|
|
92
|
-
}
|
|
93
|
-
if (operator === "<") return a < b;
|
|
94
|
-
if (operator === "<=") return a <= b;
|
|
95
|
-
if (operator === ">") return a > b;
|
|
96
|
-
return a >= b;
|
|
97
|
-
};
|
|
98
8
|
|
|
99
9
|
import {readFile, readdir, realpath} from "node:fs/promises";
|
|
100
10
|
import {resolve} from "node:path";
|
|
@@ -2,122 +2,24 @@
|
|
|
2
2
|
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
3
|
var __eliscript_tdz_ready_0;
|
|
4
4
|
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("observation_counts"); return observation_counts; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("observation_counts"); return __eliscript_const_error(); }
|
|
6
5
|
var __eliscript_tdz_ready_1;
|
|
7
6
|
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("suite"); return suite; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("suite"); return __eliscript_const_error(); }
|
|
9
7
|
var __eliscript_tdz_ready_2;
|
|
10
8
|
function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("retained"); return retained; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("retained"); return __eliscript_const_error(); }
|
|
12
9
|
var __eliscript_tdz_ready_3;
|
|
13
10
|
function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("maintained"); return maintained; }
|
|
14
|
-
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("maintained"); return __eliscript_const_error(); }
|
|
15
11
|
var __eliscript_tdz_ready_4;
|
|
16
12
|
function __eliscript_tdz_read_4() { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("fixture"); return fixture; }
|
|
17
|
-
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("fixture"); return __eliscript_const_error(); }
|
|
18
13
|
var __eliscript_tdz_ready_5;
|
|
19
14
|
function __eliscript_tdz_read_5() { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("identity_host"); return identity_host; }
|
|
20
|
-
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("identity_host"); return __eliscript_const_error(); }
|
|
21
15
|
var __eliscript_tdz_ready_6;
|
|
22
16
|
function __eliscript_tdz_read_6() { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("transient_fixture"); return transient_fixture; }
|
|
23
|
-
function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("transient_fixture"); return __eliscript_const_error(); }
|
|
24
17
|
var __eliscript_tdz_ready_7;
|
|
25
18
|
function __eliscript_tdz_read_7() { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("transient_transports"); return transient_transports; }
|
|
26
|
-
function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("transient_transports"); return __eliscript_const_error(); }
|
|
27
19
|
import "eliscript/runtime/unicode-case.mjs";
|
|
28
|
-
import {
|
|
20
|
+
import { __eliscript_at, __eliscript_at_direct, __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
29
21
|
import { hashMap as __eliscript_hash_map, hashSet as __eliscript_hash_set, keyword as __eliscript_keyword, list as __eliscript_list, queue as __eliscript_queue, symbol as __eliscript_symbol, vector as __eliscript_vector } from "eliscript/runtime/literals.mjs";
|
|
30
22
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
31
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
32
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
33
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
34
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
35
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
36
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
37
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
38
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
39
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
40
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
41
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
42
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
43
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
44
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
45
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
46
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
47
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
48
|
-
}
|
|
49
|
-
for (let index = 0; index < 2; index++) {
|
|
50
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
51
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
52
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
53
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
57
|
-
};
|
|
58
|
-
const __eliscript_to_number = (value) => {
|
|
59
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
60
|
-
if (typeof primitive === "string") {
|
|
61
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
62
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
63
|
-
let first = 2;
|
|
64
|
-
while (first < text.length && text[first] === "0") first++;
|
|
65
|
-
if (first === text.length) return 0;
|
|
66
|
-
const prefix = text[1];
|
|
67
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
68
|
-
if (text.length - first > limit) return 1 / 0;
|
|
69
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
70
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return __eliscript_number_intrinsic(primitive);
|
|
74
|
-
};
|
|
75
|
-
const __eliscript_numeric = (value) => {
|
|
76
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
77
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
78
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
79
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
80
|
-
};
|
|
81
|
-
const __eliscript_implicit_number = (value) => {
|
|
82
|
-
if (typeof value === "number") return value;
|
|
83
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
84
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
85
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
86
|
-
};
|
|
87
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
88
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
89
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
90
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
91
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
92
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
93
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
94
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
95
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
96
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
97
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
98
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
99
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
100
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
101
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
102
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
103
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
104
|
-
if (operator === "<") return left < right;
|
|
105
|
-
if (operator === "<=") return left <= right;
|
|
106
|
-
if (operator === ">") return left > right;
|
|
107
|
-
return left >= right;
|
|
108
|
-
}
|
|
109
|
-
let a = __eliscript_numeric_primitive(left);
|
|
110
|
-
let b = __eliscript_numeric_primitive(right);
|
|
111
|
-
const x = typeof a, y = typeof b;
|
|
112
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
113
|
-
a = __eliscript_numeric(a);
|
|
114
|
-
b = __eliscript_numeric(b);
|
|
115
|
-
}
|
|
116
|
-
if (operator === "<") return a < b;
|
|
117
|
-
if (operator === "<=") return a <= b;
|
|
118
|
-
if (operator === ">") return a > b;
|
|
119
|
-
return a >= b;
|
|
120
|
-
};
|
|
121
23
|
|
|
122
24
|
import {createHash} from "node:crypto";
|
|
123
25
|
import {Buffer} from "node:buffer";
|
|
@@ -1,134 +1,26 @@
|
|
|
1
1
|
// Generated by Eliscript. Do not edit.
|
|
2
2
|
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
|
-
var __eliscript_tdz_ready_0;
|
|
4
|
-
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("readOriginalManagedStaticTemplate"); return readOriginalManagedStaticTemplate; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("readOriginalManagedStaticTemplate"); return __eliscript_const_error(); }
|
|
6
|
-
var __eliscript_tdz_ready_1;
|
|
7
|
-
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("buildBackends"); return buildBackends; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("buildBackends"); return __eliscript_const_error(); }
|
|
9
|
-
var __eliscript_tdz_ready_2;
|
|
10
|
-
function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("bindOriginalManagedSourceEvidence"); return bindOriginalManagedSourceEvidence; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("bindOriginalManagedSourceEvidence"); return __eliscript_const_error(); }
|
|
12
3
|
var __eliscript_tdz_ready_3;
|
|
13
4
|
function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("entry_fixture"); return entry_fixture; }
|
|
14
|
-
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("entry_fixture"); return __eliscript_const_error(); }
|
|
15
5
|
var __eliscript_tdz_ready_4;
|
|
16
6
|
function __eliscript_tdz_read_4() { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("state_fixture"); return state_fixture; }
|
|
17
|
-
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("state_fixture"); return __eliscript_const_error(); }
|
|
18
7
|
var __eliscript_tdz_ready_5;
|
|
19
8
|
function __eliscript_tdz_read_5() { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("host_source_file"); return host_source_file; }
|
|
20
|
-
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("host_source_file"); return __eliscript_const_error(); }
|
|
21
9
|
var __eliscript_tdz_ready_6;
|
|
22
10
|
function __eliscript_tdz_read_6() { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("host_bridge_files"); return host_bridge_files; }
|
|
23
|
-
function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("host_bridge_files"); return __eliscript_const_error(); }
|
|
24
11
|
var __eliscript_tdz_ready_7;
|
|
25
12
|
function __eliscript_tdz_read_7() { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("browser_suite_plans"); return browser_suite_plans; }
|
|
26
|
-
function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("browser_suite_plans"); return __eliscript_const_error(); }
|
|
27
13
|
var __eliscript_tdz_ready_8;
|
|
28
14
|
function __eliscript_tdz_read_8() { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("final_fixture_plans"); return final_fixture_plans; }
|
|
29
|
-
function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("final_fixture_plans"); return __eliscript_const_error(); }
|
|
30
15
|
var __eliscript_tdz_ready_9;
|
|
31
16
|
function __eliscript_tdz_read_9() { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("raw_basic_families"); return raw_basic_families; }
|
|
32
|
-
function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("raw_basic_families"); return __eliscript_const_error(); }
|
|
33
17
|
var __eliscript_tdz_ready_10;
|
|
34
18
|
function __eliscript_tdz_read_10() { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("raw_special_families"); return raw_special_families; }
|
|
35
|
-
function __eliscript_tdz_write_10(__eliscript_tdz_value_10) { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("raw_special_families"); return __eliscript_const_error(); }
|
|
36
19
|
var __eliscript_tdz_ready_11;
|
|
37
20
|
function __eliscript_tdz_read_11() { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("raw_language_families"); return raw_language_families; }
|
|
38
|
-
function __eliscript_tdz_write_11(__eliscript_tdz_value_11) { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("raw_language_families"); return __eliscript_const_error(); }
|
|
39
21
|
import "eliscript/runtime/unicode-case.mjs";
|
|
40
|
-
import {
|
|
22
|
+
import { __eliscript_at, __eliscript_at_direct, __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
41
23
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
42
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
43
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
44
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
45
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
46
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
47
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
48
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
49
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
50
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
51
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
52
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
53
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
54
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
55
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
56
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
57
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
58
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
59
|
-
}
|
|
60
|
-
for (let index = 0; index < 2; index++) {
|
|
61
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
62
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
63
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
64
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
68
|
-
};
|
|
69
|
-
const __eliscript_to_number = (value) => {
|
|
70
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
71
|
-
if (typeof primitive === "string") {
|
|
72
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
73
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
74
|
-
let first = 2;
|
|
75
|
-
while (first < text.length && text[first] === "0") first++;
|
|
76
|
-
if (first === text.length) return 0;
|
|
77
|
-
const prefix = text[1];
|
|
78
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
79
|
-
if (text.length - first > limit) return 1 / 0;
|
|
80
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
81
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return __eliscript_number_intrinsic(primitive);
|
|
85
|
-
};
|
|
86
|
-
const __eliscript_numeric = (value) => {
|
|
87
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
88
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
89
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
90
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
91
|
-
};
|
|
92
|
-
const __eliscript_implicit_number = (value) => {
|
|
93
|
-
if (typeof value === "number") return value;
|
|
94
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
95
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
96
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
97
|
-
};
|
|
98
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
99
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
100
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
101
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
102
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
103
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
104
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
105
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
106
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
107
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
108
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
109
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
110
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
111
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
112
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
113
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
114
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
115
|
-
if (operator === "<") return left < right;
|
|
116
|
-
if (operator === "<=") return left <= right;
|
|
117
|
-
if (operator === ">") return left > right;
|
|
118
|
-
return left >= right;
|
|
119
|
-
}
|
|
120
|
-
let a = __eliscript_numeric_primitive(left);
|
|
121
|
-
let b = __eliscript_numeric_primitive(right);
|
|
122
|
-
const x = typeof a, y = typeof b;
|
|
123
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
124
|
-
a = __eliscript_numeric(a);
|
|
125
|
-
b = __eliscript_numeric(b);
|
|
126
|
-
}
|
|
127
|
-
if (operator === "<") return a < b;
|
|
128
|
-
if (operator === "<=") return a <= b;
|
|
129
|
-
if (operator === ">") return a > b;
|
|
130
|
-
return a >= b;
|
|
131
|
-
};
|
|
132
24
|
|
|
133
25
|
import {createHash} from "node:crypto";
|
|
134
26
|
import {Buffer} from "node:buffer";
|
|
@@ -141,11 +33,8 @@ import {originalSourceCaseLocators} from "./compiler-corpus-managed-cases.mjs";
|
|
|
141
33
|
import {originalManagedProgramCompletionSource} from "./compiler-corpus-managed-adapters.mjs";
|
|
142
34
|
import {readOriginalProcessHostDependency, bindOriginalProcessHostDependency} from "./compiler-corpus-process.mjs";
|
|
143
35
|
const readOriginalManagedStaticTemplate = (legacy)["readOriginalManagedStaticTemplate"];
|
|
144
|
-
__eliscript_tdz_ready_0 = true;
|
|
145
36
|
const buildBackends = (legacy)["buildBackends"];
|
|
146
|
-
__eliscript_tdz_ready_1 = true;
|
|
147
37
|
const bindOriginalManagedSourceEvidence = (legacy)["bindOriginalManagedSourceEvidence"];
|
|
148
|
-
__eliscript_tdz_ready_2 = true;
|
|
149
38
|
const entry_fixture = "tests/fixtures/wasm-managed-project-entry.eli";
|
|
150
39
|
__eliscript_tdz_ready_3 = true;
|
|
151
40
|
const state_fixture = "tests/fixtures/wasm-managed-project-state.eli";
|
|
@@ -850,7 +739,7 @@ async function readOriginalManagedFixtureRepairs(options) {
|
|
|
850
739
|
return null;
|
|
851
740
|
})());
|
|
852
741
|
return ({"sourceAssets": assets, "suites": suites, "execution": "complete-original-final-make-gates", "targetExecution": false});
|
|
853
|
-
})([], [], [["tests/wasm-managed-empty-bindings.test.mjs", "ecb157620b2a55b24962c2528dd81c3b3bfc71ba71b052a33a80cba2e59f639f"], ["tests/wasm-managed-callables.test.mjs", "b0b3137803b84d454a5b389b2616676f15f43d70d666bf617babd4d730e934ef"], ["tests/wasm-managed-realm-lifetime.test.mjs", "3e8722afe234131cf927c7999a52c4911a79aaeb233ce4177be5cb1d9e2feb6b"], ["tests/wasm-managed-native-prototype-callables.test.mjs", "768fcb829e7ef01dad76520eeed9b0c10a20d89440da7bbd48cfcf21c23bea4e"], ["tests/wasm-managed-str.test.mjs", "94bfa646c922c1c87ea9bf5e7c1e686cbc09ba06e67c8c02ea4df89902607ce2"], ["tests/wasm-managed-array-inheritance.test.mjs", "c0590bcde56a736363797834e27fdfd91bcd27d4de0ed3df38a507dc28177011"], ["tests/wasm-managed-array-index-storage.test.mjs", "335f342bc2873f2c1580ce51789e407c00a0fb1e9b53c9c63ec49d179a5e8fac"], ["tests/wasm-managed-variadic-calls.test.mjs", "2b18ecbbc8193e36d8bb2cd070cd27e137eafecafb3df446b3a4830793a550d6"], ["tests/wasm-managed-typeof.test.mjs", "f55d60a967d030c61e0c2ab80bb4670abf252cfff46f3610184ddd8cd0882f7b"], ["tests/wasm-managed-typeof-paths.test.mjs", "47251c18ed5f48e1ff9d42f09539a343bf208153f35875dc8f0648ee714da0f3"], ["tests/wasm-managed-array-callbacks.test.mjs", "0f5c51587744164bb77fe7dd59d82a3af09c56a09ce8d87d9b75401589b2985a"], ["tests/wasm-managed-array-splice.test.mjs", "166cfd99b0de0e64a2abb15bf1578372203ea73348be8ab317e5acf78550c8af"], ["tests/wasm-managed-project-linking.test.mjs", "fd9c909b7e5fa57ee9237385c142349fdad1b9d66d5e9d603c2323cdf3ec0c07"], ["tests/wasm-managed-strings.test.mjs", "33da413ad48d3b359663aa6109ca390eee68a5124d9a8634ac02a91988b06507"], ["tests/wasm-managed-text-constructors.test.mjs", "30a083b2072d64bea0be1dcbfbacd833dc63afad32ff34a873875458e20468f6"], ["tests/wasm-managed-regexp.test.mjs", "65d8dc751109174f90eb41ee0d0332e23e3b354d123c733448a84a32ad7ae2ad"], ["tests/wasm-managed-regexp-exact.test.mjs", "faf75947bef51313bdd45eb5f1a35df3f59cde46480ea2f982c1c903bfb9c125"], ["tests/wasm-managed-regexp-indices.test.mjs", "306a40b71bee4d072e1df807a992208a42659e73f3dc8f5ac737aa14cfc71ea3"], ["tests/regexp-property-outlining.test.mjs", "b45811f343ae5942e33c7bb2bb47fade0de2d0e5cfdb7cfc889f7d287660bcb9"], ["tests/compiler-fragment-combine.test.mjs", "5105cb3d9c727be942744a8f725dea0efd3a4fb2863f1d6a341249ca53fc561c"], ["tests/wasm-managed-persistent-literals.test.mjs", "bb8fe651361e49b5dee4f12252209a054401e03beed7d150efd8fd9781e81287"], ["tests/js-array-text-fast-path.test.mjs", "be07405cef94d217503e40a1606ccb7d0a824cb5a4ca63ebbe8bc3d415ce7def"], ["tests/wasm-managed-initializer-outlining.test.mjs", "e3d2cd7d8e3d5f28a08f20401cf8cfa48ed10743136a2e39ef9b895bbd5e074e"], ["tests/wasm-managed-primitive-own-runtime.test.mjs", "62d634ad2bf4e02f83a5fd2f7c7fc7cdf1ff570a81aada0d6e2e761d00c24069"], ["tests/wasm-managed-operand-conversion.test.mjs", "d9385ea1cf4c2b17bd046590950e524f1cbf2e33adf87afeceba8c554ea5a95d"], ["tests/wasm-managed-math.test.mjs", "364144cc482b0ea756505ee1723f3831f2d1439f147e9380906d6ef0c19b5b9d"]], [["tools/testing/managed-fixture-repairs.eli", "tools/testing/managed-fixture-repairs.mjs"], ["tools/testing/array-text-fixture.eli", "tools/testing/array-text-fixture.mjs"], ["tests/eliscript/array-text-fixture-install.eli", "tests/helpers/array-text-fixture-install.mjs"], ["tests/eliscript/array-text-fixture.eli", "tests/array-text-fixture-selfhosted.test.mjs"], ["tools/testing/initializer-array-fixture.eli", "tools/testing/initializer-array-fixture.mjs"], ["tools/testing/math-oracle-fixture.eli", "tools/testing/math-oracle-fixture.mjs"], ["tests/eliscript/math-oracle-fixture-install.eli", "tests/helpers/math-oracle-fixture-install.mjs"], ["tests/eliscript/math-oracle-fixture.eli", "tests/math-oracle-fixture-selfhosted.test.mjs"], ["tests/eliscript/initializer-array-fixture.eli", "tests/initializer-array-fixture-selfhosted.test.mjs"], ["tools/testing/managed-primitive-own-repairs.eli", "tools/testing/managed-primitive-own-repairs.mjs"], ["tests/eliscript/managed-primitive-own-repairs.eli", "tests/managed-primitive-own-repairs-selfhosted.test.mjs"], ["tests/eliscript/managed-fixture-repairs-install.eli", "tests/helpers/managed-fixture-repairs-install.mjs"], ["tests/eliscript/managed-reference-node.eli", "tests/helpers/managed-reference-node.mjs"], ["tests/eliscript/native-prototype-node.eli", "tests/helpers/native-prototype-node.mjs"], ["tests/eliscript/managed-fixture-repairs.eli", "tests/managed-fixture-repairs-selfhosted.test.mjs"], ["tests/eliscript/managed-capacity-registration.eli", "tests/helpers/managed-capacity-registration.mjs"], ["tests/eliscript/managed-capacity-registration-tests.eli", "tests/managed-capacity-registration-selfhosted.test.mjs"], ["tools/testing/managed-array-repairs.eli", "tools/testing/managed-array-repairs.mjs"], ["tests/eliscript/managed-regexp-oracle-node.eli", "tests/helpers/managed-regexp-oracle-node.mjs"], ["tools/testing/managed-regexp-repairs.eli", "tools/testing/managed-regexp-repairs.mjs"]], ["tests/fixtures/managed-splice-rejected.eli", "tests/fixtures/managed-splice-species.eli", "tests/fixtures/managed-splice-accessor.eli", "tests/fixtures/managed-splice-observe.eli", "tests/wasm-managed-array-callbacks-test-legacy.mjs", "tests/wasm-managed-array-splice-test-legacy.mjs", "runtime/unicode-case.eli", "runtime/unicode-case.mjs", "runtime/unicode-case-data.eli", "runtime/unicode-case-data.mjs", "runtime/math.eli", "runtime/math.mjs"], 0));
|
|
742
|
+
})([], [], [["tests/wasm-managed-empty-bindings.test.mjs", "ecb157620b2a55b24962c2528dd81c3b3bfc71ba71b052a33a80cba2e59f639f"], ["tests/wasm-managed-callables.test.mjs", "b0b3137803b84d454a5b389b2616676f15f43d70d666bf617babd4d730e934ef"], ["tests/wasm-managed-realm-lifetime.test.mjs", "3e8722afe234131cf927c7999a52c4911a79aaeb233ce4177be5cb1d9e2feb6b"], ["tests/wasm-managed-native-prototype-callables.test.mjs", "768fcb829e7ef01dad76520eeed9b0c10a20d89440da7bbd48cfcf21c23bea4e"], ["tests/wasm-managed-str.test.mjs", "94bfa646c922c1c87ea9bf5e7c1e686cbc09ba06e67c8c02ea4df89902607ce2"], ["tests/wasm-managed-array-inheritance.test.mjs", "c0590bcde56a736363797834e27fdfd91bcd27d4de0ed3df38a507dc28177011"], ["tests/wasm-managed-array-index-storage.test.mjs", "335f342bc2873f2c1580ce51789e407c00a0fb1e9b53c9c63ec49d179a5e8fac"], ["tests/wasm-managed-variadic-calls.test.mjs", "2b18ecbbc8193e36d8bb2cd070cd27e137eafecafb3df446b3a4830793a550d6"], ["tests/wasm-managed-typeof.test.mjs", "f55d60a967d030c61e0c2ab80bb4670abf252cfff46f3610184ddd8cd0882f7b"], ["tests/wasm-managed-typeof-paths.test.mjs", "47251c18ed5f48e1ff9d42f09539a343bf208153f35875dc8f0648ee714da0f3"], ["tests/wasm-managed-array-callbacks.test.mjs", "0f5c51587744164bb77fe7dd59d82a3af09c56a09ce8d87d9b75401589b2985a"], ["tests/wasm-managed-array-splice.test.mjs", "166cfd99b0de0e64a2abb15bf1578372203ea73348be8ab317e5acf78550c8af"], ["tests/wasm-managed-project-linking.test.mjs", "fd9c909b7e5fa57ee9237385c142349fdad1b9d66d5e9d603c2323cdf3ec0c07"], ["tests/wasm-managed-strings.test.mjs", "33da413ad48d3b359663aa6109ca390eee68a5124d9a8634ac02a91988b06507"], ["tests/wasm-managed-text-constructors.test.mjs", "30a083b2072d64bea0be1dcbfbacd833dc63afad32ff34a873875458e20468f6"], ["tests/wasm-managed-regexp.test.mjs", "65d8dc751109174f90eb41ee0d0332e23e3b354d123c733448a84a32ad7ae2ad"], ["tests/wasm-managed-regexp-exact.test.mjs", "faf75947bef51313bdd45eb5f1a35df3f59cde46480ea2f982c1c903bfb9c125"], ["tests/wasm-managed-regexp-indices.test.mjs", "306a40b71bee4d072e1df807a992208a42659e73f3dc8f5ac737aa14cfc71ea3"], ["tests/regexp-property-outlining.test.mjs", "b45811f343ae5942e33c7bb2bb47fade0de2d0e5cfdb7cfc889f7d287660bcb9"], ["tests/compiler-fragment-combine.test.mjs", "5105cb3d9c727be942744a8f725dea0efd3a4fb2863f1d6a341249ca53fc561c"], ["tests/wasm-managed-persistent-literals.test.mjs", "bb8fe651361e49b5dee4f12252209a054401e03beed7d150efd8fd9781e81287"], ["tests/js-array-text-fast-path.test.mjs", "be07405cef94d217503e40a1606ccb7d0a824cb5a4ca63ebbe8bc3d415ce7def"], ["tests/wasm-managed-initializer-outlining.test.mjs", "e3d2cd7d8e3d5f28a08f20401cf8cfa48ed10743136a2e39ef9b895bbd5e074e"], ["tests/wasm-managed-primitive-own-runtime.test.mjs", "62d634ad2bf4e02f83a5fd2f7c7fc7cdf1ff570a81aada0d6e2e761d00c24069"], ["tests/wasm-managed-operand-conversion.test.mjs", "d9385ea1cf4c2b17bd046590950e524f1cbf2e33adf87afeceba8c554ea5a95d"], ["tests/wasm-managed-math.test.mjs", "364144cc482b0ea756505ee1723f3831f2d1439f147e9380906d6ef0c19b5b9d"]], [["tools/testing/managed-fixture-repairs.eli", "tools/testing/managed-fixture-repairs.mjs"], ["tools/testing/array-text-fixture.eli", "tools/testing/array-text-fixture.mjs"], ["tests/eliscript/array-text-fixture-install.eli", "tests/helpers/array-text-fixture-install.mjs"], ["tests/eliscript/array-text-fixture.eli", "tests/array-text-fixture-selfhosted.test.mjs"], ["tools/testing/initializer-array-fixture.eli", "tools/testing/initializer-array-fixture.mjs"], ["tools/testing/math-oracle-fixture.eli", "tools/testing/math-oracle-fixture.mjs"], ["tests/eliscript/math-oracle-fixture-install.eli", "tests/helpers/math-oracle-fixture-install.mjs"], ["tests/eliscript/math-oracle-fixture.eli", "tests/math-oracle-fixture-selfhosted.test.mjs"], ["tests/eliscript/initializer-array-fixture.eli", "tests/initializer-array-fixture-selfhosted.test.mjs"], ["tools/testing/managed-primitive-own-repairs.eli", "tools/testing/managed-primitive-own-repairs.mjs"], ["tests/eliscript/managed-primitive-own-repairs.eli", "tests/managed-primitive-own-repairs-selfhosted.test.mjs"], ["tests/eliscript/managed-fixture-repairs-install.eli", "tests/helpers/managed-fixture-repairs-install.mjs"], ["tests/eliscript/managed-reference-node.eli", "tests/helpers/managed-reference-node.mjs"], ["tests/eliscript/native-prototype-node.eli", "tests/helpers/native-prototype-node.mjs"], ["tests/eliscript/managed-fixture-repairs.eli", "tests/managed-fixture-repairs-selfhosted.test.mjs"], ["tests/eliscript/managed-capacity-registration.eli", "tests/helpers/managed-capacity-registration.mjs"], ["tests/eliscript/managed-capacity-registration-tests.eli", "tests/managed-capacity-registration-selfhosted.test.mjs"], ["tools/testing/managed-array-repairs.eli", "tools/testing/managed-array-repairs.mjs"], ["tests/eliscript/managed-regexp-oracle-node.eli", "tests/helpers/managed-regexp-oracle-node.mjs"], ["tools/testing/managed-regexp-repairs.eli", "tools/testing/managed-regexp-repairs.mjs"]], ["tests/fixtures/managed-splice-rejected.eli", "tests/fixtures/managed-splice-species.eli", "tests/fixtures/managed-splice-accessor.eli", "tests/fixtures/managed-splice-observe.eli", "tests/wasm-managed-array-callbacks-test-legacy.mjs", "tests/wasm-managed-array-splice-test-legacy.mjs", "runtime/prelude.eli", "runtime/prelude.mjs", "runtime/unicode-case.eli", "runtime/unicode-case.mjs", "runtime/unicode-case-data.eli", "runtime/unicode-case-data.mjs", "runtime/math.eli", "runtime/math.mjs"], 0));
|
|
854
743
|
}
|
|
855
744
|
async function direct_wasm_source_migration(options) {
|
|
856
745
|
return (await (async (archive) => {
|
|
@@ -1,119 +1,17 @@
|
|
|
1
1
|
// Generated by Eliscript. Do not edit.
|
|
2
|
-
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
|
-
var __eliscript_tdz_ready_0;
|
|
4
|
-
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("test"); return test; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("test"); return __eliscript_const_error(); }
|
|
6
|
-
var __eliscript_tdz_ready_1;
|
|
7
|
-
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("original_expect"); return original_expect; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("original_expect"); return __eliscript_const_error(); }
|
|
9
|
-
var __eliscript_tdz_ready_2;
|
|
10
|
-
function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("expect"); return expect; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("expect"); return __eliscript_const_error(); }
|
|
12
2
|
import "eliscript/runtime/unicode-case.mjs";
|
|
13
|
-
import {
|
|
3
|
+
import { __eliscript_at, __eliscript_at_direct, __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
14
4
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
15
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
16
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
17
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
18
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
19
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
20
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
21
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
22
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
23
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
24
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
25
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
26
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
27
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
28
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
29
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
30
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
31
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
32
|
-
}
|
|
33
|
-
for (let index = 0; index < 2; index++) {
|
|
34
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
35
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
36
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
37
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
41
|
-
};
|
|
42
|
-
const __eliscript_to_number = (value) => {
|
|
43
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
44
|
-
if (typeof primitive === "string") {
|
|
45
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
46
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
47
|
-
let first = 2;
|
|
48
|
-
while (first < text.length && text[first] === "0") first++;
|
|
49
|
-
if (first === text.length) return 0;
|
|
50
|
-
const prefix = text[1];
|
|
51
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
52
|
-
if (text.length - first > limit) return 1 / 0;
|
|
53
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
54
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return __eliscript_number_intrinsic(primitive);
|
|
58
|
-
};
|
|
59
|
-
const __eliscript_numeric = (value) => {
|
|
60
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
61
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
62
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
63
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
64
|
-
};
|
|
65
|
-
const __eliscript_implicit_number = (value) => {
|
|
66
|
-
if (typeof value === "number") return value;
|
|
67
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
68
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
69
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
70
|
-
};
|
|
71
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
72
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
73
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
74
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
75
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
76
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
77
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
78
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
79
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
80
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
81
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
82
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
83
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
84
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
85
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
86
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
87
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
88
|
-
if (operator === "<") return left < right;
|
|
89
|
-
if (operator === "<=") return left <= right;
|
|
90
|
-
if (operator === ">") return left > right;
|
|
91
|
-
return left >= right;
|
|
92
|
-
}
|
|
93
|
-
let a = __eliscript_numeric_primitive(left);
|
|
94
|
-
let b = __eliscript_numeric_primitive(right);
|
|
95
|
-
const x = typeof a, y = typeof b;
|
|
96
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
97
|
-
a = __eliscript_numeric(a);
|
|
98
|
-
b = __eliscript_numeric(b);
|
|
99
|
-
}
|
|
100
|
-
if (operator === "<") return a < b;
|
|
101
|
-
if (operator === "<=") return a <= b;
|
|
102
|
-
if (operator === ">") return a > b;
|
|
103
|
-
return a >= b;
|
|
104
|
-
};
|
|
105
5
|
|
|
106
6
|
import * as original from "bun:test";
|
|
107
7
|
import {isManagedSourceView, projectManagedSourceViewForMatcher} from "./managed-source-view.mjs";
|
|
108
8
|
const test = (original)["test"];
|
|
109
|
-
__eliscript_tdz_ready_0 = true;
|
|
110
9
|
const original_expect = (original)["expect"];
|
|
111
|
-
__eliscript_tdz_ready_1 = true;
|
|
112
10
|
function branch_matcher(arguments$, branches) {
|
|
113
11
|
{
|
|
114
12
|
let input = (arguments$)["slice"]();
|
|
115
13
|
let _snapshot = ((input)[0] = projectManagedSourceViewForMatcher((arguments$)[0]));
|
|
116
|
-
let matcher = __eliscript_at(Reflect, "apply")(
|
|
14
|
+
let matcher = __eliscript_at(Reflect, "apply")(original_expect, undefined, input);
|
|
117
15
|
let index = 0;
|
|
118
16
|
while (__eliscript_numeric_relation("<", index, ((branches) ?? []).length)) {
|
|
119
17
|
((matcher = Reflect.get(matcher, (branches)[index], matcher)));
|
|
@@ -155,7 +53,7 @@ function wrap_matcher(matcher, arguments$, branches) {
|
|
|
155
53
|
}
|
|
156
54
|
})}));
|
|
157
55
|
}
|
|
158
|
-
const expect = new (globalThis.Proxy)(
|
|
56
|
+
const expect = new (globalThis.Proxy)(original_expect, ({"apply": ((target, receiver, arguments$) => {
|
|
159
57
|
{
|
|
160
58
|
const __eliscript_value_3 = __eliscript_at(Reflect, "apply")(target, receiver, arguments$);
|
|
161
59
|
{
|
|
@@ -168,6 +66,5 @@ const expect = new (globalThis.Proxy)((__eliscript_tdz_read_1()), ({"apply": ((t
|
|
|
168
66
|
}
|
|
169
67
|
}
|
|
170
68
|
})}));
|
|
171
|
-
__eliscript_tdz_ready_2 = true;
|
|
172
69
|
export {expect, test};
|
|
173
70
|
//# sourceMappingURL=compiler-corpus-matchers.mjs.map
|