poe-code 11.0.8 → 11.0.9
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 +16 -16
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-TVZKHJOO.js → chunk-2GHBBE5J.js} +16 -16
- package/packages/safejs/dist/chunks/{chunk-TVZKHJOO.js.map → chunk-2GHBBE5J.js.map} +2 -2
- package/packages/safejs/dist/chunks/{chunk-776EUEUM.js → chunk-APPD5CFI.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/interpreter.js +14 -15
- package/packages/safejs/dist/interp/methods/array.js +3 -0
- /package/packages/safejs/dist/chunks/{chunk-776EUEUM.js.map → chunk-APPD5CFI.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2GHBBE5J.js";
|
|
31
31
|
|
|
32
32
|
// packages/safejs/src/migrate.ts
|
|
33
33
|
import { createHash } from "node:crypto";
|
|
@@ -8055,4 +8055,4 @@ export {
|
|
|
8055
8055
|
parseMcpConfig,
|
|
8056
8056
|
makeMcpModule
|
|
8057
8057
|
};
|
|
8058
|
-
//# sourceMappingURL=chunk-
|
|
8058
|
+
//# sourceMappingURL=chunk-APPD5CFI.js.map
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
parseMcpConfig,
|
|
21
21
|
splitFrontmatter,
|
|
22
22
|
withBrokenPipeGuard
|
|
23
|
-
} from "./chunks/chunk-
|
|
23
|
+
} from "./chunks/chunk-APPD5CFI.js";
|
|
24
24
|
import {
|
|
25
25
|
Budget,
|
|
26
26
|
SandboxError,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
replaceErrorStack,
|
|
33
33
|
restore,
|
|
34
34
|
run
|
|
35
|
-
} from "./chunks/chunk-
|
|
35
|
+
} from "./chunks/chunk-2GHBBE5J.js";
|
|
36
36
|
import "./chunks/chunk-4YIDX44G.js";
|
|
37
37
|
|
|
38
38
|
// packages/safejs/src/cli.ts
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
runWithSpawnUsageAccumulator,
|
|
28
28
|
splitFrontmatter,
|
|
29
29
|
supportsSpawnMode
|
|
30
|
-
} from "./chunks/chunk-
|
|
30
|
+
} from "./chunks/chunk-APPD5CFI.js";
|
|
31
31
|
import {
|
|
32
32
|
Budget,
|
|
33
33
|
FileSnapshotBackend,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
registerPendingHostCallPolicy,
|
|
50
50
|
restore,
|
|
51
51
|
run
|
|
52
|
-
} from "./chunks/chunk-
|
|
52
|
+
} from "./chunks/chunk-2GHBBE5J.js";
|
|
53
53
|
import "./chunks/chunk-4YIDX44G.js";
|
|
54
54
|
|
|
55
55
|
// packages/safejs/src/runner/run-harness.ts
|
|
@@ -1758,7 +1758,9 @@ async function evaluateMemberCallExpression(node, context) {
|
|
|
1758
1758
|
if (typeof member.object === "number" && isNumberMethodName(member.property)) {
|
|
1759
1759
|
return evaluateNumberMethodCall(node, member.object, member.property, context);
|
|
1760
1760
|
}
|
|
1761
|
-
if (Array.isArray(member.object) &&
|
|
1761
|
+
if (Array.isArray(member.object) &&
|
|
1762
|
+
isArrayMethodName(member.property) &&
|
|
1763
|
+
!Object.hasOwn(member.object, member.property)) {
|
|
1762
1764
|
return evaluateArrayMethodCall(node, member.object, member.property, context);
|
|
1763
1765
|
}
|
|
1764
1766
|
if (isSandboxMap(member.object) && isMapMethodName(member.property)) {
|
|
@@ -1773,7 +1775,7 @@ async function evaluateMemberCallExpression(node, context) {
|
|
|
1773
1775
|
if (typeof member.object === "number") {
|
|
1774
1776
|
return evaluatePrimitiveMemberCall(node, "Number", member.property, getNumberMember(member.object, member.property, context.budget), context);
|
|
1775
1777
|
}
|
|
1776
|
-
if (Array.isArray(member.object)) {
|
|
1778
|
+
if (Array.isArray(member.object) && !Object.hasOwn(member.object, member.property)) {
|
|
1777
1779
|
return evaluatePrimitiveMemberCall(node, "Array", member.property, getArrayMemberValue(member.object, member.property, context), context);
|
|
1778
1780
|
}
|
|
1779
1781
|
if (isSandboxMap(member.object)) {
|
|
@@ -2200,7 +2202,7 @@ function getMemberValue(target, property, context) {
|
|
|
2200
2202
|
return Object.hasOwn(target, String(property)) ? target[String(property)] : undefined;
|
|
2201
2203
|
}
|
|
2202
2204
|
function getArrayMemberValue(target, property, context) {
|
|
2203
|
-
if (property === "raw") {
|
|
2205
|
+
if (property === "raw" && taggedTemplateRawArrays.has(target)) {
|
|
2204
2206
|
return taggedTemplateRawArrays.get(target);
|
|
2205
2207
|
}
|
|
2206
2208
|
return getArrayMember(target, property, createArrayMethodOptions(context));
|
|
@@ -2242,23 +2244,20 @@ function getClosureMemberValue(target, property, context) {
|
|
|
2242
2244
|
return getFunctionMember(target, property, createFunctionMethodOptions(context));
|
|
2243
2245
|
}
|
|
2244
2246
|
async function evaluateResolvedCallExpression(node, callee, context, thisValue = undefined) {
|
|
2245
|
-
if (callee === null || callee === undefined) {
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
};
|
|
2252
|
-
}
|
|
2253
|
-
throw new TypeError("Attempted to call a non-function value.");
|
|
2254
|
-
}
|
|
2255
|
-
if (!isSandboxClosure(callee)) {
|
|
2256
|
-
throw new TypeError("Attempted to call a non-function value.");
|
|
2247
|
+
if ((callee === null || callee === undefined) && node.optional) {
|
|
2248
|
+
return {
|
|
2249
|
+
kind: "normal",
|
|
2250
|
+
hasValue: true,
|
|
2251
|
+
value: undefined
|
|
2252
|
+
};
|
|
2257
2253
|
}
|
|
2258
2254
|
const args = await evaluateCallArguments(node.arguments, context);
|
|
2259
2255
|
if (!args.ok) {
|
|
2260
2256
|
return args.result;
|
|
2261
2257
|
}
|
|
2258
|
+
if (!isSandboxClosure(callee)) {
|
|
2259
|
+
throw new TypeError("Attempted to call a non-function value.");
|
|
2260
|
+
}
|
|
2262
2261
|
return {
|
|
2263
2262
|
kind: "normal",
|
|
2264
2263
|
hasValue: true,
|
|
@@ -43,6 +43,9 @@ export function getArrayMember(value, property, options) {
|
|
|
43
43
|
if (property === "length") {
|
|
44
44
|
return value.length;
|
|
45
45
|
}
|
|
46
|
+
if (Object.hasOwn(value, property)) {
|
|
47
|
+
return value[String(property)];
|
|
48
|
+
}
|
|
46
49
|
if (isArrayMethodName(property)) {
|
|
47
50
|
return createSandboxClosure({
|
|
48
51
|
sandbox: true,
|
|
File without changes
|