poe-code 11.0.7 → 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 +22 -19
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-OPNWSDXC.js → chunk-2GHBBE5J.js} +22 -19
- package/packages/safejs/dist/chunks/{chunk-OPNWSDXC.js.map → chunk-2GHBBE5J.js.map} +2 -2
- package/packages/safejs/dist/chunks/{chunk-M3VDOFN5.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/globals/object-array.js +3 -3
- 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-M3VDOFN5.js.map → chunk-APPD5CFI.js.map} +0 -0
package/package.json
CHANGED
|
@@ -23652,12 +23652,12 @@ function createObjectArrayGlobals(options) {
|
|
|
23652
23652
|
}),
|
|
23653
23653
|
values: createSandboxClosure({
|
|
23654
23654
|
sandbox: true,
|
|
23655
|
-
call: ([value]) =>
|
|
23655
|
+
call: ([value]) => allocateProducedSandboxValue(getOwnEnumerableValues(value), options.budget),
|
|
23656
23656
|
name: "values"
|
|
23657
23657
|
}),
|
|
23658
23658
|
entries: createSandboxClosure({
|
|
23659
23659
|
sandbox: true,
|
|
23660
|
-
call: ([value]) =>
|
|
23660
|
+
call: ([value]) => allocateProducedSandboxValue(getOwnEnumerableEntries(value), options.budget),
|
|
23661
23661
|
name: "entries"
|
|
23662
23662
|
}),
|
|
23663
23663
|
hasOwn: createSandboxClosure({
|
|
@@ -23672,7 +23672,10 @@ function createObjectArrayGlobals(options) {
|
|
|
23672
23672
|
}),
|
|
23673
23673
|
fromEntries: createSandboxClosure({
|
|
23674
23674
|
sandbox: true,
|
|
23675
|
-
call: ([value]) =>
|
|
23675
|
+
call: ([value]) => allocateProducedSandboxValue(
|
|
23676
|
+
Object.setPrototypeOf(Reflect.apply(Object.fromEntries, Object, [value]), null),
|
|
23677
|
+
options.budget
|
|
23678
|
+
),
|
|
23676
23679
|
name: "fromEntries"
|
|
23677
23680
|
}),
|
|
23678
23681
|
freeze: createSandboxClosure({
|
|
@@ -23943,6 +23946,9 @@ function getArrayMember(value, property, options) {
|
|
|
23943
23946
|
if (property === "length") {
|
|
23944
23947
|
return value.length;
|
|
23945
23948
|
}
|
|
23949
|
+
if (Object.hasOwn(value, property)) {
|
|
23950
|
+
return value[String(property)];
|
|
23951
|
+
}
|
|
23946
23952
|
if (isArrayMethodName(property)) {
|
|
23947
23953
|
return createSandboxClosure({
|
|
23948
23954
|
sandbox: true,
|
|
@@ -27333,7 +27339,7 @@ async function evaluateMemberCallExpression(node, context) {
|
|
|
27333
27339
|
if (typeof member.object === "number" && isNumberMethodName(member.property)) {
|
|
27334
27340
|
return evaluateNumberMethodCall(node, member.object, member.property, context);
|
|
27335
27341
|
}
|
|
27336
|
-
if (Array.isArray(member.object) && isArrayMethodName(member.property)) {
|
|
27342
|
+
if (Array.isArray(member.object) && isArrayMethodName(member.property) && !Object.hasOwn(member.object, member.property)) {
|
|
27337
27343
|
return evaluateArrayMethodCall(node, member.object, member.property, context);
|
|
27338
27344
|
}
|
|
27339
27345
|
if (isSandboxMap(member.object) && isMapMethodName(member.property)) {
|
|
@@ -27360,7 +27366,7 @@ async function evaluateMemberCallExpression(node, context) {
|
|
|
27360
27366
|
context
|
|
27361
27367
|
);
|
|
27362
27368
|
}
|
|
27363
|
-
if (Array.isArray(member.object)) {
|
|
27369
|
+
if (Array.isArray(member.object) && !Object.hasOwn(member.object, member.property)) {
|
|
27364
27370
|
return evaluatePrimitiveMemberCall(
|
|
27365
27371
|
node,
|
|
27366
27372
|
"Array",
|
|
@@ -27832,7 +27838,7 @@ function getMemberValue(target, property, context) {
|
|
|
27832
27838
|
return Object.hasOwn(target, String(property)) ? target[String(property)] : void 0;
|
|
27833
27839
|
}
|
|
27834
27840
|
function getArrayMemberValue(target, property, context) {
|
|
27835
|
-
if (property === "raw") {
|
|
27841
|
+
if (property === "raw" && taggedTemplateRawArrays.has(target)) {
|
|
27836
27842
|
return taggedTemplateRawArrays.get(target);
|
|
27837
27843
|
}
|
|
27838
27844
|
return getArrayMember(target, property, createArrayMethodOptions(context));
|
|
@@ -27873,23 +27879,20 @@ function getClosureMemberValue(target, property, context) {
|
|
|
27873
27879
|
return getFunctionMember(target, property, createFunctionMethodOptions(context));
|
|
27874
27880
|
}
|
|
27875
27881
|
async function evaluateResolvedCallExpression(node, callee, context, thisValue = void 0) {
|
|
27876
|
-
if (callee === null || callee === void 0) {
|
|
27877
|
-
|
|
27878
|
-
|
|
27879
|
-
|
|
27880
|
-
|
|
27881
|
-
|
|
27882
|
-
};
|
|
27883
|
-
}
|
|
27884
|
-
throw new TypeError("Attempted to call a non-function value.");
|
|
27885
|
-
}
|
|
27886
|
-
if (!isSandboxClosure(callee)) {
|
|
27887
|
-
throw new TypeError("Attempted to call a non-function value.");
|
|
27882
|
+
if ((callee === null || callee === void 0) && node.optional) {
|
|
27883
|
+
return {
|
|
27884
|
+
kind: "normal",
|
|
27885
|
+
hasValue: true,
|
|
27886
|
+
value: void 0
|
|
27887
|
+
};
|
|
27888
27888
|
}
|
|
27889
27889
|
const args = await evaluateCallArguments(node.arguments, context);
|
|
27890
27890
|
if (!args.ok) {
|
|
27891
27891
|
return args.result;
|
|
27892
27892
|
}
|
|
27893
|
+
if (!isSandboxClosure(callee)) {
|
|
27894
|
+
throw new TypeError("Attempted to call a non-function value.");
|
|
27895
|
+
}
|
|
27893
27896
|
return {
|
|
27894
27897
|
kind: "normal",
|
|
27895
27898
|
hasValue: true,
|
|
@@ -28981,4 +28984,4 @@ export {
|
|
|
28981
28984
|
FileSnapshotBackend,
|
|
28982
28985
|
run
|
|
28983
28986
|
};
|
|
28984
|
-
//# sourceMappingURL=chunk-
|
|
28987
|
+
//# sourceMappingURL=chunk-2GHBBE5J.js.map
|