@poe-platform/safe-js 0.1.372 → 0.1.374
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-LS3B42FU.js → chunk-35DAUDMZ.js} +19 -4
- package/dist/safe-js/chunks/chunk-35DAUDMZ.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-MABO4QY7.js → chunk-SOATRIJB.js} +2 -2
- 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/package.json +2 -2
- package/dist/safe-js/chunks/chunk-LS3B42FU.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-MABO4QY7.js.map → chunk-SOATRIJB.js.map} +0 -0
|
@@ -8086,6 +8086,17 @@ function isGuestClosure(value) {
|
|
|
8086
8086
|
function getGuestFunctionProperties(closure) {
|
|
8087
8087
|
return functionProperties.get(closure);
|
|
8088
8088
|
}
|
|
8089
|
+
function intrinsicFunctionDataDescriptors(properties) {
|
|
8090
|
+
const state = functionPropertyRevisions.get(properties);
|
|
8091
|
+
if (state?.measuredDescriptors !== void 0 && state.measuredRevision === state.revision)
|
|
8092
|
+
return state.measuredDescriptors;
|
|
8093
|
+
const descriptors2 = Object.entries(Object.getOwnPropertyDescriptors(properties)).filter(([key]) => key !== "prototype" && key !== "name" && key !== "length");
|
|
8094
|
+
if (state !== void 0) {
|
|
8095
|
+
state.measuredRevision = state.revision;
|
|
8096
|
+
state.measuredDescriptors = descriptors2;
|
|
8097
|
+
}
|
|
8098
|
+
return descriptors2;
|
|
8099
|
+
}
|
|
8089
8100
|
function materializeFunctionProperties(closure) {
|
|
8090
8101
|
if (!isGuestClosure(closure)) throw new TypeError("Host function properties are read only.");
|
|
8091
8102
|
const existing = functionProperties.get(closure);
|
|
@@ -28541,8 +28552,13 @@ function measureSandboxData(values, options = {}) {
|
|
|
28541
28552
|
if (Array.isArray(value)) {
|
|
28542
28553
|
usage += value.length;
|
|
28543
28554
|
if (hasManagedDescriptors(value)) {
|
|
28544
|
-
|
|
28555
|
+
const descriptors3 = [];
|
|
28556
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
28545
28557
|
if (key === "length") continue;
|
|
28558
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
28559
|
+
if (descriptor !== void 0) descriptors3.push([key, descriptor]);
|
|
28560
|
+
}
|
|
28561
|
+
for (const [key, descriptor] of descriptors3) {
|
|
28546
28562
|
usage += key.length + 1;
|
|
28547
28563
|
if ("value" in descriptor) visit(descriptor.value, depth + 1);
|
|
28548
28564
|
else for (const closure of retainedAccessorClosures(descriptor)) visit(closure, depth + 1);
|
|
@@ -28601,8 +28617,7 @@ function measureSandboxData(values, options = {}) {
|
|
|
28601
28617
|
if (options.ignoreClosures) return;
|
|
28602
28618
|
if (value.properties !== void 0) {
|
|
28603
28619
|
if (isIntrinsicFunction(value)) {
|
|
28604
|
-
for (const [key, descriptor] of
|
|
28605
|
-
if (key === "prototype" || key === "name" || key === "length") continue;
|
|
28620
|
+
for (const [key, descriptor] of intrinsicFunctionDataDescriptors(value.properties)) {
|
|
28606
28621
|
usage += key.length + 1;
|
|
28607
28622
|
if ("value" in descriptor) visit(descriptor.value, depth + 1);
|
|
28608
28623
|
else for (const closure of retainedAccessorClosures(descriptor)) visit(closure, depth + 1);
|
|
@@ -43632,4 +43647,4 @@ export {
|
|
|
43632
43647
|
FileSnapshotBackend,
|
|
43633
43648
|
run
|
|
43634
43649
|
};
|
|
43635
|
-
//# sourceMappingURL=chunk-
|
|
43650
|
+
//# sourceMappingURL=chunk-35DAUDMZ.js.map
|