@poe-platform/safe-js 0.1.349 → 0.1.351
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-SABWKUSN.js → chunk-AS6HS2LE.js} +35 -11
- package/dist/safe-js/chunks/{chunk-SABWKUSN.js.map → chunk-AS6HS2LE.js.map} +2 -2
- package/dist/safe-js/chunks/{chunk-7ORDSDBM.js → chunk-Z7WNQACZ.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-7ORDSDBM.js.map → chunk-Z7WNQACZ.js.map} +0 -0
|
@@ -13173,11 +13173,12 @@ function createObjectArrayGlobals(options) {
|
|
|
13173
13173
|
call: async ([value, key, descriptor], context) => {
|
|
13174
13174
|
objectProperties(value, true);
|
|
13175
13175
|
const property = await toPropertyKey(key, options.budget, context);
|
|
13176
|
-
defineDataProperty(
|
|
13176
|
+
await defineDataProperty(
|
|
13177
13177
|
value,
|
|
13178
13178
|
property,
|
|
13179
13179
|
await propertyDescriptor(descriptor, options.budget, context),
|
|
13180
|
-
options.budget
|
|
13180
|
+
options.budget,
|
|
13181
|
+
context
|
|
13181
13182
|
);
|
|
13182
13183
|
return value;
|
|
13183
13184
|
},
|
|
@@ -13756,15 +13757,27 @@ async function definePropertiesFromObject(target, descriptors2, budget, context)
|
|
|
13756
13757
|
const descriptor = await (context?.getProperty !== void 0 ? context.getProperty(descriptors2, key) : getSandboxDataProperty(descriptors2, key, budget));
|
|
13757
13758
|
properties.push([key, await propertyDescriptor(descriptor, budget, context)]);
|
|
13758
13759
|
}
|
|
13759
|
-
for (const [key, descriptor] of properties) defineDataProperty(target, key, descriptor, budget);
|
|
13760
|
+
for (const [key, descriptor] of properties) await defineDataProperty(target, key, descriptor, budget, context);
|
|
13760
13761
|
} finally {
|
|
13761
13762
|
release();
|
|
13762
13763
|
}
|
|
13763
13764
|
}
|
|
13764
|
-
function defineDataProperty(target, key, descriptor, budget) {
|
|
13765
|
+
function defineDataProperty(target, key, descriptor, budget, context) {
|
|
13765
13766
|
budget.visitNode();
|
|
13766
|
-
if (isFloat32Array(target) && typeof key !== "symbol" && isFloat32Index(String(key)) && "value" in descriptor)
|
|
13767
|
-
|
|
13767
|
+
if (isFloat32Array(target) && typeof key !== "symbol" && isFloat32Index(String(key)) && "value" in descriptor) {
|
|
13768
|
+
const { value, ...attributes } = descriptor;
|
|
13769
|
+
Object.defineProperty(target, key, attributes);
|
|
13770
|
+
return (async () => {
|
|
13771
|
+
const release = retainValues(budget, () => [target, value]);
|
|
13772
|
+
try {
|
|
13773
|
+
const number = await sandboxNumber(value, budget, context);
|
|
13774
|
+
Reflect.set(target, key, number);
|
|
13775
|
+
markDescriptorObject(target);
|
|
13776
|
+
} finally {
|
|
13777
|
+
release();
|
|
13778
|
+
}
|
|
13779
|
+
})();
|
|
13780
|
+
}
|
|
13768
13781
|
const properties = objectProperties(target, true);
|
|
13769
13782
|
if (Array.isArray(properties)) {
|
|
13770
13783
|
if (key === "length" && "value" in descriptor)
|
|
@@ -14158,7 +14171,7 @@ async function initializeElement(definition, receiver, homeObject, context, eval
|
|
|
14158
14171
|
value = result.hasValue ? result.value : void 0;
|
|
14159
14172
|
}
|
|
14160
14173
|
if ("key" in definition) {
|
|
14161
|
-
defineDataProperty(receiver, definition.key, { value, configurable: true, writable: true, enumerable: true }, context.budget);
|
|
14174
|
+
await defineDataProperty(receiver, definition.key, { value, configurable: true, writable: true, enumerable: true }, context.budget, createCoercionContext(context));
|
|
14162
14175
|
}
|
|
14163
14176
|
}
|
|
14164
14177
|
|
|
@@ -16296,11 +16309,11 @@ async function evaluateObjectExpression(node, context) {
|
|
|
16296
16309
|
Object.defineProperty(materializeFunctionProperties(value.value), "name", {
|
|
16297
16310
|
value: `${property.kind} ${propertyFunctionName(key.value)}`
|
|
16298
16311
|
});
|
|
16299
|
-
defineDataProperty(object, key.value, {
|
|
16312
|
+
await defineDataProperty(object, key.value, {
|
|
16300
16313
|
[property.kind]: accessorAdapter(value.value, property.kind),
|
|
16301
16314
|
configurable: true,
|
|
16302
16315
|
enumerable: true
|
|
16303
|
-
}, context.budget);
|
|
16316
|
+
}, context.budget, createCoercionContext(context));
|
|
16304
16317
|
continue;
|
|
16305
16318
|
}
|
|
16306
16319
|
if (isObjectPrototypeSetterProperty(property, key.value)) {
|
|
@@ -25445,6 +25458,7 @@ function createBigIntGlobal(budget) {
|
|
|
25445
25458
|
|
|
25446
25459
|
// packages/safe-js/src/interp/globals/array-buffer.ts
|
|
25447
25460
|
var resizeBuffer2 = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "resize")?.value;
|
|
25461
|
+
var readDetached = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "detached")?.get;
|
|
25448
25462
|
function createArrayBufferGlobal(budget) {
|
|
25449
25463
|
const prototype = /* @__PURE__ */ Object.create(null);
|
|
25450
25464
|
const constructor = createSandboxClosure({
|
|
@@ -25615,7 +25629,7 @@ function createArrayBufferGlobal(budget) {
|
|
|
25615
25629
|
}
|
|
25616
25630
|
})
|
|
25617
25631
|
});
|
|
25618
|
-
for (const key of ["byteLength", "maxByteLength", "resizable"]) {
|
|
25632
|
+
for (const key of ["byteLength", "maxByteLength", "resizable", "detached"]) {
|
|
25619
25633
|
const getter = createSandboxClosure({
|
|
25620
25634
|
guest: true,
|
|
25621
25635
|
sandbox: true,
|
|
@@ -25624,6 +25638,16 @@ function createArrayBufferGlobal(budget) {
|
|
|
25624
25638
|
call: (_args, context) => {
|
|
25625
25639
|
if (!isSandboxArrayBuffer(context?.thisValue)) throw new TypeError(`ArrayBuffer ${key} requires a buffer receiver.`);
|
|
25626
25640
|
if (key === "byteLength") return arrayBufferLength(context.thisValue);
|
|
25641
|
+
if (key === "detached") {
|
|
25642
|
+
if (readDetached !== void 0) return Reflect.apply(readDetached, context.thisValue, []);
|
|
25643
|
+
try {
|
|
25644
|
+
new Uint8Array(context.thisValue, 0, 0);
|
|
25645
|
+
return false;
|
|
25646
|
+
} catch (error) {
|
|
25647
|
+
if (error instanceof TypeError) return true;
|
|
25648
|
+
throw error;
|
|
25649
|
+
}
|
|
25650
|
+
}
|
|
25627
25651
|
const options = arrayBufferOptions(context.thisValue);
|
|
25628
25652
|
return key === "resizable" ? options !== void 0 : options?.maxByteLength ?? arrayBufferLength(context.thisValue);
|
|
25629
25653
|
}
|
|
@@ -42664,4 +42688,4 @@ export {
|
|
|
42664
42688
|
FileSnapshotBackend,
|
|
42665
42689
|
run
|
|
42666
42690
|
};
|
|
42667
|
-
//# sourceMappingURL=chunk-
|
|
42691
|
+
//# sourceMappingURL=chunk-AS6HS2LE.js.map
|