@poe-platform/safe-js 0.1.280 → 0.1.281

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.
@@ -20520,6 +20520,37 @@ function createPromiseGlobals(options) {
20520
20520
  name: "reject",
20521
20521
  length: 1
20522
20522
  }),
20523
+ try: createSandboxClosure({
20524
+ sandbox: true,
20525
+ guest: true,
20526
+ name: "try",
20527
+ length: 1,
20528
+ call: async ([callback, ...args], context) => {
20529
+ const capability = await createPromiseCapability(
20530
+ context === void 0 ? promiseConstructor : context.thisValue,
20531
+ options.budget,
20532
+ context
20533
+ );
20534
+ let result;
20535
+ let rejected = false;
20536
+ try {
20537
+ if (!isSandboxClosure(callback)) throw new TypeError("Promise.try callback must be callable.");
20538
+ result = await callPromiseClosure(callback, args, void 0, options.budget, context);
20539
+ } catch (error) {
20540
+ if (error instanceof SandboxError && (error.code === "budgetExceeded" || error.code === "reentry")) throw error;
20541
+ rejected = true;
20542
+ result = error;
20543
+ }
20544
+ await callPromiseClosure(
20545
+ rejected ? capability.reject : capability.resolve,
20546
+ [result],
20547
+ void 0,
20548
+ options.budget,
20549
+ context
20550
+ );
20551
+ return capability.promise;
20552
+ }
20553
+ }),
20523
20554
  withResolvers: createSandboxClosure({
20524
20555
  sandbox: true,
20525
20556
  guest: true,
@@ -40268,4 +40299,4 @@ export {
40268
40299
  FileSnapshotBackend,
40269
40300
  run
40270
40301
  };
40271
- //# sourceMappingURL=chunk-JM3LVK7Z.js.map
40302
+ //# sourceMappingURL=chunk-NNOPQXDM.js.map