@poe-platform/safe-js 0.1.459 → 0.1.460

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.
@@ -19733,8 +19733,9 @@ function getNumberMember(property, budget) {
19733
19733
  }
19734
19734
  return createSandboxClosure({
19735
19735
  sandbox: true,
19736
- name: `Number#${property}`,
19737
- ...property === "toLocaleString" ? { guest: true, name: property, length: 0 } : {},
19736
+ guest: true,
19737
+ name: property,
19738
+ length: property === "toLocaleString" ? 0 : 1,
19738
19739
  call: (args, context) => callNumberMethod(context?.thisValue, property, args, budget, context)
19739
19740
  });
19740
19741
  }
@@ -19867,41 +19868,42 @@ async function compareStringLocale(value, args, budget, context) {
19867
19868
  }
19868
19869
 
19869
19870
  // packages/safe-js/src/interp/methods/string.ts
19870
- var stringMethodNames = /* @__PURE__ */ new Set([
19871
- "at",
19872
- "charAt",
19873
- "charCodeAt",
19874
- "codePointAt",
19875
- "concat",
19876
- "endsWith",
19877
- "includes",
19878
- "indexOf",
19879
- "isWellFormed",
19880
- "lastIndexOf",
19881
- "localeCompare",
19882
- "match",
19883
- "matchAll",
19884
- "normalize",
19885
- "padEnd",
19886
- "padStart",
19887
- "repeat",
19888
- "replace",
19889
- "replaceAll",
19890
- "slice",
19891
- "search",
19892
- "split",
19893
- "startsWith",
19894
- "substr",
19895
- "substring",
19896
- "toLowerCase",
19897
- "toUpperCase",
19898
- "toLocaleLowerCase",
19899
- "toLocaleUpperCase",
19900
- "toWellFormed",
19901
- "trim",
19902
- "trimEnd",
19903
- "trimStart"
19904
- ]);
19871
+ var stringMethodLengths = {
19872
+ at: 1,
19873
+ charAt: 1,
19874
+ charCodeAt: 1,
19875
+ codePointAt: 1,
19876
+ concat: 1,
19877
+ endsWith: 1,
19878
+ includes: 1,
19879
+ indexOf: 1,
19880
+ isWellFormed: 0,
19881
+ lastIndexOf: 1,
19882
+ localeCompare: 1,
19883
+ match: 1,
19884
+ matchAll: 1,
19885
+ normalize: 0,
19886
+ padEnd: 1,
19887
+ padStart: 1,
19888
+ repeat: 1,
19889
+ replace: 2,
19890
+ replaceAll: 2,
19891
+ slice: 2,
19892
+ search: 1,
19893
+ split: 2,
19894
+ startsWith: 1,
19895
+ substr: 2,
19896
+ substring: 2,
19897
+ toLowerCase: 0,
19898
+ toUpperCase: 0,
19899
+ toLocaleLowerCase: 0,
19900
+ toLocaleUpperCase: 0,
19901
+ toWellFormed: 0,
19902
+ trim: 0,
19903
+ trimEnd: 0,
19904
+ trimStart: 0
19905
+ };
19906
+ var stringMethodNames = new Set(Object.keys(stringMethodLengths));
19905
19907
  function getStringMember(value, property, budget) {
19906
19908
  const index = getStringIndex(property);
19907
19909
  if (index !== void 0) {
@@ -19915,11 +19917,9 @@ function getStringMember(value, property, budget) {
19915
19917
  }
19916
19918
  return createSandboxClosure({
19917
19919
  sandbox: true,
19918
- name: `String#${property}`,
19919
- ...property === "trimStart" || property === "trimEnd" ? { guest: true, name: property, length: 0 } : {},
19920
- ...property === "toLocaleLowerCase" || property === "toLocaleUpperCase" ? { guest: true, name: property, length: 0 } : {},
19921
- ...property === "localeCompare" ? { length: 1 } : {},
19922
- ...property === "isWellFormed" || property === "toWellFormed" ? { length: 0 } : {},
19920
+ guest: true,
19921
+ name: property,
19922
+ length: stringMethodLengths[property],
19923
19923
  call: async (args, context) => {
19924
19924
  const receiver = context?.thisValue;
19925
19925
  if (receiver === null || receiver === void 0) {
@@ -20729,6 +20729,7 @@ function createPrimitiveConstructor(options, budget) {
20729
20729
  "valueOf",
20730
20730
  createSandboxClosure({
20731
20731
  sandbox: true,
20732
+ guest: true,
20732
20733
  name: "valueOf",
20733
20734
  length: 0,
20734
20735
  call: (_args, context) => primitiveReceiver(context?.thisValue, kind)
@@ -20742,6 +20743,7 @@ function createPrimitiveConstructor(options, budget) {
20742
20743
  "toString",
20743
20744
  createSandboxClosure({
20744
20745
  sandbox: true,
20746
+ guest: true,
20745
20747
  name: "toString",
20746
20748
  length: 0,
20747
20749
  call: (_args, context) => budget.allocateString(String(primitiveReceiver(context?.thisValue, kind)))
@@ -56303,4 +56305,4 @@ The above copyright notice and this permission notice shall be included in all c
56303
56305
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
56304
56306
 
56305
56307
  */
56306
- //# sourceMappingURL=chunk-7A542ATS.js.map
56308
+ //# sourceMappingURL=chunk-BJWRB7U7.js.map