@poe-platform/safe-js 0.1.163 → 0.1.164

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-AW3IBVVD.js";
30
+ } from "./chunk-VHZYRV5Q.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-ZXBZUJHU.js.map
8252
+ //# sourceMappingURL=chunk-JPANSO6U.js.map
@@ -2567,6 +2567,7 @@ var Parser = class {
2567
2567
  loopDepth = 0;
2568
2568
  scopes = [/* @__PURE__ */ new Map()];
2569
2569
  functionScopes = /* @__PURE__ */ new WeakSet();
2570
+ parenthesizedNodes = /* @__PURE__ */ new WeakSet();
2570
2571
  varNames = /* @__PURE__ */ new WeakMap();
2571
2572
  withFunctionSource(node) {
2572
2573
  functionSources.set(node, {
@@ -3941,13 +3942,12 @@ var Parser = class {
3941
3942
  parseAssignmentObjectPatternProperty() {
3942
3943
  if (this.consumePunctuator("...") !== void 0) {
3943
3944
  const start = this.previousToken().start;
3944
- const token2 = this.currentToken();
3945
- if (token2.type !== "identifier") {
3945
+ const argument = this.parseAssignmentTarget();
3946
+ if (argument.type !== "Identifier" && (argument.type !== "MemberExpression" || this.hasOptionalAssignmentChain(argument))) {
3946
3947
  throw new Error(
3947
- `Object rest element must bind to an identifier at line ${token2.start.line}, column ${token2.start.column}.`
3948
+ `Object rest assignment requires an identifier or member target at line ${argument.span.start.line}, column ${argument.span.start.column}.`
3948
3949
  );
3949
3950
  }
3950
- const argument = this.parseBindingIdentifier();
3951
3951
  return {
3952
3952
  type: "RestElement",
3953
3953
  argument,
@@ -4427,6 +4427,7 @@ var Parser = class {
4427
4427
  const expression = this.parseExpression({ allowSequence: true });
4428
4428
  const end = this.expectPunctuator(")");
4429
4429
  expression.node.span = createSpan2(start.start, end.end);
4430
+ this.parenthesizedNodes.add(expression.node);
4430
4431
  return {
4431
4432
  node: expression.node,
4432
4433
  parenthesized: true
@@ -4963,9 +4964,9 @@ var Parser = class {
4963
4964
  }
4964
4965
  toObjectPatternProperty(property) {
4965
4966
  if (property.type === "SpreadElement") {
4966
- if (property.argument.type !== "Identifier") {
4967
+ if (property.argument.type !== "Identifier" && (property.argument.type !== "MemberExpression" || this.hasOptionalAssignmentChain(property.argument))) {
4967
4968
  throw new Error(
4968
- `Object rest element must bind to an identifier at line ${property.argument.span.start.line}, column ${property.argument.span.start.column}.`
4969
+ `Object rest assignment requires an identifier or member target at line ${property.argument.span.start.line}, column ${property.argument.span.start.column}.`
4969
4970
  );
4970
4971
  }
4971
4972
  return {
@@ -4984,6 +4985,15 @@ var Parser = class {
4984
4985
  span: property.span
4985
4986
  };
4986
4987
  }
4988
+ hasOptionalAssignmentChain(node) {
4989
+ while (node.type === "MemberExpression" || node.type === "CallExpression") {
4990
+ if (node.optional) return true;
4991
+ const base = node.type === "MemberExpression" ? node.object : node.callee;
4992
+ if (this.parenthesizedNodes.has(base)) return false;
4993
+ node = base;
4994
+ }
4995
+ return false;
4996
+ }
4987
4997
  toObjectPropertyValue(value) {
4988
4998
  if (value.type === "AssignmentExpression" && value.operator === "=") {
4989
4999
  return {
@@ -35886,4 +35896,4 @@ export {
35886
35896
  FileSnapshotBackend,
35887
35897
  run
35888
35898
  };
35889
- //# sourceMappingURL=chunk-AW3IBVVD.js.map
35899
+ //# sourceMappingURL=chunk-VHZYRV5Q.js.map