@nimbus-sh/worker 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esbuild-cli-artifact.generated.d.ts +1 -1
- package/dist/esbuild-cli-artifact.generated.js +4 -4
- package/dist/esbuild-wasm-bundle.generated.d.ts +11 -10
- package/dist/esbuild-wasm-bundle.generated.d.ts.map +1 -1
- package/dist/esbuild-wasm-bundle.generated.js +11 -10
- package/dist/facets/build-facet.d.ts +53 -0
- package/dist/facets/build-facet.d.ts.map +1 -0
- package/dist/facets/build-facet.js +346 -0
- package/dist/facets/cirrus-real.d.ts +3 -0
- package/dist/facets/cirrus-real.d.ts.map +1 -1
- package/dist/facets/cirrus-real.js +1 -2
- package/dist/facets/compose.d.ts +1 -0
- package/dist/facets/compose.d.ts.map +1 -1
- package/dist/facets/compose.js +3 -0
- package/dist/facets/data-plan.d.ts +14 -30
- package/dist/facets/data-plan.d.ts.map +1 -1
- package/dist/facets/data-plan.js +153 -13
- package/dist/facets/dev-stylesheet.d.ts +27 -0
- package/dist/facets/dev-stylesheet.d.ts.map +1 -0
- package/dist/facets/dev-stylesheet.js +65 -0
- package/dist/facets/esbuild-transform.d.ts +23 -18
- package/dist/facets/esbuild-transform.d.ts.map +1 -1
- package/dist/facets/esbuild-transform.js +63 -109
- package/dist/facets/manager.d.ts +49 -9
- package/dist/facets/manager.d.ts.map +1 -1
- package/dist/facets/manager.js +238 -69
- package/dist/facets/oxc-transform.d.ts +29 -0
- package/dist/facets/oxc-transform.d.ts.map +1 -0
- package/dist/facets/oxc-transform.js +198 -0
- package/dist/facets/prebundle-pool.d.ts +23 -0
- package/dist/facets/prebundle-pool.d.ts.map +1 -0
- package/dist/facets/prebundle-pool.js +55 -0
- package/dist/facets/process.d.ts +13 -6
- package/dist/facets/process.d.ts.map +1 -1
- package/dist/facets/process.js +37 -31
- package/dist/facets/transform-store.d.ts +4 -4
- package/dist/facets/transform-store.js +4 -4
- package/dist/facets/vite-dev-server.d.ts +89 -12
- package/dist/facets/vite-dev-server.d.ts.map +1 -1
- package/dist/facets/vite-dev-server.js +66 -43
- package/dist/hosted/commands.d.ts.map +1 -1
- package/dist/hosted/commands.js +20 -4
- package/dist/hosted/runtime.d.ts.map +1 -1
- package/dist/hosted/runtime.js +7 -2
- package/dist/hosted/services.d.ts +3 -3
- package/dist/hosted/services.d.ts.map +1 -1
- package/dist/hosted/services.js +102 -95
- package/dist/hosted/session.d.ts +1 -0
- package/dist/hosted/session.d.ts.map +1 -1
- package/dist/loaders/generated-workers.d.ts +3 -0
- package/dist/loaders/generated-workers.d.ts.map +1 -1
- package/dist/loaders/generated-workers.js +3 -0
- package/dist/napi-wasm-artifacts.generated.js +2 -2
- package/dist/node-shims-artifact.generated.d.ts +14 -1
- package/dist/node-shims-artifact.generated.d.ts.map +1 -1
- package/dist/node-shims-artifact.generated.js +23 -10
- package/dist/npm/bin-links.d.ts +7 -4
- package/dist/npm/bin-links.d.ts.map +1 -1
- package/dist/npm/bin-links.js +14 -55
- package/dist/npm/cache.d.ts +6 -0
- package/dist/npm/cache.d.ts.map +1 -1
- package/dist/npm/cache.js +26 -4
- package/dist/npm/installer.d.ts +1 -1
- package/dist/npm/installer.d.ts.map +1 -1
- package/dist/npm/installer.js +26 -52
- package/dist/npm/pre-bundle-facet.d.ts +15 -117
- package/dist/npm/pre-bundle-facet.d.ts.map +1 -1
- package/dist/npm/pre-bundle-facet.js +13 -511
- package/dist/oxc-facet-artifact.generated.d.ts +18 -0
- package/dist/oxc-facet-artifact.generated.d.ts.map +1 -0
- package/dist/oxc-facet-artifact.generated.js +17 -0
- package/dist/oxc-wasm-artifact.generated.d.ts +20 -0
- package/dist/oxc-wasm-artifact.generated.d.ts.map +1 -0
- package/dist/oxc-wasm-artifact.generated.js +19 -0
- package/dist/rolldown-facet-artifact.generated.d.ts +18 -0
- package/dist/rolldown-facet-artifact.generated.d.ts.map +1 -0
- package/dist/rolldown-facet-artifact.generated.js +17 -0
- package/dist/router/remote-api.d.ts.map +1 -1
- package/dist/router/remote-api.js +9 -0
- package/dist/runtime/bash-repl.d.ts.map +1 -1
- package/dist/runtime/bash-repl.js +1 -4
- package/dist/runtime/cpython-resident.d.ts.map +1 -1
- package/dist/runtime/cpython-resident.js +1 -0
- package/dist/runtime/esbuild-wasm-bytes.d.ts +25 -23
- package/dist/runtime/esbuild-wasm-bytes.d.ts.map +1 -1
- package/dist/runtime/esbuild-wasm-bytes.js +30 -25
- package/dist/runtime/facet-loader-host.d.ts +5 -4
- package/dist/runtime/facet-loader-host.d.ts.map +1 -1
- package/dist/runtime/facet-loader-host.js +5 -4
- package/dist/runtime/node-runner.d.ts +2 -0
- package/dist/runtime/node-runner.d.ts.map +1 -1
- package/dist/runtime/node-runner.js +1 -0
- package/dist/runtime/node-shims-artifact.d.ts +8 -1
- package/dist/runtime/node-shims-artifact.d.ts.map +1 -1
- package/dist/runtime/node-shims-artifact.js +32 -4
- package/dist/runtime/node-shims.d.ts.map +1 -1
- package/dist/runtime/node-shims.js +145 -109
- package/dist/runtime/opencode-facet-runner.d.ts.map +1 -1
- package/dist/runtime/opencode-facet-runner.js +6 -2
- package/dist/runtime/oxc-wasm-bytes.d.ts +19 -0
- package/dist/runtime/oxc-wasm-bytes.d.ts.map +1 -0
- package/dist/runtime/oxc-wasm-bytes.js +39 -0
- package/dist/runtime/package-manager.js +1 -1
- package/dist/runtime/process-logs-api.d.ts.map +1 -1
- package/dist/runtime/process-logs-api.js +2 -0
- package/dist/runtime/project-fs.d.ts +8 -1
- package/dist/runtime/project-fs.d.ts.map +1 -1
- package/dist/runtime/project-fs.js +15 -1
- package/dist/runtime/python-repl.d.ts +40 -1
- package/dist/runtime/python-repl.d.ts.map +1 -1
- package/dist/runtime/python-repl.js +19 -11
- package/dist/runtime/ruby-repl.d.ts +38 -0
- package/dist/runtime/ruby-repl.d.ts.map +1 -1
- package/dist/runtime/ruby-repl.js +24 -5
- package/dist/runtime/ruby-resident.d.ts.map +1 -1
- package/dist/runtime/ruby-resident.js +2 -0
- package/dist/session/nimbus-session.d.ts +13 -8
- package/dist/session/nimbus-session.d.ts.map +1 -1
- package/dist/session/nimbus-session.js +11 -5
- package/dist/session/programmatic.d.ts +25 -30
- package/dist/session/programmatic.d.ts.map +1 -1
- package/dist/session/programmatic.js +65 -93
- package/dist/session/routes.d.ts.map +1 -1
- package/dist/session/routes.js +23 -7
- package/dist/session/rpc.d.ts +16 -6
- package/dist/session/rpc.d.ts.map +1 -1
- package/dist/session/rpc.js +53 -13
- package/dist/session/start-real-vite.d.ts +24 -9
- package/dist/session/start-real-vite.d.ts.map +1 -1
- package/dist/session/start-real-vite.js +40 -4
- package/dist/session/supervisor-op.d.ts +14 -0
- package/dist/session/supervisor-op.d.ts.map +1 -1
- package/dist/session/supervisor-op.js +49 -0
- package/dist/session/supervisor-rpc.d.ts +11 -0
- package/dist/session/supervisor-rpc.d.ts.map +1 -1
- package/dist/session/supervisor-rpc.js +18 -0
- package/dist/session/vite-command.d.ts.map +1 -1
- package/dist/session/vite-command.js +23 -19
- package/dist/session/ws-relay.d.ts.map +1 -1
- package/dist/session/ws-relay.js +13 -1
- package/dist/shell/npm-bin-entrypoints.d.ts +3 -1
- package/dist/shell/npm-bin-entrypoints.d.ts.map +1 -1
- package/dist/shell/npm-bin-entrypoints.js +53 -25
- package/dist/vfs/facet-resident-store.d.ts.map +1 -1
- package/dist/vfs/facet-resident-store.js +11 -5
- package/dist/wrangler/nimbus-wrangler.d.ts +8 -0
- package/dist/wrangler/nimbus-wrangler.d.ts.map +1 -1
- package/dist/wrangler/nimbus-wrangler.js +54 -57
- package/package.json +6 -4
- package/public/_assets/esbuild-0.24.2.wasm +0 -0
- package/public/_assets/napi-wasm/loader/{99efae93dd1dcc2b → ab7e57fe9e8750c2}/napi-wasm-loader.mjs +4 -4
- package/public/_assets/napi-wasm/loader/{99efae93dd1dcc2b → ab7e57fe9e8750c2}/provenance.json +2 -2
- package/public/_assets/oxc/nimbus-oxc-1aa8c4c7057c6c28.provenance.json +72 -0
- package/public/_assets/oxc/nimbus-oxc-1aa8c4c7057c6c28.wasm +0 -0
- package/public/_assets/runtime/esbuild-cli-f13e6a112b03ac07.js +1143 -0
- package/public/_assets/runtime/js-interpreter-3c37c48024f0f651.js +23 -0
- package/public/_assets/runtime/js-interpreter-ops-2f4dfec6798e70fc.js +290 -0
- package/public/_assets/runtime/js-interpreter-primordials-e620a61b7e9800fa.js +1 -0
- package/public/_assets/runtime/{node-shims-f92f16c7d7c532e9.js → node-shims-e3adc4576da31e6e.js} +651 -103
- package/public/_assets/runtime/{esbuild-cli-b7aecffd4c6a36fe.js → oxc-facet-fd86fefcdf16bf9c.js} +217 -1047
- package/public/_assets/runtime/{resident-store-92386265e8b306dc.js → resident-store-009f39539ac989fc.js} +11 -5
- package/public/_assets/runtime/rolldown-facet-09983434e2dbe93e.js +15165 -0
- package/public/_assets/runtime/{vfs-write-ledger-d33ee0034446c3e0.js → vfs-write-ledger-9e9594591425a9b8.js} +4 -1
- package/scripts/acorn-primordials.mjs +637 -0
- package/scripts/bundle-esbuild-wasm.mjs +42 -50
- package/scripts/bundle-facet-workers.mjs +247 -18
- package/scripts/bundle-node-shims.mjs +29 -2
- package/scripts/bundle-oxc-wasm.mjs +105 -0
- package/scripts/interpreter-bundle.mjs +105 -0
- package/scripts/napi-wasm/build.mjs +4 -1
- package/scripts/napi-wasm/loader/napi-wasm-loader.ts +38 -3
- package/scripts/oxc-wasm/Cargo.lock +1246 -0
- package/scripts/oxc-wasm/Cargo.toml +30 -0
- package/scripts/oxc-wasm/build.mjs +249 -0
- package/scripts/oxc-wasm/examples/memory.rs +51 -0
- package/scripts/oxc-wasm/examples/transform.rs +20 -0
- package/scripts/oxc-wasm/inputs.mjs +32 -0
- package/scripts/oxc-wasm/rust-toolchain.toml +5 -0
- package/scripts/oxc-wasm/src/abi.rs +136 -0
- package/scripts/oxc-wasm/src/diagnostics.rs +49 -0
- package/scripts/oxc-wasm/src/helpers.rs +139 -0
- package/scripts/oxc-wasm/src/lib.rs +247 -0
- package/scripts/oxc-wasm/src/module.rs +978 -0
- package/scripts/oxc-wasm/src/names.rs +175 -0
- package/scripts/oxc-wasm/src/options.rs +154 -0
- package/scripts/parser-audit.mjs +492 -0
- package/scripts/rolldown-facet/entry.mjs +21 -0
- package/scripts/rolldown-facet/shims.mjs +64 -0
- package/dist/facets/esbuild-bundle-pool.d.ts +0 -43
- package/dist/facets/esbuild-bundle-pool.d.ts.map +0 -1
- package/dist/facets/esbuild-bundle-pool.js +0 -80
- package/dist/loaders/pre-bundle-preamble.d.ts +0 -44
- package/dist/loaders/pre-bundle-preamble.d.ts.map +0 -1
- package/dist/loaders/pre-bundle-preamble.js +0 -116
- package/dist/runtime/host-wasm.d.ts +0 -8
- package/dist/runtime/host-wasm.d.ts.map +0 -1
- package/dist/runtime/host-wasm.js +0 -33
- /package/public/_assets/napi-wasm/loader/{99efae93dd1dcc2b → ab7e57fe9e8750c2}/wasi-trampoline.wasm +0 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
|
|
2
|
+
const operators = (function () {
|
|
3
|
+
"use strict";
|
|
4
|
+
return (ownKeys) => ({
|
|
5
|
+
add: (a, b) => a + b,
|
|
6
|
+
sub: (a, b) => a - b,
|
|
7
|
+
mul: (a, b) => a * b,
|
|
8
|
+
div: (a, b) => a / b,
|
|
9
|
+
mod: (a, b) => a % b,
|
|
10
|
+
exp: (a, b) => a ** b,
|
|
11
|
+
shl: (a, b) => a << b,
|
|
12
|
+
shr: (a, b) => a >> b,
|
|
13
|
+
ushr: (a, b) => a >>> b,
|
|
14
|
+
and: (a, b) => a & b,
|
|
15
|
+
or: (a, b) => a | b,
|
|
16
|
+
xor: (a, b) => a ^ b,
|
|
17
|
+
lt: (a, b) => a < b,
|
|
18
|
+
gt: (a, b) => a > b,
|
|
19
|
+
le: (a, b) => a <= b,
|
|
20
|
+
ge: (a, b) => a >= b,
|
|
21
|
+
has: (k, o) => k in o,
|
|
22
|
+
instanceOf: (v, c) => v instanceof c,
|
|
23
|
+
neg: (a) => -a,
|
|
24
|
+
plus: (a) => +a,
|
|
25
|
+
bitNot: (a) => ~a,
|
|
26
|
+
numeric: (v) => { let x = v; return x++; },
|
|
27
|
+
increment: (n) => { let x = n; return ++x; },
|
|
28
|
+
decrement: (n) => { let x = n; return --x; },
|
|
29
|
+
propertyKey: (v) => ownKeys({ [v]: 0 })[0],
|
|
30
|
+
get: (o, k) => o[k],
|
|
31
|
+
set: (o, k, v) => { o[k] = v; },
|
|
32
|
+
remove: (o, k) => delete o[k],
|
|
33
|
+
});
|
|
34
|
+
})();
|
|
35
|
+
function hostOperators(rt) {
|
|
36
|
+
const g = rt.global, hasOwn = rt.hasOwn;
|
|
37
|
+
const globals = { __proto__: null, "Object": () => g.Object, "Function": () => g.Function, "Array": () => g.Array, "Number": () => g.Number, "String": () => g.String, "Boolean": () => g.Boolean, "Symbol": () => g.Symbol, "BigInt": () => g.BigInt, "Math": () => g.Math, "JSON": () => g.JSON, "Date": () => g.Date, "RegExp": () => g.RegExp, "Error": () => g.Error, "TypeError": () => g.TypeError, "RangeError": () => g.RangeError, "SyntaxError": () => g.SyntaxError, "ReferenceError": () => g.ReferenceError, "EvalError": () => g.EvalError, "URIError": () => g.URIError, "AggregateError": () => g.AggregateError, "Promise": () => g.Promise, "Proxy": () => g.Proxy, "Reflect": () => g.Reflect, "Map": () => g.Map, "Set": () => g.Set, "WeakMap": () => g.WeakMap, "WeakSet": () => g.WeakSet, "WeakRef": () => g.WeakRef, "FinalizationRegistry": () => g.FinalizationRegistry, "ArrayBuffer": () => g.ArrayBuffer, "SharedArrayBuffer": () => g.SharedArrayBuffer, "DataView": () => g.DataView, "Uint8Array": () => g.Uint8Array, "Int8Array": () => g.Int8Array, "Uint16Array": () => g.Uint16Array, "Int16Array": () => g.Int16Array, "Uint32Array": () => g.Uint32Array, "Int32Array": () => g.Int32Array, "Float32Array": () => g.Float32Array, "Float64Array": () => g.Float64Array, "BigInt64Array": () => g.BigInt64Array, "BigUint64Array": () => g.BigUint64Array, "Uint8ClampedArray": () => g.Uint8ClampedArray, "Intl": () => g.Intl, "Atomics": () => g.Atomics, "globalThis": () => g.globalThis, "undefined": () => g.undefined, "NaN": () => g.NaN, "Infinity": () => g.Infinity, "isNaN": () => g.isNaN, "isFinite": () => g.isFinite, "parseInt": () => g.parseInt, "parseFloat": () => g.parseFloat, "encodeURIComponent": () => g.encodeURIComponent, "decodeURIComponent": () => g.decodeURIComponent, "encodeURI": () => g.encodeURI, "decodeURI": () => g.decodeURI, "escape": () => g.escape, "unescape": () => g.unescape, "console": () => g.console, "process": () => g.process, "Buffer": () => g.Buffer, "setTimeout": () => g.setTimeout, "clearTimeout": () => g.clearTimeout, "setInterval": () => g.setInterval, "clearInterval": () => g.clearInterval, "setImmediate": () => g.setImmediate, "clearImmediate": () => g.clearImmediate, "queueMicrotask": () => g.queueMicrotask, "structuredClone": () => g.structuredClone, "fetch": () => g.fetch, "Request": () => g.Request, "Response": () => g.Response, "Headers": () => g.Headers, "URL": () => g.URL, "URLSearchParams": () => g.URLSearchParams, "TextEncoder": () => g.TextEncoder, "TextDecoder": () => g.TextDecoder, "AbortController": () => g.AbortController, "AbortSignal": () => g.AbortSignal, "Event": () => g.Event, "EventTarget": () => g.EventTarget, "crypto": () => g.crypto, "performance": () => g.performance, "atob": () => g.atob, "btoa": () => g.btoa, "Blob": () => g.Blob, "FormData": () => g.FormData, "ReadableStream": () => g.ReadableStream, "WritableStream": () => g.WritableStream, "TransformStream": () => g.TransformStream, "WebAssembly": () => g.WebAssembly, "navigator": () => g.navigator, "require": () => g.require, "module": () => g.module, "exports": () => g.exports, "__filename": () => g.__filename, "__dirname": () => g.__dirname };
|
|
38
|
+
const delegate = function* (iterable) { return yield* iterable; };
|
|
39
|
+
delegate.prototype = rt.SafeGeneratorPrototype;
|
|
40
|
+
// Every field in the literal: one set afterwards would run a setter a program put on Object.prototype.
|
|
41
|
+
return {
|
|
42
|
+
...operators(rt.ownKeys),
|
|
43
|
+
globalReader: (name) => (hasOwn(globals, name) ? globals[name] : undefined),
|
|
44
|
+
setSloppy: function (o, k, v) { o[k] = v; },
|
|
45
|
+
removeSloppy: function (o, k) { return delete o[k]; },
|
|
46
|
+
delegate,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function sloppy(rt) {
|
|
50
|
+
const { call, arrow: callArrow, enter, enterGenerator, takeFrame, finish, construct, constructDerived, operand, AWAIT, YIELD, MARK } = rt;
|
|
51
|
+
// Drives an async generator body from a state the consumer's return()
|
|
52
|
+
// request left suspended (a finally block that awaits or yields). Returns
|
|
53
|
+
// the body's final completion: MARK when it let the return proceed.
|
|
54
|
+
async function* drain(it, r) {
|
|
55
|
+
for (;;) {
|
|
56
|
+
if (r.done) return r.value;
|
|
57
|
+
const mark = r.value, x = operand();
|
|
58
|
+
let value, ok = true;
|
|
59
|
+
if (mark === AWAIT) {
|
|
60
|
+
try { value = await x; } catch (e) { ok = false; value = e; }
|
|
61
|
+
} else {
|
|
62
|
+
let resumed = false;
|
|
63
|
+
try { value = mark === YIELD ? yield x : yield* x; resumed = true; }
|
|
64
|
+
catch (e) { ok = false; value = e; resumed = true; }
|
|
65
|
+
finally {
|
|
66
|
+
if (!resumed) {
|
|
67
|
+
const end = it.return(MARK);
|
|
68
|
+
const result = end.done ? end.value : yield* drain(it, end);
|
|
69
|
+
if (result !== MARK) return result;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
r = ok ? it.next(value) : it.throw(value);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
drain.prototype = rt.SafeAsyncGeneratorPrototype;
|
|
77
|
+
return {
|
|
78
|
+
plain(fi, scope) {
|
|
79
|
+
const f = (0, function () { return call(fi, scope, f, this, arguments, new.target, undefined); });
|
|
80
|
+
return f;
|
|
81
|
+
},
|
|
82
|
+
method(fi, scope, home) {
|
|
83
|
+
const f = { m() { return call(fi, scope, f, this, arguments, undefined, home); } }.m;
|
|
84
|
+
return f;
|
|
85
|
+
},
|
|
86
|
+
arrow(fi, scope) {
|
|
87
|
+
return (...args) => callArrow(fi, scope, args);
|
|
88
|
+
},
|
|
89
|
+
generator(fi, scope, home) {
|
|
90
|
+
const f = (0, function* (...{ [enterGenerator(fi, scope, f, this, arguments, home)]: length }) {
|
|
91
|
+
const env = takeFrame(arguments);
|
|
92
|
+
return finish(fi, fi.body ? fi.body(env) : yield* fi.gen(env));
|
|
93
|
+
});
|
|
94
|
+
return f;
|
|
95
|
+
},
|
|
96
|
+
async(fi, scope, home) {
|
|
97
|
+
const f = (0, async function () {
|
|
98
|
+
const env = enter(fi, scope, f, this, arguments, undefined, home);
|
|
99
|
+
if (fi.body) return finish(fi, fi.body(env));
|
|
100
|
+
const it = fi.gen(env);
|
|
101
|
+
let r = it.next();
|
|
102
|
+
while (!r.done) {
|
|
103
|
+
let value, ok = true;
|
|
104
|
+
try { value = await r.value; } catch (e) { ok = false; value = e; }
|
|
105
|
+
r = ok ? it.next(value) : it.throw(value);
|
|
106
|
+
}
|
|
107
|
+
return finish(fi, r.value);
|
|
108
|
+
});
|
|
109
|
+
return f;
|
|
110
|
+
},
|
|
111
|
+
asyncArrow(fi, scope) {
|
|
112
|
+
return async (...args) => {
|
|
113
|
+
const env = enter(fi, scope, undefined, undefined, args, undefined, undefined);
|
|
114
|
+
if (fi.body) return finish(fi, fi.body(env));
|
|
115
|
+
const it = fi.gen(env);
|
|
116
|
+
let r = it.next();
|
|
117
|
+
while (!r.done) {
|
|
118
|
+
let value, ok = true;
|
|
119
|
+
try { value = await r.value; } catch (e) { ok = false; value = e; }
|
|
120
|
+
r = ok ? it.next(value) : it.throw(value);
|
|
121
|
+
}
|
|
122
|
+
return finish(fi, r.value);
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
// The body yields AWAIT, YIELD or DELEGATE with its operand beside it. A
|
|
126
|
+
// return() request at a yield is a return completion this frame cannot
|
|
127
|
+
// read the value of, so the body is returned with MARK: if its finally
|
|
128
|
+
// blocks leave MARK alone, the native return proceeds with its own value.
|
|
129
|
+
asyncGenerator(fi, scope, home) {
|
|
130
|
+
const f = (0, async function* (...{ [enterGenerator(fi, scope, f, this, arguments, home)]: length }) {
|
|
131
|
+
const env = takeFrame(arguments);
|
|
132
|
+
if (fi.body) return finish(fi, fi.body(env));
|
|
133
|
+
const it = fi.gen(env);
|
|
134
|
+
let r = it.next();
|
|
135
|
+
for (;;) {
|
|
136
|
+
if (r.done) return finish(fi, r.value);
|
|
137
|
+
const mark = r.value, x = operand();
|
|
138
|
+
let value, ok = true;
|
|
139
|
+
if (mark === AWAIT) {
|
|
140
|
+
try { value = await x; } catch (e) { ok = false; value = e; }
|
|
141
|
+
} else {
|
|
142
|
+
let resumed = false;
|
|
143
|
+
try { value = mark === YIELD ? yield x : yield* x; resumed = true; }
|
|
144
|
+
catch (e) { ok = false; value = e; resumed = true; }
|
|
145
|
+
finally {
|
|
146
|
+
if (!resumed) {
|
|
147
|
+
const end = it.return(MARK);
|
|
148
|
+
const result = end.done ? end.value : yield* drain(it, end);
|
|
149
|
+
if (result !== MARK) return finish(fi, result);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
r = ok ? it.next(value) : it.throw(value);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
return f;
|
|
157
|
+
},
|
|
158
|
+
classBase(fi, scope, record) {
|
|
159
|
+
const C = (0, class { constructor() { return construct(fi, scope, C, record, this, arguments, new.target); } });
|
|
160
|
+
return C;
|
|
161
|
+
},
|
|
162
|
+
classDerived(fi, scope, parent, record) {
|
|
163
|
+
const C = (0, class extends parent { constructor() { return constructDerived(fi, scope, C, record, arguments, new.target); } });
|
|
164
|
+
return C;
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const strict = (function () {
|
|
169
|
+
"use strict";
|
|
170
|
+
return function (rt) {
|
|
171
|
+
const { call, arrow: callArrow, enter, enterGenerator, takeFrame, finish, construct, constructDerived, operand, AWAIT, YIELD, MARK } = rt;
|
|
172
|
+
// Drives an async generator body from a state the consumer's return()
|
|
173
|
+
// request left suspended (a finally block that awaits or yields). Returns
|
|
174
|
+
// the body's final completion: MARK when it let the return proceed.
|
|
175
|
+
async function* drain(it, r) {
|
|
176
|
+
for (;;) {
|
|
177
|
+
if (r.done) return r.value;
|
|
178
|
+
const mark = r.value, x = operand();
|
|
179
|
+
let value, ok = true;
|
|
180
|
+
if (mark === AWAIT) {
|
|
181
|
+
try { value = await x; } catch (e) { ok = false; value = e; }
|
|
182
|
+
} else {
|
|
183
|
+
let resumed = false;
|
|
184
|
+
try { value = mark === YIELD ? yield x : yield* x; resumed = true; }
|
|
185
|
+
catch (e) { ok = false; value = e; resumed = true; }
|
|
186
|
+
finally {
|
|
187
|
+
if (!resumed) {
|
|
188
|
+
const end = it.return(MARK);
|
|
189
|
+
const result = end.done ? end.value : yield* drain(it, end);
|
|
190
|
+
if (result !== MARK) return result;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
r = ok ? it.next(value) : it.throw(value);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
drain.prototype = rt.SafeAsyncGeneratorPrototype;
|
|
198
|
+
return {
|
|
199
|
+
plain(fi, scope) {
|
|
200
|
+
const f = (0, function () { return call(fi, scope, f, this, arguments, new.target, undefined); });
|
|
201
|
+
return f;
|
|
202
|
+
},
|
|
203
|
+
method(fi, scope, home) {
|
|
204
|
+
const f = { m() { return call(fi, scope, f, this, arguments, undefined, home); } }.m;
|
|
205
|
+
return f;
|
|
206
|
+
},
|
|
207
|
+
arrow(fi, scope) {
|
|
208
|
+
return (...args) => callArrow(fi, scope, args);
|
|
209
|
+
},
|
|
210
|
+
generator(fi, scope, home) {
|
|
211
|
+
const f = (0, function* (...{ [enterGenerator(fi, scope, f, this, arguments, home)]: length }) {
|
|
212
|
+
const env = takeFrame(arguments);
|
|
213
|
+
return finish(fi, fi.body ? fi.body(env) : yield* fi.gen(env));
|
|
214
|
+
});
|
|
215
|
+
return f;
|
|
216
|
+
},
|
|
217
|
+
async(fi, scope, home) {
|
|
218
|
+
const f = (0, async function () {
|
|
219
|
+
const env = enter(fi, scope, f, this, arguments, undefined, home);
|
|
220
|
+
if (fi.body) return finish(fi, fi.body(env));
|
|
221
|
+
const it = fi.gen(env);
|
|
222
|
+
let r = it.next();
|
|
223
|
+
while (!r.done) {
|
|
224
|
+
let value, ok = true;
|
|
225
|
+
try { value = await r.value; } catch (e) { ok = false; value = e; }
|
|
226
|
+
r = ok ? it.next(value) : it.throw(value);
|
|
227
|
+
}
|
|
228
|
+
return finish(fi, r.value);
|
|
229
|
+
});
|
|
230
|
+
return f;
|
|
231
|
+
},
|
|
232
|
+
asyncArrow(fi, scope) {
|
|
233
|
+
return async (...args) => {
|
|
234
|
+
const env = enter(fi, scope, undefined, undefined, args, undefined, undefined);
|
|
235
|
+
if (fi.body) return finish(fi, fi.body(env));
|
|
236
|
+
const it = fi.gen(env);
|
|
237
|
+
let r = it.next();
|
|
238
|
+
while (!r.done) {
|
|
239
|
+
let value, ok = true;
|
|
240
|
+
try { value = await r.value; } catch (e) { ok = false; value = e; }
|
|
241
|
+
r = ok ? it.next(value) : it.throw(value);
|
|
242
|
+
}
|
|
243
|
+
return finish(fi, r.value);
|
|
244
|
+
};
|
|
245
|
+
},
|
|
246
|
+
// The body yields AWAIT, YIELD or DELEGATE with its operand beside it. A
|
|
247
|
+
// return() request at a yield is a return completion this frame cannot
|
|
248
|
+
// read the value of, so the body is returned with MARK: if its finally
|
|
249
|
+
// blocks leave MARK alone, the native return proceeds with its own value.
|
|
250
|
+
asyncGenerator(fi, scope, home) {
|
|
251
|
+
const f = (0, async function* (...{ [enterGenerator(fi, scope, f, this, arguments, home)]: length }) {
|
|
252
|
+
const env = takeFrame(arguments);
|
|
253
|
+
if (fi.body) return finish(fi, fi.body(env));
|
|
254
|
+
const it = fi.gen(env);
|
|
255
|
+
let r = it.next();
|
|
256
|
+
for (;;) {
|
|
257
|
+
if (r.done) return finish(fi, r.value);
|
|
258
|
+
const mark = r.value, x = operand();
|
|
259
|
+
let value, ok = true;
|
|
260
|
+
if (mark === AWAIT) {
|
|
261
|
+
try { value = await x; } catch (e) { ok = false; value = e; }
|
|
262
|
+
} else {
|
|
263
|
+
let resumed = false;
|
|
264
|
+
try { value = mark === YIELD ? yield x : yield* x; resumed = true; }
|
|
265
|
+
catch (e) { ok = false; value = e; resumed = true; }
|
|
266
|
+
finally {
|
|
267
|
+
if (!resumed) {
|
|
268
|
+
const end = it.return(MARK);
|
|
269
|
+
const result = end.done ? end.value : yield* drain(it, end);
|
|
270
|
+
if (result !== MARK) return finish(fi, result);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
r = ok ? it.next(value) : it.throw(value);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
return f;
|
|
278
|
+
},
|
|
279
|
+
classBase(fi, scope, record) {
|
|
280
|
+
const C = (0, class { constructor() { return construct(fi, scope, C, record, this, arguments, new.target); } });
|
|
281
|
+
return C;
|
|
282
|
+
},
|
|
283
|
+
classDerived(fi, scope, parent, record) {
|
|
284
|
+
const C = (0, class extends parent { constructor() { return constructDerived(fi, scope, C, record, arguments, new.target); } });
|
|
285
|
+
return C;
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
})();
|
|
290
|
+
module.exports = { bind: (rt) => ({ ops: hostOperators(rt), strict: strict(rt), sloppy: sloppy(rt) }) };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var b=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var o in e)b(t,o,{get:e[o],enumerable:!0})},k=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of E(e))!I.call(t,n)&&n!==o&&b(t,n,{get:()=>e[n],enumerable:!(r=w(e,n))||r.enumerable});return t};var T=t=>k(b({},"__esModule",{value:!0}),t);var zt={};C(zt,{ArrayConstructor:()=>$,ArrayFrom:()=>tt,ArrayIteratorNext:()=>ot,ArrayIteratorPrototype:()=>R,ArrayPrototypeIndexOf:()=>gt,ArrayPrototypeLastIndexOf:()=>bt,ArrayPrototypePop:()=>ft,ArrayPrototypeToSpliced:()=>nt,ArrayPrototypeWith:()=>rt,ArrayValues:()=>et,BigInt:()=>Ct,BigIntPrototypeToString:()=>Ot,Error:()=>kt,GeneratorPrototypeNext:()=>Ft,GeneratorPrototypeReturn:()=>Nt,GeneratorPrototypeThrow:()=>Bt,LAUNCH_PRIMORDIALS:()=>Wt,NumberPrototypeToString:()=>St,ObjectOf:()=>q,ObjectPrototype:()=>mt,ObjectPrototypeHasOwnProperty:()=>dt,ObjectPrototypePropertyIsEnumerable:()=>Z,ObjectPrototypeToString:()=>jt,PromiseConstructor:()=>J,PromisePrototypeThen:()=>Y,PromiseReject:()=>X,PromiseResolve:()=>Q,RangeError:()=>Tt,ReferenceError:()=>Dt,RegExp:()=>Kt,RegExpPrototypeAccessors:()=>Pt,RegExpPrototypeExec:()=>ut,SafeAsyncGeneratorPrototype:()=>u,SafeGeneratorPrototype:()=>c,SafeList:()=>f,SafeMap:()=>l,SafeRegExpPrototype:()=>h,SafeSet:()=>i,SafeWeakMap:()=>a,SafeWeakSet:()=>x,StringFromCharCode:()=>xt,StringPrototypeCharAt:()=>at,StringPrototypeCharCodeAt:()=>ct,StringPrototypeIndexOf:()=>lt,StringPrototypeLastIndexOf:()=>st,StringPrototypeSlice:()=>pt,StringPrototypeSubstr:()=>it,SymbolConstructor:()=>wt,SymbolPrototypeDescription:()=>Et,SymbolPrototypeToString:()=>yt,SyntaxError:()=>Gt,TypeError:()=>vt,arrayIsArray:()=>z,dataDescriptor:()=>A,globalObject:()=>It,objectAssign:()=>B,objectCreate:()=>s,objectDefineProperties:()=>Rt,objectFreeze:()=>j,objectGetOwnPropertyNames:()=>W,objectHasOwn:()=>V,objectKeys:()=>N,parseFloatOf:()=>ht,parseIntOf:()=>At,reflectApply:()=>O,reflectConstruct:()=>D,reflectDefineProperty:()=>S,reflectDeleteProperty:()=>F,reflectGet:()=>g,reflectGetOwnPropertyDescriptor:()=>m,reflectGetPrototypeOf:()=>y,reflectHas:()=>G,reflectOwnKeys:()=>v,reflectSet:()=>K,reflectSetPrototypeOf:()=>d,registerSource:()=>Vt,stringOf:()=>_,symbolAsyncIterator:()=>M,symbolFor:()=>H,symbolIterator:()=>L,symbolUnscopables:()=>U});module.exports=T(zt);var O=Reflect.apply,D=Reflect.construct,g=Reflect.get,K=Reflect.set,G=Reflect.has,v=Reflect.ownKeys,S=Reflect.defineProperty,F=Reflect.deleteProperty,m=Reflect.getOwnPropertyDescriptor,y=Reflect.getPrototypeOf,d=Reflect.setPrototypeOf,s=Object.create,N=Object.keys,j=Object.freeze,B=Object.assign,V=Object.hasOwn,W=Object.getOwnPropertyNames,z=Array.isArray,H=Symbol.for,L=Symbol.iterator,M=Symbol.asyncIterator,U=Symbol.unscopables,_=String,q=Object,J=Promise,Q=Promise.resolve,X=Promise.reject,Y=Promise.prototype.then,Z=Object.prototype.propertyIsEnumerable,$=Array,tt=Array.from,et=Array.prototype[Symbol.iterator],R=Reflect.getPrototypeOf([][Symbol.iterator]())??{},ot=Reflect.get(R,"next"),rt=Reflect.get(Array.prototype,"with"),nt=Reflect.get(Array.prototype,"toSpliced"),pt=String.prototype.slice,st=String.prototype.lastIndexOf,ct=String.prototype.charCodeAt,yt=Symbol.prototype.toString,at=String.prototype.charAt,lt=String.prototype.indexOf,it=String.prototype.substr,xt=String.fromCharCode,ft=Array.prototype.pop,gt=Array.prototype.indexOf,bt=Array.prototype.lastIndexOf,ut=RegExp.prototype.exec,Pt=(()=>{let t=s(null),e=Object.getOwnPropertyNames(RegExp.prototype);for(let o=0;o<e.length;o++){let r=Reflect.getOwnPropertyDescriptor(RegExp.prototype,e[o])?.get;r!==void 0&&(t[e[o]]=r)}return t})(),St=Number.prototype.toString,Ot=BigInt.prototype.toString,mt=Object.prototype,dt=Object.prototype.hasOwnProperty,jt=Object.prototype.toString,Rt=Object.defineProperties,At=parseInt,ht=parseFloat,wt=Symbol,Et=Reflect.getOwnPropertyDescriptor(Symbol.prototype,"description")?.get,It=globalThis,Ct=BigInt,kt=Error,Tt=RangeError,Dt=ReferenceError,Kt=RegExp,Gt=SyntaxError,vt=TypeError;function A(t,e,o,r){let n=s(null);return n.value=t,n.writable=e,n.enumerable=o,n.configurable=r,n}function p(t,e,o){for(let r=0;r<o.length;r++){let n=m(e,o[r]);n&&S(t,o[r],n)}}var l=class extends Map{};p(l.prototype,Map.prototype,["get","set","has","delete","clear","forEach","size"]);var i=class extends Set{};p(i.prototype,Set.prototype,["add","has","delete","clear","forEach","size"]);var a=class extends WeakMap{};p(a.prototype,WeakMap.prototype,["get","set","has","delete"]);var x=class extends WeakSet{};p(x.prototype,WeakSet.prototype,["add","has","delete"]);var f=class extends Array{};d(f.prototype,null);var c=s(null),u=s(null);{let t=y(function*(){}.prototype)??{},e=y(async function*(){}.prototype)??{};p(c,t,["next","return","throw"]),p(c,y(t)??{},[Symbol.iterator]),p(u,e,["next","return","throw"]),p(u,y(e)??{},[Symbol.asyncIterator])}var h=s(null);{let t=Reflect.ownKeys(RegExp.prototype),e=[];for(let o=0;o<t.length;o++){let r=t[o];r!=="constructor"&&r!==Symbol.split&&r!==Symbol.matchAll&&(e[e.length]=r)}p(h,RegExp.prototype,e)}var Ft=g(c,"next"),Nt=g(c,"return"),Bt=g(c,"throw"),P=new a;function Vt(t,e){P.set(t,e)}{let t=Function.prototype.toString,e={toString(){if(typeof this=="function"){let o=P.get(this);if(o!==void 0)return o}return O(t,this,[])}}.toString;P.set(e,"function toString() { [native code] }"),S(Function.prototype,"toString",A(e,!0,!1,!0))}var Wt=j(s(null));
|