poe-code 11.0.8 → 11.0.9

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 CHANGED
@@ -143036,6 +143036,9 @@ function getArrayMember(value, property, options) {
143036
143036
  if (property === "length") {
143037
143037
  return value.length;
143038
143038
  }
143039
+ if (Object.hasOwn(value, property)) {
143040
+ return value[String(property)];
143041
+ }
143039
143042
  if (isArrayMethodName(property)) {
143040
143043
  return createSandboxClosure({
143041
143044
  sandbox: true,
@@ -146487,7 +146490,7 @@ async function evaluateMemberCallExpression(node, context) {
146487
146490
  if (typeof member.object === "number" && isNumberMethodName(member.property)) {
146488
146491
  return evaluateNumberMethodCall(node, member.object, member.property, context);
146489
146492
  }
146490
- if (Array.isArray(member.object) && isArrayMethodName(member.property)) {
146493
+ if (Array.isArray(member.object) && isArrayMethodName(member.property) && !Object.hasOwn(member.object, member.property)) {
146491
146494
  return evaluateArrayMethodCall(node, member.object, member.property, context);
146492
146495
  }
146493
146496
  if (isSandboxMap(member.object) && isMapMethodName(member.property)) {
@@ -146514,7 +146517,7 @@ async function evaluateMemberCallExpression(node, context) {
146514
146517
  context
146515
146518
  );
146516
146519
  }
146517
- if (Array.isArray(member.object)) {
146520
+ if (Array.isArray(member.object) && !Object.hasOwn(member.object, member.property)) {
146518
146521
  return evaluatePrimitiveMemberCall(
146519
146522
  node,
146520
146523
  "Array",
@@ -146986,7 +146989,7 @@ function getMemberValue(target, property, context) {
146986
146989
  return Object.hasOwn(target, String(property)) ? target[String(property)] : void 0;
146987
146990
  }
146988
146991
  function getArrayMemberValue(target, property, context) {
146989
- if (property === "raw") {
146992
+ if (property === "raw" && taggedTemplateRawArrays.has(target)) {
146990
146993
  return taggedTemplateRawArrays.get(target);
146991
146994
  }
146992
146995
  return getArrayMember(target, property, createArrayMethodOptions(context));
@@ -147027,23 +147030,20 @@ function getClosureMemberValue(target, property, context) {
147027
147030
  return getFunctionMember(target, property, createFunctionMethodOptions(context));
147028
147031
  }
147029
147032
  async function evaluateResolvedCallExpression(node, callee, context, thisValue = void 0) {
147030
- if (callee === null || callee === void 0) {
147031
- if (node.optional) {
147032
- return {
147033
- kind: "normal",
147034
- hasValue: true,
147035
- value: void 0
147036
- };
147037
- }
147038
- throw new TypeError("Attempted to call a non-function value.");
147039
- }
147040
- if (!isSandboxClosure(callee)) {
147041
- throw new TypeError("Attempted to call a non-function value.");
147033
+ if ((callee === null || callee === void 0) && node.optional) {
147034
+ return {
147035
+ kind: "normal",
147036
+ hasValue: true,
147037
+ value: void 0
147038
+ };
147042
147039
  }
147043
147040
  const args = await evaluateCallArguments(node.arguments, context);
147044
147041
  if (!args.ok) {
147045
147042
  return args.result;
147046
147043
  }
147044
+ if (!isSandboxClosure(callee)) {
147045
+ throw new TypeError("Attempted to call a non-function value.");
147046
+ }
147047
147047
  return {
147048
147048
  kind: "normal",
147049
147049
  hasValue: true,
@@ -155562,7 +155562,7 @@ var init_package2 = __esm({
155562
155562
  "package.json"() {
155563
155563
  package_default2 = {
155564
155564
  name: "poe-code",
155565
- version: "11.0.8",
155565
+ version: "11.0.9",
155566
155566
  description: "CLI tool to configure Poe API for developer workflows.",
155567
155567
  license: "MIT",
155568
155568
  type: "module",