eliscript 0.1.0 → 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-compat.el +164 -2
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-repl.el +1 -1
- package/package.json +2 -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 -2
- package/runtime/emacs-compat.mjs +13522 -2295
- 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
|
@@ -1,97 +1,7 @@
|
|
|
1
1
|
// Generated by Eliscript. Do not edit.
|
|
2
2
|
import "eliscript/runtime/unicode-case.mjs";
|
|
3
|
-
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";
|
|
4
4
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
5
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
6
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
7
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
8
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
9
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
10
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
11
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
12
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
13
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
14
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
15
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
16
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
17
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
18
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
19
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
20
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
21
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
22
|
-
}
|
|
23
|
-
for (let index = 0; index < 2; index++) {
|
|
24
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
25
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
26
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
27
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
31
|
-
};
|
|
32
|
-
const __eliscript_to_number = (value) => {
|
|
33
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
34
|
-
if (typeof primitive === "string") {
|
|
35
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
36
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
37
|
-
let first = 2;
|
|
38
|
-
while (first < text.length && text[first] === "0") first++;
|
|
39
|
-
if (first === text.length) return 0;
|
|
40
|
-
const prefix = text[1];
|
|
41
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
42
|
-
if (text.length - first > limit) return 1 / 0;
|
|
43
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
44
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return __eliscript_number_intrinsic(primitive);
|
|
48
|
-
};
|
|
49
|
-
const __eliscript_numeric = (value) => {
|
|
50
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
51
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
52
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
53
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
54
|
-
};
|
|
55
|
-
const __eliscript_implicit_number = (value) => {
|
|
56
|
-
if (typeof value === "number") return value;
|
|
57
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
58
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
59
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
60
|
-
};
|
|
61
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
62
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
63
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
64
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
65
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
66
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
67
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
68
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
69
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
70
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
71
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
72
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
73
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
74
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
75
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
76
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
77
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
78
|
-
if (operator === "<") return left < right;
|
|
79
|
-
if (operator === "<=") return left <= right;
|
|
80
|
-
if (operator === ">") return left > right;
|
|
81
|
-
return left >= right;
|
|
82
|
-
}
|
|
83
|
-
let a = __eliscript_numeric_primitive(left);
|
|
84
|
-
let b = __eliscript_numeric_primitive(right);
|
|
85
|
-
const x = typeof a, y = typeof b;
|
|
86
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
87
|
-
a = __eliscript_numeric(a);
|
|
88
|
-
b = __eliscript_numeric(b);
|
|
89
|
-
}
|
|
90
|
-
if (operator === "<") return a < b;
|
|
91
|
-
if (operator === "<=") return a <= b;
|
|
92
|
-
if (operator === ">") return a > b;
|
|
93
|
-
return a >= b;
|
|
94
|
-
};
|
|
95
5
|
|
|
96
6
|
function data_function(descriptors, key) {
|
|
97
7
|
{
|
|
@@ -1,78 +1,39 @@
|
|
|
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("ObjectConstructor"); return ObjectConstructor; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("ObjectConstructor"); 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("ObjectPrototype"); return ObjectPrototype; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("ObjectPrototype"); 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("ArrayConstructor"); return ArrayConstructor; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("ArrayConstructor"); return __eliscript_const_error(); }
|
|
12
|
-
var __eliscript_tdz_ready_3;
|
|
13
|
-
function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("ArrayPrototype"); return ArrayPrototype; }
|
|
14
|
-
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("ArrayPrototype"); return __eliscript_const_error(); }
|
|
15
|
-
var __eliscript_tdz_ready_4;
|
|
16
|
-
function __eliscript_tdz_read_4() { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("function_source"); return function_source; }
|
|
17
|
-
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("function_source"); return __eliscript_const_error(); }
|
|
18
|
-
var __eliscript_tdz_ready_5;
|
|
19
|
-
function __eliscript_tdz_read_5() { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("apply_function"); return apply_function; }
|
|
20
|
-
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("apply_function"); return __eliscript_const_error(); }
|
|
21
|
-
var __eliscript_tdz_ready_6;
|
|
22
|
-
function __eliscript_tdz_read_6() { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("own_descriptor"); return own_descriptor; }
|
|
23
|
-
function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("own_descriptor"); return __eliscript_const_error(); }
|
|
24
|
-
var __eliscript_tdz_ready_7;
|
|
25
|
-
function __eliscript_tdz_read_7() { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("object_intrinsics"); return object_intrinsics; }
|
|
26
|
-
function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("object_intrinsics"); return __eliscript_const_error(); }
|
|
27
|
-
var __eliscript_tdz_ready_8;
|
|
28
|
-
function __eliscript_tdz_read_8() { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("array_intrinsics"); return array_intrinsics; }
|
|
29
|
-
function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("array_intrinsics"); return __eliscript_const_error(); }
|
|
30
|
-
var __eliscript_tdz_ready_9;
|
|
31
|
-
function __eliscript_tdz_read_9() { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("reflect_intrinsics"); return reflect_intrinsics; }
|
|
32
|
-
function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("reflect_intrinsics"); return __eliscript_const_error(); }
|
|
33
2
|
import "eliscript/runtime/unicode-case.mjs";
|
|
34
3
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
35
4
|
|
|
36
5
|
const ObjectConstructor = globalThis.Object;
|
|
37
|
-
__eliscript_tdz_ready_0 = true;
|
|
38
6
|
const ObjectPrototype = (globalThis.Object)["prototype"];
|
|
39
|
-
__eliscript_tdz_ready_1 = true;
|
|
40
7
|
const ArrayConstructor = globalThis.Array;
|
|
41
|
-
__eliscript_tdz_ready_2 = true;
|
|
42
8
|
const ArrayPrototype = (globalThis.Array)["prototype"];
|
|
43
|
-
__eliscript_tdz_ready_3 = true;
|
|
44
9
|
const function_source = ((globalThis.Function)["prototype"])["toString"];
|
|
45
|
-
__eliscript_tdz_ready_4 = true;
|
|
46
10
|
const apply_function = (globalThis.Reflect)["apply"];
|
|
47
|
-
__eliscript_tdz_ready_5 = true;
|
|
48
11
|
const own_descriptor = (globalThis.Reflect)["getOwnPropertyDescriptor"];
|
|
49
|
-
__eliscript_tdz_ready_6 = true;
|
|
50
12
|
const object_intrinsics = ((methods) => {
|
|
51
|
-
if (__eliscript_truthy(authentic_native_method(
|
|
52
|
-
(methods)["push"](({"name": "object-constructor", "method":
|
|
13
|
+
if (__eliscript_truthy(authentic_native_method(ObjectConstructor, "Object"))) {
|
|
14
|
+
(methods)["push"](({"name": "object-constructor", "method": ObjectConstructor, "runtime": "value-native-constructor-call", "operation": 76, "constructObject": true}));
|
|
53
15
|
}
|
|
54
16
|
return methods;
|
|
55
17
|
})((["freeze", "isFrozen", "hasOwn", "getOwnPropertyDescriptor", "defineProperty", "defineProperties", "create", "getPrototypeOf"])["map"](((name) => {
|
|
56
18
|
{
|
|
57
|
-
let entry = Object.getOwnPropertyDescriptor(
|
|
19
|
+
let entry = Object.getOwnPropertyDescriptor(ObjectConstructor, name);
|
|
58
20
|
let method = (entry)["value"];
|
|
59
|
-
if (__eliscript_truthy(((__eliscript_value_1) => (__eliscript_truthy(__eliscript_value_1) ? (new (globalThis.RegExp)(("^function\\s+" + name + "\\s*\\(\\s*\\)\\s*\\{\\s*\\[native code\\]\\s*\\}$")))["test"]((
|
|
21
|
+
if (__eliscript_truthy(((__eliscript_value_1) => (__eliscript_truthy(__eliscript_value_1) ? (new (globalThis.RegExp)(("^function\\s+" + name + "\\s*\\(\\s*\\)\\s*\\{\\s*\\[native code\\]\\s*\\}$")))["test"](apply_function(function_source, method, [])) : __eliscript_value_1))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(method) === "function")))) {
|
|
60
22
|
return ({"name": name, "method": method});
|
|
61
23
|
} else {
|
|
62
24
|
return null;
|
|
63
25
|
}
|
|
64
26
|
}
|
|
65
27
|
})));
|
|
66
|
-
__eliscript_tdz_ready_7 = true;
|
|
67
28
|
function authentic_native_method(method, name) {
|
|
68
|
-
return ((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? (new (globalThis.RegExp)(("^function\\s+" + name + "\\s*\\(\\s*\\)\\s*\\{\\s*\\[native code\\]\\s*\\}$")))["test"]((
|
|
29
|
+
return ((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? (new (globalThis.RegExp)(("^function\\s+" + name + "\\s*\\(\\s*\\)\\s*\\{\\s*\\[native code\\]\\s*\\}$")))["test"](apply_function(function_source, method, [])) : __eliscript_value_2))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(method) === "function"));
|
|
69
30
|
}
|
|
70
31
|
const array_intrinsics = ((methods, values) => {
|
|
71
|
-
if (__eliscript_truthy(authentic_native_method(
|
|
72
|
-
(methods)["push"](({"name": "array-constructor", "method":
|
|
32
|
+
if (__eliscript_truthy(authentic_native_method(ArrayConstructor, "Array"))) {
|
|
33
|
+
(methods)["push"](({"name": "array-constructor", "method": ArrayConstructor, "runtime": "value-native-constructor-call", "operation": 75, "constructArray": true}));
|
|
73
34
|
}
|
|
74
35
|
{
|
|
75
|
-
let entry = Object.getOwnPropertyDescriptor(
|
|
36
|
+
let entry = Object.getOwnPropertyDescriptor(ArrayConstructor, "isArray");
|
|
76
37
|
let method = (__eliscript_truthy(entry) ? (entry)["value"] : null);
|
|
77
38
|
if (__eliscript_truthy(authentic_native_method(method, "isArray"))) {
|
|
78
39
|
(methods)["push"](({"name": "array-isArray", "method": method, "runtime": "value-builtin-primitive", "operation": 5}));
|
|
@@ -81,7 +42,7 @@ const array_intrinsics = ((methods, values) => {
|
|
|
81
42
|
([["push", 200], ["pop", 201], ["slice", 202], ["map", 203], ["filter", 204], ["forEach", 205], ["some", 206], ["every", 207], ["find", 208], ["findIndex", 209], ["findLast", 210], ["findLastIndex", 211], ["reduce", 212], ["reduceRight", 213], ["sort", 214], ["toSorted", 215], ["splice", 216], ["join", 217], ["toString", 218], ["concat", 219], ["includes", 220], ["indexOf", 221], ["lastIndexOf", 222], ["entries", 223], ["keys", 224], ["values", 225], ["at", 226], ["reverse", 227]])["forEach"](((specification) => {
|
|
82
43
|
{
|
|
83
44
|
let name = (specification)[0];
|
|
84
|
-
let entry = Object.getOwnPropertyDescriptor(
|
|
45
|
+
let entry = Object.getOwnPropertyDescriptor(ArrayPrototype, name);
|
|
85
46
|
let method = (__eliscript_truthy(entry) ? (entry)["value"] : null);
|
|
86
47
|
if (__eliscript_truthy(authentic_native_method(method, name))) {
|
|
87
48
|
(methods)["push"](({"name": ("array-" + name), "method": method, "runtime": "value-array-prototype-call", "operation": (specification)[1]}));
|
|
@@ -97,7 +58,7 @@ const array_intrinsics = ((methods, values) => {
|
|
|
97
58
|
}));
|
|
98
59
|
if (__eliscript_truthy(values)) {
|
|
99
60
|
{
|
|
100
|
-
let iterator = (
|
|
61
|
+
let iterator = apply_function(values, [], []);
|
|
101
62
|
let prototype = Object.getPrototypeOf(iterator);
|
|
102
63
|
let entry = Object.getOwnPropertyDescriptor(prototype, "next");
|
|
103
64
|
let method = (__eliscript_truthy(entry) ? (entry)["value"] : null);
|
|
@@ -108,7 +69,6 @@ const array_intrinsics = ((methods, values) => {
|
|
|
108
69
|
}
|
|
109
70
|
return methods;
|
|
110
71
|
})([], undefined);
|
|
111
|
-
__eliscript_tdz_ready_8 = true;
|
|
112
72
|
const reflect_intrinsics = ((methods) => {
|
|
113
73
|
([["get", 2], ["set", 3], ["getPrototypeOf", 1], ["setPrototypeOf", 2], ["ownKeys", 1], ["getOwnPropertyDescriptor", 2], ["defineProperty", 3], ["deleteProperty", 2], ["has", 2], ["isExtensible", 1], ["preventExtensions", 1], ["apply", 3], ["construct", 2]])["forEach"](((specification, operation) => {
|
|
114
74
|
{
|
|
@@ -124,31 +84,30 @@ const reflect_intrinsics = ((methods) => {
|
|
|
124
84
|
}));
|
|
125
85
|
return methods;
|
|
126
86
|
})([]);
|
|
127
|
-
__eliscript_tdz_ready_9 = true;
|
|
128
87
|
function readHostObjectConstructor() {
|
|
129
|
-
return
|
|
88
|
+
return ObjectConstructor;
|
|
130
89
|
}
|
|
131
90
|
function readHostObjectPrototype() {
|
|
132
|
-
return
|
|
91
|
+
return ObjectPrototype;
|
|
133
92
|
}
|
|
134
93
|
function readHostArrayConstructor() {
|
|
135
|
-
return
|
|
94
|
+
return ArrayConstructor;
|
|
136
95
|
}
|
|
137
96
|
function readHostArrayPrototype() {
|
|
138
|
-
return
|
|
97
|
+
return ArrayPrototype;
|
|
139
98
|
}
|
|
140
99
|
function readHostObjectIntrinsics() {
|
|
141
|
-
return
|
|
100
|
+
return object_intrinsics;
|
|
142
101
|
}
|
|
143
102
|
function readHostArrayIntrinsics() {
|
|
144
|
-
return
|
|
103
|
+
return array_intrinsics;
|
|
145
104
|
}
|
|
146
105
|
function readHostReflectIntrinsics() {
|
|
147
|
-
return
|
|
106
|
+
return reflect_intrinsics;
|
|
148
107
|
}
|
|
149
108
|
function hostObjectDescriptorPrototypeClear() {
|
|
150
109
|
return (["enumerable", "configurable", "value", "writable", "get", "set"])["every"](((name) => {
|
|
151
|
-
return ((
|
|
110
|
+
return (own_descriptor(ObjectPrototype, name) === undefined);
|
|
152
111
|
}));
|
|
153
112
|
}
|
|
154
113
|
export {ObjectConstructor, ObjectPrototype, readHostObjectConstructor, readHostObjectPrototype, readHostObjectIntrinsics, hostObjectDescriptorPrototypeClear, readHostArrayConstructor, readHostArrayPrototype, readHostArrayIntrinsics, readHostReflectIntrinsics};
|
|
@@ -1,97 +1,7 @@
|
|
|
1
1
|
// Generated by Eliscript. Do not edit.
|
|
2
2
|
import "eliscript/runtime/unicode-case.mjs";
|
|
3
|
-
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";
|
|
4
4
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
5
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
6
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
7
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
8
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
9
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
10
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
11
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
12
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
13
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
14
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
15
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
16
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
17
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
18
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
19
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
20
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
21
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
22
|
-
}
|
|
23
|
-
for (let index = 0; index < 2; index++) {
|
|
24
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
25
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
26
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
27
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
31
|
-
};
|
|
32
|
-
const __eliscript_to_number = (value) => {
|
|
33
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
34
|
-
if (typeof primitive === "string") {
|
|
35
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
36
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
37
|
-
let first = 2;
|
|
38
|
-
while (first < text.length && text[first] === "0") first++;
|
|
39
|
-
if (first === text.length) return 0;
|
|
40
|
-
const prefix = text[1];
|
|
41
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
42
|
-
if (text.length - first > limit) return 1 / 0;
|
|
43
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
44
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return __eliscript_number_intrinsic(primitive);
|
|
48
|
-
};
|
|
49
|
-
const __eliscript_numeric = (value) => {
|
|
50
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
51
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
52
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
53
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
54
|
-
};
|
|
55
|
-
const __eliscript_implicit_number = (value) => {
|
|
56
|
-
if (typeof value === "number") return value;
|
|
57
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
58
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
59
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
60
|
-
};
|
|
61
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
62
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
63
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
64
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
65
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
66
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
67
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
68
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
69
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
70
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
71
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
72
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
73
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
74
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
75
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
76
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
77
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
78
|
-
if (operator === "<") return left < right;
|
|
79
|
-
if (operator === "<=") return left <= right;
|
|
80
|
-
if (operator === ">") return left > right;
|
|
81
|
-
return left >= right;
|
|
82
|
-
}
|
|
83
|
-
let a = __eliscript_numeric_primitive(left);
|
|
84
|
-
let b = __eliscript_numeric_primitive(right);
|
|
85
|
-
const x = typeof a, y = typeof b;
|
|
86
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
87
|
-
a = __eliscript_numeric(a);
|
|
88
|
-
b = __eliscript_numeric(b);
|
|
89
|
-
}
|
|
90
|
-
if (operator === "<") return a < b;
|
|
91
|
-
if (operator === "<=") return a <= b;
|
|
92
|
-
if (operator === ">") return a > b;
|
|
93
|
-
return a >= b;
|
|
94
|
-
};
|
|
95
5
|
|
|
96
6
|
import {readHostObjectConstructor, readHostObjectPrototype, readHostObjectIntrinsics, hostObjectDescriptorPrototypeClear, readHostArrayConstructor, readHostArrayPrototype, readHostArrayIntrinsics, readHostReflectIntrinsics} from "./managed-host-object-provider.mjs";
|
|
97
7
|
import {failManagedRuntime} from "./managed-host-legacy.mjs";
|
|
@@ -1,26 +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("proxy_predicate"); return proxy_predicate; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("proxy_predicate"); return (proxy_predicate = __eliscript_tdz_value_0); }
|
|
6
|
-
var __eliscript_tdz_ready_1;
|
|
7
|
-
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("pending"); return pending; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("pending"); return (pending = __eliscript_tdz_value_1); }
|
|
9
2
|
import "eliscript/runtime/unicode-case.mjs";
|
|
10
|
-
import {
|
|
3
|
+
import { __eliscript_at, __eliscript_at_direct } from "eliscript/runtime/prelude.mjs";
|
|
11
4
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
12
5
|
|
|
13
6
|
let proxy_predicate = undefined;
|
|
14
|
-
__eliscript_tdz_ready_0 = true;
|
|
15
7
|
let pending = undefined;
|
|
16
|
-
__eliscript_tdz_ready_1 = true;
|
|
17
8
|
function read_host_proxy_predicate(namespace) {
|
|
18
9
|
{
|
|
19
10
|
const __eliscript_value_1 = (__eliscript_truthy(namespace) ? (namespace)["isProxy"] : null);
|
|
20
11
|
{
|
|
21
12
|
let predicate = __eliscript_value_1;
|
|
22
13
|
if ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(predicate) === "function")) {
|
|
23
|
-
return (
|
|
14
|
+
return ((proxy_predicate = predicate));
|
|
24
15
|
} else {
|
|
25
16
|
return null;
|
|
26
17
|
}
|
|
@@ -28,7 +19,7 @@ function read_host_proxy_predicate(namespace) {
|
|
|
28
19
|
}
|
|
29
20
|
}
|
|
30
21
|
function prepareManagedHostProxyClassifierSync() {
|
|
31
|
-
if ((!__eliscript_truthy(
|
|
22
|
+
if ((!__eliscript_truthy(proxy_predicate))) {
|
|
32
23
|
{
|
|
33
24
|
let process = (globalThis.globalThis)["process"];
|
|
34
25
|
let builtin = (__eliscript_truthy(process) ? (process)["getBuiltinModule"] : null);
|
|
@@ -43,12 +34,12 @@ function prepareManagedHostProxyClassifierSync() {
|
|
|
43
34
|
}
|
|
44
35
|
}
|
|
45
36
|
}
|
|
46
|
-
return (!(
|
|
37
|
+
return (!(proxy_predicate === undefined));
|
|
47
38
|
}
|
|
48
39
|
async function prepareManagedHostProxyClassifier(load) {
|
|
49
40
|
((!__eliscript_truthy(prepareManagedHostProxyClassifierSync())) ? (__eliscript_truthy((globalThis.globalThis)["process"]) ? (await (async () => {
|
|
50
|
-
if ((!__eliscript_truthy(
|
|
51
|
-
(
|
|
41
|
+
if ((!__eliscript_truthy(pending))) {
|
|
42
|
+
((pending = ((async () => {
|
|
52
43
|
return (await (async () => {
|
|
53
44
|
try {
|
|
54
45
|
return ((modules) => {
|
|
@@ -60,12 +51,12 @@ async function prepareManagedHostProxyClassifier(load) {
|
|
|
60
51
|
})());
|
|
61
52
|
}))()));
|
|
62
53
|
}
|
|
63
|
-
return await (
|
|
54
|
+
return await (pending);
|
|
64
55
|
})()) : null) : null);
|
|
65
|
-
return (!(
|
|
56
|
+
return (!(proxy_predicate === undefined));
|
|
66
57
|
}
|
|
67
58
|
function isManagedHostProxy(value) {
|
|
68
|
-
return ((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? (
|
|
59
|
+
return ((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? proxy_predicate(value) : __eliscript_value_2))(prepareManagedHostProxyClassifierSync());
|
|
69
60
|
}
|
|
70
61
|
export {prepareManagedHostProxyClassifier, prepareManagedHostProxyClassifierSync, isManagedHostProxy};
|
|
71
62
|
//# sourceMappingURL=managed-host-proxy.mjs.map
|