poe-code 11.0.13 → 11.0.14
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/index.js +16 -1
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-GTX2EXKD.js → chunk-DZH7JZC4.js} +16 -1
- package/packages/safejs/dist/chunks/chunk-DZH7JZC4.js.map +7 -0
- package/packages/safejs/dist/chunks/{chunk-EV4BL6HH.js → chunk-X745DTOB.js} +2 -2
- package/packages/safejs/dist/cli.js +2 -2
- package/packages/safejs/dist/core.js +1 -1
- package/packages/safejs/dist/index.js +2 -2
- package/packages/safejs/dist/interp/async.js +3 -1
- package/packages/safejs/dist/interp/methods/function.js +4 -0
- package/packages/safejs/dist/interp/values.d.ts +2 -0
- package/packages/safejs/dist/interp/values.js +3 -0
- package/packages/safejs/dist/parse/bindings.d.ts +2 -1
- package/packages/safejs/dist/parse/bindings.js +4 -0
- package/packages/safejs/dist/snapshot/restore.js +2 -0
- package/packages/safejs/dist/chunks/chunk-GTX2EXKD.js.map +0 -7
- /package/packages/safejs/dist/chunks/{chunk-EV4BL6HH.js.map → chunk-X745DTOB.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -118889,6 +118889,12 @@ var init_error_codes21 = __esm({
|
|
|
118889
118889
|
});
|
|
118890
118890
|
|
|
118891
118891
|
// packages/safejs/src/parse/bindings.ts
|
|
118892
|
+
function getFunctionLength(params) {
|
|
118893
|
+
const firstOptional = params.findIndex(
|
|
118894
|
+
(param) => param.type === "AssignmentPattern" || param.type === "RestElement"
|
|
118895
|
+
);
|
|
118896
|
+
return firstOptional === -1 ? params.length : firstOptional;
|
|
118897
|
+
}
|
|
118892
118898
|
function* boundIdentifiers(pattern) {
|
|
118893
118899
|
switch (pattern.type) {
|
|
118894
118900
|
case "Identifier":
|
|
@@ -139889,6 +139895,9 @@ function createSandboxClosure(input) {
|
|
|
139889
139895
|
if (input.sandbox === true) {
|
|
139890
139896
|
Object.defineProperty(closure, "sandbox", { value: true });
|
|
139891
139897
|
}
|
|
139898
|
+
if (input.length !== void 0) {
|
|
139899
|
+
Object.defineProperty(closure, "length", { value: input.length });
|
|
139900
|
+
}
|
|
139892
139901
|
if (input.boundTarget !== void 0) {
|
|
139893
139902
|
Object.defineProperty(closure, "boundTarget", { value: input.boundTarget });
|
|
139894
139903
|
}
|
|
@@ -141148,6 +141157,7 @@ function createInterpretedClosure(node, context, evaluateNode3) {
|
|
|
141148
141157
|
} : void 0;
|
|
141149
141158
|
return createSandboxClosure({
|
|
141150
141159
|
sandbox: true,
|
|
141160
|
+
length: getFunctionLength(node.params),
|
|
141151
141161
|
...node.async ? { async: true } : {},
|
|
141152
141162
|
...node.type === "FunctionDeclaration" || node.type === "FunctionExpression" ? node.id === void 0 ? {} : { name: node.id.name } : {},
|
|
141153
141163
|
...construct === void 0 ? {} : { construct },
|
|
@@ -141199,6 +141209,7 @@ function createInterpretedClosure(node, context, evaluateNode3) {
|
|
|
141199
141209
|
function createGeneratorClosure(node, context, evaluateNode3) {
|
|
141200
141210
|
return createSandboxClosure({
|
|
141201
141211
|
sandbox: true,
|
|
141212
|
+
length: getFunctionLength(node.params),
|
|
141202
141213
|
...node.id === void 0 ? {} : { name: node.id.name },
|
|
141203
141214
|
retainedValues: () => context.scope.retainedValues(),
|
|
141204
141215
|
call: async (args, callContext) => {
|
|
@@ -143660,6 +143671,9 @@ function getFunctionMember(target, property, options) {
|
|
|
143660
143671
|
if (propertyValue !== void 0 || Object.hasOwn(target.properties ?? {}, String(property))) {
|
|
143661
143672
|
return propertyValue;
|
|
143662
143673
|
}
|
|
143674
|
+
if (property === "length") {
|
|
143675
|
+
return target.length;
|
|
143676
|
+
}
|
|
143663
143677
|
if (!isFunctionMethodName(property)) {
|
|
143664
143678
|
return void 0;
|
|
143665
143679
|
}
|
|
@@ -143679,6 +143693,7 @@ function callFunctionMethod(target, methodName, args, options, stack) {
|
|
|
143679
143693
|
return createSandboxClosure({
|
|
143680
143694
|
sandbox: true,
|
|
143681
143695
|
name: `bound ${target.name ?? ""}`,
|
|
143696
|
+
length: target.length === void 0 ? void 0 : Math.max(0, target.length - boundArgs.length),
|
|
143682
143697
|
boundTarget: target,
|
|
143683
143698
|
retainedValues: () => [target, thisValue, ...boundArgs],
|
|
143684
143699
|
call: (callArgs, context) => options.callClosure(target, [...boundArgs, ...callArgs], context?.stack ?? [], thisValue),
|
|
@@ -155614,7 +155629,7 @@ var init_package2 = __esm({
|
|
|
155614
155629
|
"package.json"() {
|
|
155615
155630
|
package_default2 = {
|
|
155616
155631
|
name: "poe-code",
|
|
155617
|
-
version: "11.0.
|
|
155632
|
+
version: "11.0.14",
|
|
155618
155633
|
description: "CLI tool to configure Poe API for developer workflows.",
|
|
155619
155634
|
license: "MIT",
|
|
155620
155635
|
type: "module",
|