@jplorg/jpl 2.1.3 → 2.2.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/esm/main.js
CHANGED
|
@@ -465,8 +465,9 @@ function I(e = {}, t = {}) {
|
|
|
465
465
|
var dt = class {
|
|
466
466
|
#e;
|
|
467
467
|
#t;
|
|
468
|
+
#n;
|
|
468
469
|
constructor(e, t) {
|
|
469
|
-
this.#e = I(t?.runtime, ut), this.#t = e;
|
|
470
|
+
this.#e = I(t?.runtime, ut), this.#t = e, this.#n = this.createScope({ vars: Object.fromEntries(this.muxOne([Object.entries(this.options.vars)], ([e, t]) => [e, this.normalizeValue(t)])) });
|
|
470
471
|
}
|
|
471
472
|
get options() {
|
|
472
473
|
return this.#e;
|
|
@@ -474,13 +475,15 @@ var dt = class {
|
|
|
474
475
|
get program() {
|
|
475
476
|
return this.#t;
|
|
476
477
|
}
|
|
478
|
+
get rootScope() {
|
|
479
|
+
return this.#n;
|
|
480
|
+
}
|
|
477
481
|
createScope = (e) => new M(e);
|
|
478
482
|
execute = async (e) => {
|
|
479
|
-
let t = this.createScope({ vars: Object.fromEntries(this.muxOne([Object.entries(this.options.vars)], ([e, t]) => [e, this.normalizeValue(t)])) });
|
|
480
483
|
try {
|
|
481
|
-
return await this.executeInstructions(this.program.definition.instructions ?? [], e,
|
|
484
|
+
return await this.executeInstructions(this.program.definition.instructions ?? [], e, this.rootScope, this.options.adjustResult);
|
|
482
485
|
} finally {
|
|
483
|
-
|
|
486
|
+
this.rootScope.signal.exit();
|
|
484
487
|
}
|
|
485
488
|
};
|
|
486
489
|
executeInstructions = (e, t, n, r = (e) => [e]) => {
|
|
@@ -19,6 +19,8 @@ export default class JPLRuntime {
|
|
|
19
19
|
get options(): JPLRuntimeOptions;
|
|
20
20
|
/** Return the runtime's program */
|
|
21
21
|
get program(): JPLProgram;
|
|
22
|
+
/** Return the runtime's root scope */
|
|
23
|
+
get rootScope(): JPLRuntimeScope;
|
|
22
24
|
/** Create a new orphan scope */
|
|
23
25
|
createScope: (presets?: JPLRuntimeScopeConfig) => JPLRuntimeScope;
|
|
24
26
|
/** Execute a new dedicated program */
|