@poe-platform/safe-js 0.1.90 → 0.1.91

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-774EXZKX.js";
30
+ } from "./chunk-JZXAWFPL.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-CHNJPOMA.js.map
8248
+ //# sourceMappingURL=chunk-DKMHZ3VV.js.map
@@ -24524,20 +24524,23 @@ var numberMethodNames = /* @__PURE__ */ new Set([
24524
24524
  "toPrecision",
24525
24525
  "toString"
24526
24526
  ]);
24527
- function getNumberMember(value, property, budget) {
24527
+ function getNumberMember(property, budget) {
24528
24528
  if (!isNumberMethodName(property)) {
24529
24529
  return void 0;
24530
24530
  }
24531
24531
  return createSandboxClosure({
24532
24532
  sandbox: true,
24533
24533
  name: `Number#${property}`,
24534
- call: (args) => callNumberMethod(value, property, args, budget)
24534
+ call: (args, context) => callNumberMethod(context?.thisValue, property, args, budget)
24535
24535
  });
24536
24536
  }
24537
24537
  function isNumberMethodName(property) {
24538
24538
  return typeof property === "string" && numberMethodNames.has(property);
24539
24539
  }
24540
24540
  function callNumberMethod(value, methodName, args, budget) {
24541
+ if (typeof value !== "number") {
24542
+ throw new TypeError(`Number#${methodName} requires a number receiver.`);
24543
+ }
24541
24544
  return budget.allocateString(callNativeNumberMethod(value, methodName, args));
24542
24545
  }
24543
24546
  function callNativeNumberMethod(value, methodName, args) {
@@ -27507,7 +27510,7 @@ async function evaluateMemberExpression(node, context) {
27507
27510
  function getPropertyValue(target, property, context) {
27508
27511
  if (isGuestHostObject(target)) return getHostObjectMember(target, String(property));
27509
27512
  if (typeof target === "string") return getStringMember(target, property, context.budget);
27510
- if (typeof target === "number") return getNumberMember(target, property, context.budget);
27513
+ if (typeof target === "number") return getNumberMember(property, context.budget);
27511
27514
  if (typeof target === "boolean") return void 0;
27512
27515
  if (isFloat32Array(target)) return getFloat32Member(target, property, context.budget);
27513
27516
  if (isSandboxDate(target)) return getDateMember(property, context.budget, context.compilation?.owner);
@@ -27714,7 +27717,7 @@ async function evaluateMemberCallExpression(node, context) {
27714
27717
  node,
27715
27718
  "Number",
27716
27719
  member.property,
27717
- getNumberMember(member.object, member.property, context.budget),
27720
+ getNumberMember(member.property, context.budget),
27718
27721
  context
27719
27722
  );
27720
27723
  }
@@ -32894,4 +32897,4 @@ export {
32894
32897
  FileSnapshotBackend,
32895
32898
  run
32896
32899
  };
32897
- //# sourceMappingURL=chunk-774EXZKX.js.map
32900
+ //# sourceMappingURL=chunk-JZXAWFPL.js.map