@poe-platform/safe-js 0.1.128 → 0.1.130

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-LZEDWYSI.js";
30
+ } from "./chunk-ZTGKRKQH.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8245,4 +8245,4 @@ export {
8245
8245
  parseMcpConfig,
8246
8246
  makeMcpModule
8247
8247
  };
8248
- //# sourceMappingURL=chunk-EAKCL5OK.js.map
8248
+ //# sourceMappingURL=chunk-SGKEOIQL.js.map
@@ -25092,6 +25092,9 @@ function isStringMethodName(property) {
25092
25092
  function validateStringMethodArguments(_methodName, _args) {
25093
25093
  }
25094
25094
  function callStringMethod(value, methodName, args, budget, callClosure = async (closure, closureArgs) => await closure.call(closureArgs), parent, context) {
25095
+ if (methodName === "concat" && args.some((argument) => argument !== null && typeof argument === "object")) {
25096
+ return callConcat(value, args, budget, context);
25097
+ }
25095
25098
  if (methodName === "isWellFormed") {
25096
25099
  for (let index = 0; index < value.length; index++) {
25097
25100
  const codeUnit = value.charCodeAt(index);
@@ -25247,6 +25250,19 @@ function callStringMethod(value, methodName, args, budget, callClosure = async (
25247
25250
  operation.release();
25248
25251
  }
25249
25252
  }
25253
+ async function callConcat(value, args, budget, context) {
25254
+ let result = budget.allocateString(value);
25255
+ const release = retainValues(budget, () => [result]);
25256
+ try {
25257
+ for (const argument of args) {
25258
+ const text = sandboxString(argument, budget, context);
25259
+ result = budget.allocateString(result + (typeof text === "string" ? text : await text));
25260
+ }
25261
+ return result;
25262
+ } finally {
25263
+ release();
25264
+ }
25265
+ }
25250
25266
  function callReplaceLikeMethod(value, methodName, args, budget, callClosure, context) {
25251
25267
  const search = args[0];
25252
25268
  const replacement = args[1];
@@ -26707,14 +26723,18 @@ function isObjectPrototypeSetterProperty(property, key) {
26707
26723
  }
26708
26724
  async function evaluateTemplateLiteral(node, context) {
26709
26725
  let value = context.budget.allocateString(node.quasis[0]?.value.cooked ?? "");
26710
- const release = retainValues(context.budget, () => [value]);
26726
+ let input = void 0;
26727
+ const release = retainValues(context.budget, () => [value, input]);
26711
26728
  try {
26712
26729
  for (let index = 0; index < node.expressions.length; index += 1) {
26713
26730
  const expression = await evaluateNode(node.expressions[index], context);
26714
26731
  if (expression.kind !== "normal") {
26715
26732
  return expression;
26716
26733
  }
26717
- const expressionText = context.budget.allocateString(String(expression.value));
26734
+ input = expression.value;
26735
+ const text = sandboxString(input, context.budget, createCoercionContext(context));
26736
+ const expressionText = typeof text === "string" ? text : await text;
26737
+ input = void 0;
26718
26738
  value = context.budget.allocateString(value + expressionText);
26719
26739
  const quasiText = context.budget.allocateString(node.quasis[index + 1]?.value.cooked ?? "");
26720
26740
  value = context.budget.allocateString(value + quasiText);
@@ -33480,4 +33500,4 @@ export {
33480
33500
  FileSnapshotBackend,
33481
33501
  run
33482
33502
  };
33483
- //# sourceMappingURL=chunk-LZEDWYSI.js.map
33503
+ //# sourceMappingURL=chunk-ZTGKRKQH.js.map