poe-code 11.0.10 → 11.0.12
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/index.js +60 -14
- package/dist/index.js.map +3 -3
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-BESE73VB.js → chunk-5BWI6HAZ.js} +60 -14
- package/packages/safejs/dist/chunks/{chunk-BESE73VB.js.map → chunk-5BWI6HAZ.js.map} +2 -2
- package/packages/safejs/dist/chunks/{chunk-DF7PY5YX.js → chunk-WV23C6SS.js} +2 -2
- package/packages/safejs/dist/cli.js +2 -2
- package/packages/safejs/dist/core.js +1 -1
- package/packages/safejs/dist/index.js +2 -2
- package/packages/safejs/dist/interp/globals/object-array.js +45 -1
- package/packages/safejs/dist/modules/registry.js +3 -3
- /package/packages/safejs/dist/chunks/{chunk-DF7PY5YX.js.map → chunk-WV23C6SS.js.map} +0 -0
package/package.json
CHANGED
|
@@ -23673,10 +23673,22 @@ function createObjectArrayGlobals(options) {
|
|
|
23673
23673
|
}),
|
|
23674
23674
|
fromEntries: createSandboxClosure({
|
|
23675
23675
|
sandbox: true,
|
|
23676
|
-
call: ([value]) =>
|
|
23677
|
-
|
|
23678
|
-
|
|
23679
|
-
|
|
23676
|
+
call: ([value]) => {
|
|
23677
|
+
const iterator = getSandboxIterator(value);
|
|
23678
|
+
if (iterator === void 0) {
|
|
23679
|
+
throw new TypeError("Object.fromEntries requires an iterable.");
|
|
23680
|
+
}
|
|
23681
|
+
if (!iterator.generator) {
|
|
23682
|
+
return allocateProducedSandboxValue(
|
|
23683
|
+
Object.setPrototypeOf(
|
|
23684
|
+
Reflect.apply(Object.fromEntries, Object, [{ [Symbol.iterator]: () => iterator }]),
|
|
23685
|
+
null
|
|
23686
|
+
),
|
|
23687
|
+
options.budget
|
|
23688
|
+
);
|
|
23689
|
+
}
|
|
23690
|
+
return objectFromSandboxEntries(iterator, options.budget);
|
|
23691
|
+
},
|
|
23680
23692
|
name: "fromEntries"
|
|
23681
23693
|
}),
|
|
23682
23694
|
freeze: createSandboxClosure({
|
|
@@ -23797,6 +23809,38 @@ function createObjectArrayGlobals(options) {
|
|
|
23797
23809
|
})
|
|
23798
23810
|
};
|
|
23799
23811
|
}
|
|
23812
|
+
async function objectFromSandboxEntries(iterator, budget) {
|
|
23813
|
+
const object = /* @__PURE__ */ Object.create(null);
|
|
23814
|
+
try {
|
|
23815
|
+
while (true) {
|
|
23816
|
+
const result = await iterator.next();
|
|
23817
|
+
if (typeof result !== "object" && typeof result !== "function" || result === null) {
|
|
23818
|
+
throw new TypeError("Iterator result must be an object.");
|
|
23819
|
+
}
|
|
23820
|
+
if (result.done) break;
|
|
23821
|
+
const entry = result.value;
|
|
23822
|
+
if (typeof entry !== "object" && typeof entry !== "function" || entry === null) {
|
|
23823
|
+
throw new TypeError("Object.fromEntries requires entry objects.");
|
|
23824
|
+
}
|
|
23825
|
+
const key = entry[0];
|
|
23826
|
+
const value = entry[1];
|
|
23827
|
+
Object.defineProperty(object, key, {
|
|
23828
|
+
configurable: true,
|
|
23829
|
+
enumerable: true,
|
|
23830
|
+
value,
|
|
23831
|
+
writable: true
|
|
23832
|
+
});
|
|
23833
|
+
}
|
|
23834
|
+
} catch (error) {
|
|
23835
|
+
try {
|
|
23836
|
+
await iterator.return?.();
|
|
23837
|
+
} catch {
|
|
23838
|
+
throw error;
|
|
23839
|
+
}
|
|
23840
|
+
throw error;
|
|
23841
|
+
}
|
|
23842
|
+
return allocateProducedSandboxValue(object, budget);
|
|
23843
|
+
}
|
|
23800
23844
|
function assignSandboxValues(target, sources) {
|
|
23801
23845
|
if (target === null || target === void 0) {
|
|
23802
23846
|
throw new TypeError("Object.assign(target, ...sources) requires a non-null target.");
|
|
@@ -28150,14 +28194,16 @@ function bindImportDeclaration(declaration, registry, wrappedModules, bindings,
|
|
|
28150
28194
|
declaration.source.span
|
|
28151
28195
|
);
|
|
28152
28196
|
}
|
|
28153
|
-
const wrappedExports = wrappedModules.get(moduleName) ??
|
|
28154
|
-
|
|
28155
|
-
|
|
28156
|
-
|
|
28157
|
-
|
|
28158
|
-
|
|
28159
|
-
|
|
28160
|
-
|
|
28197
|
+
const wrappedExports = wrappedModules.get(moduleName) ?? createBindingRecord(
|
|
28198
|
+
wrapCancelableBindings(
|
|
28199
|
+
wrapCallerInjectedBindings(Object.fromEntries(moduleExports), {
|
|
28200
|
+
budget: options.budget,
|
|
28201
|
+
hostCalls: options.hostCalls,
|
|
28202
|
+
moduleId: moduleName,
|
|
28203
|
+
signal: options.signal
|
|
28204
|
+
}),
|
|
28205
|
+
options.signal
|
|
28206
|
+
)
|
|
28161
28207
|
);
|
|
28162
28208
|
wrappedModules.set(moduleName, wrappedExports);
|
|
28163
28209
|
for (const specifier of declaration.specifiers) {
|
|
@@ -28177,7 +28223,7 @@ function bindImportDeclaration(declaration, registry, wrappedModules, bindings,
|
|
|
28177
28223
|
}
|
|
28178
28224
|
function resolveImportSpecifier(moduleName, specifier, wrappedExports) {
|
|
28179
28225
|
if (specifier.type === "ImportNamespaceSpecifier") {
|
|
28180
|
-
return
|
|
28226
|
+
return wrappedExports;
|
|
28181
28227
|
}
|
|
28182
28228
|
const exportName = specifier.type === "ImportDefaultSpecifier" ? "default" : specifier.imported.name;
|
|
28183
28229
|
const exportedValue = wrappedExports[exportName];
|
|
@@ -28985,4 +29031,4 @@ export {
|
|
|
28985
29031
|
FileSnapshotBackend,
|
|
28986
29032
|
run
|
|
28987
29033
|
};
|
|
28988
|
-
//# sourceMappingURL=chunk-
|
|
29034
|
+
//# sourceMappingURL=chunk-5BWI6HAZ.js.map
|