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,134 +2,32 @@
|
|
|
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("hostWellKnownSymbols"); return hostWellKnownSymbols; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("hostWellKnownSymbols"); 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("hostFunctionToString"); return hostFunctionToString; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("hostFunctionToString"); 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("hostFunctionCall"); return hostFunctionCall; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("hostFunctionCall"); 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("hostCrypto"); return hostCrypto; }
|
|
14
|
-
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("hostCrypto"); 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("hostGetRandomValues"); return hostGetRandomValues; }
|
|
17
|
-
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("hostGetRandomValues"); 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("hostObjectToString"); return hostObjectToString; }
|
|
20
|
-
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("hostObjectToString"); 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("hostOwnDescriptor"); return hostOwnDescriptor; }
|
|
23
|
-
function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("hostOwnDescriptor"); 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("hostPrototypeOf"); return hostPrototypeOf; }
|
|
26
|
-
function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("hostPrototypeOf"); return __eliscript_const_error(); }
|
|
27
19
|
var __eliscript_tdz_ready_8;
|
|
28
20
|
function __eliscript_tdz_read_8() { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("hostPromiseThen"); return hostPromiseThen; }
|
|
29
|
-
function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("hostPromiseThen"); return __eliscript_const_error(); }
|
|
30
21
|
var __eliscript_tdz_ready_9;
|
|
31
22
|
function __eliscript_tdz_read_9() { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("hostCollectionIntrinsics"); return hostCollectionIntrinsics; }
|
|
32
|
-
function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("hostCollectionIntrinsics"); return __eliscript_const_error(); }
|
|
33
23
|
var __eliscript_tdz_ready_10;
|
|
34
24
|
function __eliscript_tdz_read_10() { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("hostIteratorIntrinsics"); return hostIteratorIntrinsics; }
|
|
35
|
-
function __eliscript_tdz_write_10(__eliscript_tdz_value_10) { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("hostIteratorIntrinsics"); return __eliscript_const_error(); }
|
|
36
25
|
var __eliscript_tdz_ready_11;
|
|
37
26
|
function __eliscript_tdz_read_11() { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("source_operation_diagnostics"); return source_operation_diagnostics; }
|
|
38
|
-
function __eliscript_tdz_write_11(__eliscript_tdz_value_11) { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("source_operation_diagnostics"); return __eliscript_const_error(); }
|
|
39
27
|
import "eliscript/runtime/unicode-case.mjs";
|
|
40
28
|
import "eliscript/runtime/math.mjs";
|
|
41
|
-
import {
|
|
29
|
+
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";
|
|
42
30
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
43
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
44
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
45
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
46
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
47
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
48
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
49
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
50
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
51
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
52
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
53
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
54
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
55
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
56
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
57
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
58
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
59
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
60
|
-
}
|
|
61
|
-
for (let index = 0; index < 2; index++) {
|
|
62
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
63
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
64
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
65
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
69
|
-
};
|
|
70
|
-
const __eliscript_to_number = (value) => {
|
|
71
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
72
|
-
if (typeof primitive === "string") {
|
|
73
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
74
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
75
|
-
let first = 2;
|
|
76
|
-
while (first < text.length && text[first] === "0") first++;
|
|
77
|
-
if (first === text.length) return 0;
|
|
78
|
-
const prefix = text[1];
|
|
79
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
80
|
-
if (text.length - first > limit) return 1 / 0;
|
|
81
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
82
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return __eliscript_number_intrinsic(primitive);
|
|
86
|
-
};
|
|
87
|
-
const __eliscript_numeric = (value) => {
|
|
88
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
89
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
90
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
91
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
92
|
-
};
|
|
93
|
-
const __eliscript_implicit_number = (value) => {
|
|
94
|
-
if (typeof value === "number") return value;
|
|
95
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
96
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
97
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
98
|
-
};
|
|
99
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
100
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
101
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
102
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
103
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
104
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
105
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
106
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
107
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
108
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
109
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
110
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
111
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
112
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
113
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
114
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
115
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
116
|
-
if (operator === "<") return left < right;
|
|
117
|
-
if (operator === "<=") return left <= right;
|
|
118
|
-
if (operator === ">") return left > right;
|
|
119
|
-
return left >= right;
|
|
120
|
-
}
|
|
121
|
-
let a = __eliscript_numeric_primitive(left);
|
|
122
|
-
let b = __eliscript_numeric_primitive(right);
|
|
123
|
-
const x = typeof a, y = typeof b;
|
|
124
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
125
|
-
a = __eliscript_numeric(a);
|
|
126
|
-
b = __eliscript_numeric(b);
|
|
127
|
-
}
|
|
128
|
-
if (operator === "<") return a < b;
|
|
129
|
-
if (operator === "<=") return a <= b;
|
|
130
|
-
if (operator === ">") return a > b;
|
|
131
|
-
return a >= b;
|
|
132
|
-
};
|
|
133
31
|
|
|
134
32
|
import {hostUnicodeCaseVersion} from "../runtime/unicode-case-profiles.mjs";
|
|
135
33
|
import {createManagedDecodedSourceView, createManagedLiteralHostProvider} from "./managed-source-view.mjs";
|
|
@@ -240,7 +138,7 @@ const hostFunctionCall = globalThis.Function.prototype.call;
|
|
|
240
138
|
__eliscript_tdz_ready_2 = true;
|
|
241
139
|
const hostCrypto = (globalThis.globalThis)["crypto"];
|
|
242
140
|
__eliscript_tdz_ready_3 = true;
|
|
243
|
-
const hostGetRandomValues = (__eliscript_truthy(
|
|
141
|
+
const hostGetRandomValues = (__eliscript_truthy(hostCrypto) ? (hostCrypto)["getRandomValues"] : null);
|
|
244
142
|
__eliscript_tdz_ready_4 = true;
|
|
245
143
|
const hostObjectToString = globalThis.Object.prototype.toString;
|
|
246
144
|
__eliscript_tdz_ready_5 = true;
|
|
@@ -252,7 +150,7 @@ const hostPromiseThen = globalThis.Promise.prototype.then;
|
|
|
252
150
|
__eliscript_tdz_ready_8 = true;
|
|
253
151
|
const hostCollectionIntrinsics = Object.freeze([globalThis.Map.prototype.get, globalThis.Map.prototype.set, globalThis.Map.prototype.has, globalThis.Map.prototype.delete$, globalThis.Map.prototype.clear, globalThis.Map.prototype.entries, globalThis.Map.prototype.keys, globalThis.Map.prototype.values, globalThis.Map.prototype.forEach, (Object.getOwnPropertyDescriptor(globalThis.Map.prototype, "size"))["get"], globalThis.Set.prototype.add, globalThis.Set.prototype.has, globalThis.Set.prototype.delete$, globalThis.Set.prototype.clear, globalThis.Set.prototype.entries, globalThis.Set.prototype.keys, globalThis.Set.prototype.values, globalThis.Set.prototype.forEach, (Object.getOwnPropertyDescriptor(globalThis.Set.prototype, "size"))["get"], globalThis.WeakMap.prototype.get, globalThis.WeakMap.prototype.set, globalThis.WeakMap.prototype.has, globalThis.WeakMap.prototype.delete$, globalThis.WeakSet.prototype.add, globalThis.WeakSet.prototype.has, globalThis.WeakSet.prototype.delete$]);
|
|
254
152
|
__eliscript_tdz_ready_9 = true;
|
|
255
|
-
const hostIteratorIntrinsics = Object.freeze(({"328": (Object.getPrototypeOf(__eliscript_at(Reflect, "apply")(globalThis.Array.prototype.values, [], [])))["next"], "329": (Object.getPrototypeOf(__eliscript_at(Reflect, "apply")((
|
|
153
|
+
const hostIteratorIntrinsics = Object.freeze(({"328": (Object.getPrototypeOf(__eliscript_at(Reflect, "apply")(globalThis.Array.prototype.values, [], [])))["next"], "329": (Object.getPrototypeOf(__eliscript_at(Reflect, "apply")((hostCollectionIntrinsics)[5], new (globalThis.Map)(), [])))["next"], "330": (Object.getPrototypeOf(__eliscript_at(Reflect, "apply")((hostCollectionIntrinsics)[16], new (globalThis.Set)(), [])))["next"], "332": (Object.getPrototypeOf(__eliscript_at(Reflect, "apply")((globalThis.RegExp.prototype)[globalThis.Symbol.matchAll], new (globalThis.RegExp)("(?:)", "g"), [""])))["next"], "333": (Object.getPrototypeOf(__eliscript_at(Reflect, "apply")((globalThis.String.prototype)[globalThis.Symbol.iterator], "", [])))["next"]}));
|
|
256
154
|
__eliscript_tdz_ready_10 = true;
|
|
257
155
|
function managedWeakReference(value) {
|
|
258
156
|
if ((hostType((globalThis.globalThis)["WeakRef"]) === "function")) {
|
|
@@ -1,107 +1,7 @@
|
|
|
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("failManagedRuntime"); return failManagedRuntime; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("failManagedRuntime"); 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("validateManagedRuntimeOptions"); return validateManagedRuntimeOptions; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("validateManagedRuntimeOptions"); 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("createManagedHostCapabilityBridge"); return createManagedHostCapabilityBridge; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("createManagedHostCapabilityBridge"); 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 legacy from "./managed-host-legacy.mjs";
|
|
107
7
|
import * as maintained from "./managed-host-runtime.mjs";
|
|
@@ -110,11 +10,8 @@ import {createManagedForeignBindingRuntime} from "./managed-foreign-binding.mjs"
|
|
|
110
10
|
import {createManagedHostObjectRealmRuntime} from "./managed-host-object-realm.mjs";
|
|
111
11
|
import {withManagedSourceDecode, registerManagedSourceDecodeRuntime} from "./managed-source-view.mjs";
|
|
112
12
|
const failManagedRuntime = (legacy)["failManagedRuntime"];
|
|
113
|
-
__eliscript_tdz_ready_0 = true;
|
|
114
13
|
const validateManagedRuntimeOptions = (legacy)["validateManagedRuntimeOptions"];
|
|
115
|
-
__eliscript_tdz_ready_1 = true;
|
|
116
14
|
const createManagedHostCapabilityBridge = (legacy)["createManagedHostCapabilityBridge"];
|
|
117
|
-
__eliscript_tdz_ready_2 = true;
|
|
118
15
|
function managedHostLiteralProbeExports(exports, descriptor) {
|
|
119
16
|
{
|
|
120
17
|
const __eliscript_value_1 = (__eliscript_truthy(descriptor) ? ((descriptor)["literalRuntime"] ?? null) : null);
|
|
@@ -1,113 +1,17 @@
|
|
|
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("managedHostModuleEdges"); return managedHostModuleEdges; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("managedHostModuleEdges"); return __eliscript_const_error(); }
|
|
6
3
|
var __eliscript_tdz_ready_1;
|
|
7
4
|
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("project_boundaries"); return project_boundaries; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("project_boundaries"); return __eliscript_const_error(); }
|
|
9
5
|
var __eliscript_tdz_ready_2;
|
|
10
6
|
function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("prepared_load_results"); return prepared_load_results; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("prepared_load_results"); return __eliscript_const_error(); }
|
|
12
7
|
import "eliscript/runtime/unicode-case.mjs";
|
|
13
|
-
import {
|
|
8
|
+
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
9
|
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
10
|
|
|
106
11
|
import * as legacy from "./managed-module-graph-legacy.mjs";
|
|
107
12
|
import {bindManagedSourceBoundary, withManagedSourceBoundary, withManagedSourceBindingPoll, withManagedSourceDecode, registerManagedSourceDecodeRuntime} from "./managed-source-view.mjs";
|
|
108
13
|
import {compile_string} from "../../dist/bootstrap/compiler.mjs";
|
|
109
14
|
const managedHostModuleEdges = (legacy)["managedHostModuleEdges"];
|
|
110
|
-
__eliscript_tdz_ready_0 = true;
|
|
111
15
|
const project_boundaries = new (globalThis.WeakMap)();
|
|
112
16
|
__eliscript_tdz_ready_1 = true;
|
|
113
17
|
const prepared_load_results = new (globalThis.WeakMap)();
|
|
@@ -2,104 +2,10 @@
|
|
|
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("runtime_allocator_records"); return runtime_allocator_records; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("runtime_allocator_records"); 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("readManagedModuleMetadata"); return readManagedModuleMetadata; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("readManagedModuleMetadata"); return __eliscript_const_error(); }
|
|
9
5
|
import "eliscript/runtime/unicode-case.mjs";
|
|
10
6
|
import "eliscript/runtime/math.mjs";
|
|
11
|
-
import {
|
|
7
|
+
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";
|
|
12
8
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
13
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
14
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
15
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
16
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
17
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
18
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
19
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
20
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
21
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
22
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
23
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
24
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
25
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
26
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
27
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
28
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
29
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
30
|
-
}
|
|
31
|
-
for (let index = 0; index < 2; index++) {
|
|
32
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
33
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
34
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
35
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
39
|
-
};
|
|
40
|
-
const __eliscript_to_number = (value) => {
|
|
41
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
42
|
-
if (typeof primitive === "string") {
|
|
43
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
44
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
45
|
-
let first = 2;
|
|
46
|
-
while (first < text.length && text[first] === "0") first++;
|
|
47
|
-
if (first === text.length) return 0;
|
|
48
|
-
const prefix = text[1];
|
|
49
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
50
|
-
if (text.length - first > limit) return 1 / 0;
|
|
51
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
52
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return __eliscript_number_intrinsic(primitive);
|
|
56
|
-
};
|
|
57
|
-
const __eliscript_numeric = (value) => {
|
|
58
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
59
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
60
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
61
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
62
|
-
};
|
|
63
|
-
const __eliscript_implicit_number = (value) => {
|
|
64
|
-
if (typeof value === "number") return value;
|
|
65
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
66
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
67
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
68
|
-
};
|
|
69
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
70
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
71
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
72
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
73
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
74
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
75
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
76
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
77
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
78
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
79
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
80
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
81
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
82
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
83
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
84
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
85
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
86
|
-
if (operator === "<") return left < right;
|
|
87
|
-
if (operator === "<=") return left <= right;
|
|
88
|
-
if (operator === ">") return left > right;
|
|
89
|
-
return left >= right;
|
|
90
|
-
}
|
|
91
|
-
let a = __eliscript_numeric_primitive(left);
|
|
92
|
-
let b = __eliscript_numeric_primitive(right);
|
|
93
|
-
const x = typeof a, y = typeof b;
|
|
94
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
95
|
-
a = __eliscript_numeric(a);
|
|
96
|
-
b = __eliscript_numeric(b);
|
|
97
|
-
}
|
|
98
|
-
if (operator === "<") return a < b;
|
|
99
|
-
if (operator === "<=") return a <= b;
|
|
100
|
-
if (operator === ">") return a > b;
|
|
101
|
-
return a >= b;
|
|
102
|
-
};
|
|
103
9
|
|
|
104
10
|
import {createManagedHostRuntime, createManagedHostCapabilityBridge, failManagedRuntime, validateManagedRuntimeOptions} from "./managed-host.mjs";
|
|
105
11
|
import {createManagedModuleGraph, createManagedProjectFacades, loadManagedProjectGraph, managedHostModuleEdges, observeManagedProjectRuntime, observeManagedProjectExports} from "./managed-module-graph.mjs";
|
|
@@ -934,6 +840,5 @@ async function instantiateManagedRuntimeWithHostModules(bytes, ...arguments$) {
|
|
|
934
840
|
})(runtime_options(arguments$)));
|
|
935
841
|
}
|
|
936
842
|
const readManagedModuleMetadata = module_metadata;
|
|
937
|
-
__eliscript_tdz_ready_1 = true;
|
|
938
843
|
export {instantiateManagedRuntime, instantiateManagedRuntimeWithHostModules, loadManagedHostModules, readManagedAllocatorSnapshot, readManagedAllocatorValueCounts, readManagedModuleMetadata, createManagedModuleGraph, createManagedProjectFacades, loadManagedProjectGraph};
|
|
939
844
|
//# sourceMappingURL=managed-runtime.mjs.map
|