@poe-platform/safe-js 0.1.451 → 0.1.453
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/safe-js/chunks/{chunk-YIPIBBVN.js → chunk-CEBPHXBL.js} +2 -2
- package/dist/safe-js/chunks/{chunk-7OZYVM5K.js → chunk-E2VDSNJC.js} +290 -13
- package/dist/safe-js/chunks/{chunk-7OZYVM5K.js.map → chunk-E2VDSNJC.js.map} +4 -4
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +1 -1
- package/dist/safe-js/index.js +2 -2
- package/dist/safe-js/interp/intl-listformat.d.ts +16 -0
- package/dist/safe-js/interp/intl-relativetimeformat.d.ts +18 -0
- package/dist/safe-js/snapshot/guest-heap.d.ts +10 -0
- package/package.json +2 -2
- /package/dist/safe-js/chunks/{chunk-YIPIBBVN.js.map → chunk-CEBPHXBL.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-E2VDSNJC.js";
|
|
31
31
|
|
|
32
32
|
// packages/safe-js/src/migrate.ts
|
|
33
33
|
import { createHash } from "node:crypto";
|
|
@@ -8249,4 +8249,4 @@ export {
|
|
|
8249
8249
|
parseMcpConfig,
|
|
8250
8250
|
makeMcpModule
|
|
8251
8251
|
};
|
|
8252
|
-
//# sourceMappingURL=chunk-
|
|
8252
|
+
//# sourceMappingURL=chunk-CEBPHXBL.js.map
|
|
@@ -28545,7 +28545,7 @@ async function buildLocaleTag(input, optionsInput, budget, context) {
|
|
|
28545
28545
|
}
|
|
28546
28546
|
const updated = Object.values(base).filter((value) => value !== void 0).join("-") + canonical.slice(native.baseName.length);
|
|
28547
28547
|
const extension = unicodeKeywords(updated);
|
|
28548
|
-
const
|
|
28548
|
+
const optionTypes4 = [
|
|
28549
28549
|
["calendar", "ca", "unicodeType"],
|
|
28550
28550
|
["collation", "co", "unicodeType"],
|
|
28551
28551
|
["firstDayOfWeek", "fw", "unicodeType"],
|
|
@@ -28554,7 +28554,7 @@ async function buildLocaleTag(input, optionsInput, budget, context) {
|
|
|
28554
28554
|
["numeric", "kn", "boolean"],
|
|
28555
28555
|
["numberingSystem", "nu", "unicodeType"]
|
|
28556
28556
|
];
|
|
28557
|
-
for (const [key, extensionKey, type] of
|
|
28557
|
+
for (const [key, extensionKey, type] of optionTypes4) {
|
|
28558
28558
|
let value = await readIntlProperty(options, key, budget, context);
|
|
28559
28559
|
if (value === void 0) continue;
|
|
28560
28560
|
if (key === "firstDayOfWeek") {
|
|
@@ -28574,20 +28574,66 @@ async function buildLocaleTag(input, optionsInput, budget, context) {
|
|
|
28574
28574
|
return budget.allocateString(Reflect.apply(nativeToString, result, []));
|
|
28575
28575
|
}
|
|
28576
28576
|
|
|
28577
|
-
// packages/safe-js/src/interp/intl-
|
|
28577
|
+
// packages/safe-js/src/interp/intl-listformat.ts
|
|
28578
|
+
var NativeListFormat = Intl.ListFormat;
|
|
28579
|
+
var resolvedOptions2 = NativeListFormat.prototype.resolvedOptions;
|
|
28580
|
+
var format = NativeListFormat.prototype.format;
|
|
28581
|
+
var formatToParts2 = NativeListFormat.prototype.formatToParts;
|
|
28578
28582
|
var states6 = /* @__PURE__ */ new WeakMap();
|
|
28583
|
+
function createSandboxListFormat(locales2, options) {
|
|
28584
|
+
const native = new NativeListFormat(locales2, options);
|
|
28585
|
+
const value = /* @__PURE__ */ Object.create(null);
|
|
28586
|
+
states6.set(value, { native, options: Reflect.apply(resolvedOptions2, native, []) });
|
|
28587
|
+
return value;
|
|
28588
|
+
}
|
|
28589
|
+
function isSandboxListFormat(value) {
|
|
28590
|
+
return typeof value === "object" && value !== null && states6.has(value);
|
|
28591
|
+
}
|
|
28592
|
+
function listFormatState(value) {
|
|
28593
|
+
if (!isSandboxListFormat(value)) throw new TypeError("Intl.ListFormat requires a ListFormat receiver.");
|
|
28594
|
+
return states6.get(value);
|
|
28595
|
+
}
|
|
28596
|
+
function formatList(value, strings, parts) {
|
|
28597
|
+
return Reflect.apply(parts ? formatToParts2 : format, listFormatState(value).native, [strings]);
|
|
28598
|
+
}
|
|
28599
|
+
|
|
28600
|
+
// packages/safe-js/src/interp/intl-relativetimeformat.ts
|
|
28601
|
+
var NativeRelativeTimeFormat = Intl.RelativeTimeFormat;
|
|
28602
|
+
var resolvedOptions3 = NativeRelativeTimeFormat.prototype.resolvedOptions;
|
|
28603
|
+
var format2 = NativeRelativeTimeFormat.prototype.format;
|
|
28604
|
+
var formatToParts3 = NativeRelativeTimeFormat.prototype.formatToParts;
|
|
28605
|
+
var states7 = /* @__PURE__ */ new WeakMap();
|
|
28606
|
+
function createSandboxRelativeTimeFormat(locales2, options) {
|
|
28607
|
+
const native = new NativeRelativeTimeFormat(locales2, options);
|
|
28608
|
+
const value = /* @__PURE__ */ Object.create(null);
|
|
28609
|
+
states7.set(value, { native, options: Reflect.apply(resolvedOptions3, native, []) });
|
|
28610
|
+
return value;
|
|
28611
|
+
}
|
|
28612
|
+
function isSandboxRelativeTimeFormat(value) {
|
|
28613
|
+
return typeof value === "object" && value !== null && states7.has(value);
|
|
28614
|
+
}
|
|
28615
|
+
function relativeTimeFormatState(value) {
|
|
28616
|
+
if (!isSandboxRelativeTimeFormat(value)) throw new TypeError("Intl.RelativeTimeFormat requires a RelativeTimeFormat receiver.");
|
|
28617
|
+
return states7.get(value);
|
|
28618
|
+
}
|
|
28619
|
+
function formatRelativeTime(value, amount, unit, parts) {
|
|
28620
|
+
return Reflect.apply(parts ? formatToParts3 : format2, relativeTimeFormatState(value).native, [amount, unit]);
|
|
28621
|
+
}
|
|
28622
|
+
|
|
28623
|
+
// packages/safe-js/src/interp/intl-numberformat.ts
|
|
28624
|
+
var states8 = /* @__PURE__ */ new WeakMap();
|
|
28579
28625
|
function createSandboxNumberFormat(locales2, options) {
|
|
28580
28626
|
const native = createNumberFormatter(locales2, options);
|
|
28581
28627
|
const value = /* @__PURE__ */ Object.create(null);
|
|
28582
|
-
|
|
28628
|
+
states8.set(value, { native, options: numberFormatterOptions2(native) });
|
|
28583
28629
|
return value;
|
|
28584
28630
|
}
|
|
28585
28631
|
function isSandboxNumberFormat(value) {
|
|
28586
|
-
return typeof value === "object" && value !== null &&
|
|
28632
|
+
return typeof value === "object" && value !== null && states8.has(value);
|
|
28587
28633
|
}
|
|
28588
28634
|
function numberFormatState(value) {
|
|
28589
28635
|
if (!isSandboxNumberFormat(value)) throw new TypeError("Intl.NumberFormat requires a NumberFormat receiver.");
|
|
28590
|
-
return
|
|
28636
|
+
return states8.get(value);
|
|
28591
28637
|
}
|
|
28592
28638
|
async function numberFormatValue(value, budget, context) {
|
|
28593
28639
|
const primitive = typeof value === "object" && value !== null ? await objectToPrimitive(value, budget, context, /* @__PURE__ */ new Set(), "number") : value;
|
|
@@ -28941,9 +28987,11 @@ function captureGuestHeapNode(value, encode) {
|
|
|
28941
28987
|
return void 0;
|
|
28942
28988
|
}
|
|
28943
28989
|
if (isSandboxLocale(value)) return { kind: "guest-locale", tag: localeTag(value), state: captureObjectState(value, encode) };
|
|
28990
|
+
if (isSandboxListFormat(value)) return { kind: "guest-listformat", options: { ...listFormatState(value).options }, state: captureObjectState(value, encode) };
|
|
28991
|
+
if (isSandboxRelativeTimeFormat(value)) return { kind: "guest-relativetimeformat", options: { ...relativeTimeFormatState(value).options }, state: captureObjectState(value, encode) };
|
|
28944
28992
|
if (isSandboxNumberFormat(value)) {
|
|
28945
|
-
const { options, format } = numberFormatState(value);
|
|
28946
|
-
return { kind: "guest-numberformat", options: { ...options }, ...
|
|
28993
|
+
const { options, format: format3 } = numberFormatState(value);
|
|
28994
|
+
return { kind: "guest-numberformat", options: { ...options }, ...format3 === void 0 ? {} : { format: encode(format3) }, state: captureObjectState(value, encode) };
|
|
28947
28995
|
}
|
|
28948
28996
|
if (isSandboxCollator(value)) {
|
|
28949
28997
|
const { options, compare } = collatorState(value);
|
|
@@ -33374,6 +33422,211 @@ function createNumberFormatConstructor(budget) {
|
|
|
33374
33422
|
return constructor;
|
|
33375
33423
|
}
|
|
33376
33424
|
|
|
33425
|
+
// packages/safe-js/src/interp/globals/intl-listformat.ts
|
|
33426
|
+
var supportedLocalesOf4 = Intl.ListFormat.supportedLocalesOf;
|
|
33427
|
+
var optionTypes2 = [
|
|
33428
|
+
["localeMatcher", ["lookup", "best fit"]],
|
|
33429
|
+
["type", ["conjunction", "disjunction", "unit"]],
|
|
33430
|
+
["style", ["long", "short", "narrow"]]
|
|
33431
|
+
];
|
|
33432
|
+
function createListFormatConstructor(budget) {
|
|
33433
|
+
const prototype = createIntrinsicObject();
|
|
33434
|
+
const constructor = createSandboxClosure({
|
|
33435
|
+
guest: true,
|
|
33436
|
+
sandbox: true,
|
|
33437
|
+
name: "ListFormat",
|
|
33438
|
+
length: 0,
|
|
33439
|
+
call: () => {
|
|
33440
|
+
throw new TypeError("Constructor ListFormat requires 'new'.");
|
|
33441
|
+
},
|
|
33442
|
+
construct: async ([input, options], context) => {
|
|
33443
|
+
const target = context?.newTarget;
|
|
33444
|
+
const selected = target === void 0 || target === constructor ? prototype : context?.getProperty !== void 0 ? await context.getProperty(target, "prototype") : await readPropertyDescriptor(getSandboxPropertyDescriptor(target, "prototype", budget) ?? { value: void 0 }, target, context);
|
|
33445
|
+
let locales2 = [];
|
|
33446
|
+
const converted = /* @__PURE__ */ Object.create(null);
|
|
33447
|
+
const release = retainValues(budget, () => [selected, locales2, converted]);
|
|
33448
|
+
try {
|
|
33449
|
+
locales2 = await canonicalizeGuestLocales(input, budget, context);
|
|
33450
|
+
const source = intlOptionsObject(options, budget);
|
|
33451
|
+
for (const [key, type] of optionTypes2) {
|
|
33452
|
+
const raw = await readIntlProperty(source, key, budget, context);
|
|
33453
|
+
if (raw !== void 0) converted[key] = await convertIntlOption(raw, key, type, budget, context);
|
|
33454
|
+
}
|
|
33455
|
+
const value = createSandboxListFormat(locales2, converted);
|
|
33456
|
+
setSandboxPrototype(value, typeof selected === "object" && selected !== null ? selected : prototype, budget);
|
|
33457
|
+
return allocateProducedSandboxValue(value, budget);
|
|
33458
|
+
} finally {
|
|
33459
|
+
release();
|
|
33460
|
+
}
|
|
33461
|
+
}
|
|
33462
|
+
});
|
|
33463
|
+
const properties = materializeFunctionProperties(constructor);
|
|
33464
|
+
Object.defineProperty(properties, "prototype", { value: prototype, writable: false, configurable: false });
|
|
33465
|
+
Object.defineProperty(properties, "supportedLocalesOf", { value: createSandboxClosure({
|
|
33466
|
+
guest: true,
|
|
33467
|
+
sandbox: true,
|
|
33468
|
+
name: "supportedLocalesOf",
|
|
33469
|
+
length: 1,
|
|
33470
|
+
call: async ([input, options], context) => {
|
|
33471
|
+
const locales2 = await canonicalizeGuestLocales(input, budget, context);
|
|
33472
|
+
const release = retainValues(budget, () => [locales2]);
|
|
33473
|
+
try {
|
|
33474
|
+
const source = intlOptionsObject(options, budget);
|
|
33475
|
+
const raw = await readIntlProperty(source, "localeMatcher", budget, context);
|
|
33476
|
+
const matcher = raw === void 0 ? void 0 : await convertIntlOption(raw, "localeMatcher", ["lookup", "best fit"], budget, context);
|
|
33477
|
+
return allocateProducedSandboxValue(supportedLocalesOf4(locales2, { localeMatcher: matcher }), budget);
|
|
33478
|
+
} finally {
|
|
33479
|
+
release();
|
|
33480
|
+
}
|
|
33481
|
+
}
|
|
33482
|
+
}), writable: true, configurable: true });
|
|
33483
|
+
Object.defineProperties(prototype, {
|
|
33484
|
+
constructor: { value: constructor, writable: true, configurable: true },
|
|
33485
|
+
[Symbol.toStringTag]: { value: "Intl.ListFormat", configurable: true },
|
|
33486
|
+
resolvedOptions: { value: createSandboxClosure({
|
|
33487
|
+
guest: true,
|
|
33488
|
+
sandbox: true,
|
|
33489
|
+
name: "resolvedOptions",
|
|
33490
|
+
length: 0,
|
|
33491
|
+
call: (_args, context) => allocateProducedSandboxValue({ ...listFormatState(context?.thisValue).options }, budget)
|
|
33492
|
+
}), writable: true, configurable: true }
|
|
33493
|
+
});
|
|
33494
|
+
for (const method of ["format", "formatToParts"]) {
|
|
33495
|
+
Object.defineProperty(prototype, method, { value: createSandboxClosure({
|
|
33496
|
+
guest: true,
|
|
33497
|
+
sandbox: true,
|
|
33498
|
+
name: method,
|
|
33499
|
+
length: 1,
|
|
33500
|
+
call: async ([input], context) => {
|
|
33501
|
+
const receiver = context?.thisValue;
|
|
33502
|
+
listFormatState(receiver);
|
|
33503
|
+
const strings = [];
|
|
33504
|
+
let iterator;
|
|
33505
|
+
const release = retainValues(budget, () => [receiver, strings, iterator?.retainedValue]);
|
|
33506
|
+
const checkpoint = createDataCheckpoint(budget, context);
|
|
33507
|
+
try {
|
|
33508
|
+
if (input !== void 0) {
|
|
33509
|
+
iterator = context === void 0 ? getSandboxIterator(input, budget) : await acquireSandboxIterator(input, budget, context);
|
|
33510
|
+
if (iterator === void 0) throw new TypeError("ListFormat requires an iterable.");
|
|
33511
|
+
while (true) {
|
|
33512
|
+
budget.visitNode();
|
|
33513
|
+
const result = await iterator.next();
|
|
33514
|
+
if ((await readIteratorResult(iterator, result, "done")).value) break;
|
|
33515
|
+
const value = (await readIteratorResult(iterator, result, "value")).value;
|
|
33516
|
+
if (typeof value !== "string") {
|
|
33517
|
+
await closeIterator(iterator, true);
|
|
33518
|
+
throw new TypeError("ListFormat requires string elements.");
|
|
33519
|
+
}
|
|
33520
|
+
budget.visitNode(value.length);
|
|
33521
|
+
budget.allocateArrayLength(strings.length + 1);
|
|
33522
|
+
strings.push(value);
|
|
33523
|
+
checkpoint(strings, value.length + 1);
|
|
33524
|
+
}
|
|
33525
|
+
}
|
|
33526
|
+
return allocateProducedSandboxValue(formatList(receiver, strings, method === "formatToParts"), budget);
|
|
33527
|
+
} finally {
|
|
33528
|
+
release();
|
|
33529
|
+
}
|
|
33530
|
+
}
|
|
33531
|
+
}), writable: true, configurable: true });
|
|
33532
|
+
}
|
|
33533
|
+
return constructor;
|
|
33534
|
+
}
|
|
33535
|
+
|
|
33536
|
+
// packages/safe-js/src/interp/globals/intl-relativetimeformat.ts
|
|
33537
|
+
var supportedLocalesOf5 = Intl.RelativeTimeFormat.supportedLocalesOf;
|
|
33538
|
+
var optionTypes3 = [
|
|
33539
|
+
["localeMatcher", ["lookup", "best fit"]],
|
|
33540
|
+
["numberingSystem", "unicodeType"],
|
|
33541
|
+
["style", ["long", "short", "narrow"]],
|
|
33542
|
+
["numeric", ["always", "auto"]]
|
|
33543
|
+
];
|
|
33544
|
+
function createRelativeTimeFormatConstructor(budget) {
|
|
33545
|
+
const prototype = createIntrinsicObject();
|
|
33546
|
+
const constructor = createSandboxClosure({
|
|
33547
|
+
guest: true,
|
|
33548
|
+
sandbox: true,
|
|
33549
|
+
name: "RelativeTimeFormat",
|
|
33550
|
+
length: 0,
|
|
33551
|
+
call: () => {
|
|
33552
|
+
throw new TypeError("Constructor RelativeTimeFormat requires 'new'.");
|
|
33553
|
+
},
|
|
33554
|
+
construct: async ([input, options], context) => {
|
|
33555
|
+
const target = context?.newTarget;
|
|
33556
|
+
const selected = target === void 0 || target === constructor ? prototype : context?.getProperty !== void 0 ? await context.getProperty(target, "prototype") : await readPropertyDescriptor(getSandboxPropertyDescriptor(target, "prototype", budget) ?? { value: void 0 }, target, context);
|
|
33557
|
+
let locales2 = [];
|
|
33558
|
+
const converted = /* @__PURE__ */ Object.create(null);
|
|
33559
|
+
const release = retainValues(budget, () => [selected, locales2, converted]);
|
|
33560
|
+
try {
|
|
33561
|
+
locales2 = await canonicalizeGuestLocales(input, budget, context);
|
|
33562
|
+
const source = intlOptionsObject(options, budget);
|
|
33563
|
+
for (const [key, type] of optionTypes3) {
|
|
33564
|
+
const raw = await readIntlProperty(source, key, budget, context);
|
|
33565
|
+
if (raw !== void 0) converted[key] = await convertIntlOption(raw, key, type, budget, context);
|
|
33566
|
+
}
|
|
33567
|
+
const value = createSandboxRelativeTimeFormat(locales2, converted);
|
|
33568
|
+
setSandboxPrototype(value, typeof selected === "object" && selected !== null ? selected : prototype, budget);
|
|
33569
|
+
return allocateProducedSandboxValue(value, budget);
|
|
33570
|
+
} finally {
|
|
33571
|
+
release();
|
|
33572
|
+
}
|
|
33573
|
+
}
|
|
33574
|
+
});
|
|
33575
|
+
const properties = materializeFunctionProperties(constructor);
|
|
33576
|
+
Object.defineProperty(properties, "prototype", { value: prototype, writable: false, configurable: false });
|
|
33577
|
+
Object.defineProperty(properties, "supportedLocalesOf", { value: createSandboxClosure({
|
|
33578
|
+
guest: true,
|
|
33579
|
+
sandbox: true,
|
|
33580
|
+
name: "supportedLocalesOf",
|
|
33581
|
+
length: 1,
|
|
33582
|
+
call: async ([input, options], context) => {
|
|
33583
|
+
const locales2 = await canonicalizeGuestLocales(input, budget, context);
|
|
33584
|
+
const release = retainValues(budget, () => [locales2]);
|
|
33585
|
+
try {
|
|
33586
|
+
const source = intlOptionsObject(options, budget);
|
|
33587
|
+
const raw = await readIntlProperty(source, "localeMatcher", budget, context);
|
|
33588
|
+
const matcher = raw === void 0 ? void 0 : await convertIntlOption(raw, "localeMatcher", ["lookup", "best fit"], budget, context);
|
|
33589
|
+
return allocateProducedSandboxValue(supportedLocalesOf5(locales2, { localeMatcher: matcher }), budget);
|
|
33590
|
+
} finally {
|
|
33591
|
+
release();
|
|
33592
|
+
}
|
|
33593
|
+
}
|
|
33594
|
+
}), writable: true, configurable: true });
|
|
33595
|
+
Object.defineProperties(prototype, {
|
|
33596
|
+
constructor: { value: constructor, writable: true, configurable: true },
|
|
33597
|
+
[Symbol.toStringTag]: { value: "Intl.RelativeTimeFormat", configurable: true },
|
|
33598
|
+
resolvedOptions: { value: createSandboxClosure({
|
|
33599
|
+
guest: true,
|
|
33600
|
+
sandbox: true,
|
|
33601
|
+
name: "resolvedOptions",
|
|
33602
|
+
length: 0,
|
|
33603
|
+
call: (_args, context) => allocateProducedSandboxValue({ ...relativeTimeFormatState(context?.thisValue).options }, budget)
|
|
33604
|
+
}), writable: true, configurable: true }
|
|
33605
|
+
});
|
|
33606
|
+
for (const method of ["format", "formatToParts"]) {
|
|
33607
|
+
Object.defineProperty(prototype, method, { value: createSandboxClosure({
|
|
33608
|
+
guest: true,
|
|
33609
|
+
sandbox: true,
|
|
33610
|
+
name: method,
|
|
33611
|
+
length: 2,
|
|
33612
|
+
call: async ([input, unit], context) => {
|
|
33613
|
+
const receiver = context?.thisValue;
|
|
33614
|
+
relativeTimeFormatState(receiver);
|
|
33615
|
+
const release = retainValues(budget, () => [receiver, input, unit]);
|
|
33616
|
+
try {
|
|
33617
|
+
const value = await sandboxNumber(input, budget, context);
|
|
33618
|
+
const convertedUnit = await sandboxString(unit, budget, context);
|
|
33619
|
+
budget.visitNode(convertedUnit.length);
|
|
33620
|
+
return allocateProducedSandboxValue(formatRelativeTime(receiver, value, convertedUnit, method === "formatToParts"), budget);
|
|
33621
|
+
} finally {
|
|
33622
|
+
release();
|
|
33623
|
+
}
|
|
33624
|
+
}
|
|
33625
|
+
}), writable: true, configurable: true });
|
|
33626
|
+
}
|
|
33627
|
+
return constructor;
|
|
33628
|
+
}
|
|
33629
|
+
|
|
33377
33630
|
// packages/safe-js/src/interp/globals/intl.ts
|
|
33378
33631
|
var supportedValuesOf = Intl.supportedValuesOf;
|
|
33379
33632
|
function createIntlGlobal(budget) {
|
|
@@ -33389,16 +33642,20 @@ function createIntlGlobal(budget) {
|
|
|
33389
33642
|
const locale = createLocaleConstructor(budget);
|
|
33390
33643
|
const collator = createCollatorConstructor(budget);
|
|
33391
33644
|
const numberFormat = createNumberFormatConstructor(budget);
|
|
33645
|
+
const listFormat = createListFormatConstructor(budget);
|
|
33646
|
+
const relativeTimeFormat = createRelativeTimeFormatConstructor(budget);
|
|
33392
33647
|
Object.defineProperty(intl, "Locale", { value: locale, writable: true, configurable: true });
|
|
33393
33648
|
Object.defineProperty(intl, "Collator", { value: collator, writable: true, configurable: true });
|
|
33394
33649
|
Object.defineProperty(intl, "NumberFormat", { value: numberFormat, writable: true, configurable: true });
|
|
33650
|
+
Object.defineProperty(intl, "ListFormat", { value: listFormat, writable: true, configurable: true });
|
|
33651
|
+
Object.defineProperty(intl, "RelativeTimeFormat", { value: relativeTimeFormat, writable: true, configurable: true });
|
|
33395
33652
|
for (const [name, call] of Object.entries(methods2)) {
|
|
33396
33653
|
const closure = createSandboxClosure({ guest: true, sandbox: true, name, length: 1, call });
|
|
33397
33654
|
Object.defineProperty(intl, name, { value: closure, writable: true, configurable: true });
|
|
33398
33655
|
}
|
|
33399
33656
|
Object.defineProperty(intl, Symbol.toStringTag, { value: "Intl", configurable: true });
|
|
33400
33657
|
registerBuiltinIdentities(budget, { Intl: intl });
|
|
33401
|
-
for (const constructor of [locale, collator, numberFormat]) {
|
|
33658
|
+
for (const constructor of [locale, collator, numberFormat, listFormat]) {
|
|
33402
33659
|
const prototype = constructor.properties.prototype;
|
|
33403
33660
|
for (const owner of [prototype, constructor.properties])
|
|
33404
33661
|
for (const descriptor of Object.values(Object.getOwnPropertyDescriptors(owner)))
|
|
@@ -33515,7 +33772,7 @@ function validateGuestHeapNode(raw, heap, maxArrayLength = 4294967295) {
|
|
|
33515
33772
|
createRawJson(node.text);
|
|
33516
33773
|
return true;
|
|
33517
33774
|
}
|
|
33518
|
-
if (!["module-function", "async-generator-driver", "async-generator-handler", "async-function-driver", "async-function-handler", "thenable-state", "thenable-resolver", "construction-environment", "capability-executor", "promise-aggregate", "aggregate-entry", "aggregate-handler", "intrinsic", "bound-function", "promise-resolver", "pending-promise", "promise-reaction", "promise-adoption", "adoption-resolver", "guest-function", "guest-class", "guest-generator", "scope-frame", "guest-object", "guest-array", "guest-boxed", "guest-date", "guest-locale", "guest-numberformat", "guest-collator", "guest-regex", "guest-promise", "array-iterator", "string-iterator", "async-disposable-stack", "async-cleanup", "async-cleanup-handler", "disposable-stack", "iterator-wrapper", "iterator-helper", "guest-collection-iterator", "guest-regexp-iterator", "map", "set"].includes(String(node.kind))) return false;
|
|
33775
|
+
if (!["module-function", "async-generator-driver", "async-generator-handler", "async-function-driver", "async-function-handler", "thenable-state", "thenable-resolver", "construction-environment", "capability-executor", "promise-aggregate", "aggregate-entry", "aggregate-handler", "intrinsic", "bound-function", "promise-resolver", "pending-promise", "promise-reaction", "promise-adoption", "adoption-resolver", "guest-function", "guest-class", "guest-generator", "scope-frame", "guest-object", "guest-array", "guest-boxed", "guest-date", "guest-locale", "guest-listformat", "guest-relativetimeformat", "guest-numberformat", "guest-collator", "guest-regex", "guest-promise", "array-iterator", "string-iterator", "async-disposable-stack", "async-cleanup", "async-cleanup-handler", "disposable-stack", "iterator-wrapper", "iterator-helper", "guest-collection-iterator", "guest-regexp-iterator", "map", "set"].includes(String(node.kind))) return false;
|
|
33519
33776
|
const reference = (value, kinds) => {
|
|
33520
33777
|
const ref = record2(value);
|
|
33521
33778
|
fields(ref, ["kind", "id"]);
|
|
@@ -33794,11 +34051,29 @@ function validateGuestHeapNode(raw, heap, maxArrayLength = 4294967295) {
|
|
|
33794
34051
|
if (Object.keys(options).length !== Object.keys(restored).length || Object.keys(restored).some((key) => options[key] !== restored[key]))
|
|
33795
34052
|
throw new TypeError("Invalid resolved NumberFormat options.");
|
|
33796
34053
|
if (node.format !== void 0) {
|
|
33797
|
-
const
|
|
33798
|
-
if (reference(
|
|
34054
|
+
const format3 = reference(node.format, ["bound-function"]);
|
|
34055
|
+
if (reference(format3.thisValue) !== node || array(format3.args).length !== 0 || format3.name !== "" || format3.length !== 1 || reference(format3.target, ["intrinsic"]).id !== '["%NumberFormatFormat%"]')
|
|
33799
34056
|
throw new TypeError("Invalid cached NumberFormat function.");
|
|
33800
34057
|
}
|
|
33801
34058
|
state(node.state);
|
|
34059
|
+
} else if (node.kind === "guest-listformat") {
|
|
34060
|
+
fields(node, ["kind", "options", "state"]);
|
|
34061
|
+
const options = record2(node.options);
|
|
34062
|
+
const names = ["locale", "type", "style"];
|
|
34063
|
+
fields(options, [...names]);
|
|
34064
|
+
if (names.some((key) => typeof options[key] !== "string")) throw new TypeError("Invalid ListFormat option type.");
|
|
34065
|
+
const restored = listFormatState(createSandboxListFormat(options.locale, options)).options;
|
|
34066
|
+
if (names.some((key) => options[key] !== restored[key])) throw new TypeError("Invalid resolved ListFormat options.");
|
|
34067
|
+
state(node.state);
|
|
34068
|
+
} else if (node.kind === "guest-relativetimeformat") {
|
|
34069
|
+
fields(node, ["kind", "options", "state"]);
|
|
34070
|
+
const options = record2(node.options);
|
|
34071
|
+
const names = ["locale", "numberingSystem", "style", "numeric"];
|
|
34072
|
+
fields(options, [...names]);
|
|
34073
|
+
if (names.some((key) => typeof options[key] !== "string")) throw new TypeError("Invalid RelativeTimeFormat option type.");
|
|
34074
|
+
const restored = relativeTimeFormatState(createSandboxRelativeTimeFormat(options.locale, options)).options;
|
|
34075
|
+
if (names.some((key) => options[key] !== restored[key])) throw new TypeError("Invalid resolved RelativeTimeFormat options.");
|
|
34076
|
+
state(node.state);
|
|
33802
34077
|
} else if (node.kind === "guest-collator") {
|
|
33803
34078
|
fields(node, ["kind", "options", "state"], ["compare"]);
|
|
33804
34079
|
const options = record2(node.options);
|
|
@@ -37554,6 +37829,8 @@ function measureSandboxData(values, options = {}) {
|
|
|
37554
37829
|
}
|
|
37555
37830
|
if (isSandboxDate(value)) usage += 8;
|
|
37556
37831
|
if (isSandboxLocale(value)) usage += localeTag(value).length;
|
|
37832
|
+
if (isSandboxListFormat(value)) visit(listFormatState(value).options, depth + 1);
|
|
37833
|
+
if (isSandboxRelativeTimeFormat(value)) visit(relativeTimeFormatState(value).options, depth + 1);
|
|
37557
37834
|
if (isSandboxNumberFormat(value)) {
|
|
37558
37835
|
const state = numberFormatState(value);
|
|
37559
37836
|
visit(state.options, depth + 1);
|
|
@@ -55539,4 +55816,4 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
55539
55816
|
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.
|
|
55540
55817
|
|
|
55541
55818
|
*/
|
|
55542
|
-
//# sourceMappingURL=chunk-
|
|
55819
|
+
//# sourceMappingURL=chunk-E2VDSNJC.js.map
|