@danielx/civet 0.6.34 → 0.6.36

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/browser.js CHANGED
@@ -526,23 +526,16 @@ ${input.slice(result.pos)}
526
526
  }
527
527
  }
528
528
  function addPostfixStatement(statement, ws, post) {
529
- let children, expressions;
530
- const prefix = post.blockPrefix || post.condition?.expression.blockPrefix;
531
- if (prefix?.length) {
532
- const indent = prefix[0][0];
533
- expressions = [...prefix, [indent, statement]];
534
- children = [" {\n", ...expressions, "\n", indent?.slice?.(0, -2), "}"];
535
- } else {
536
- expressions = [["", statement]];
537
- children = [" { ", ...expressions, " }"];
538
- }
529
+ const expressions = [
530
+ ...post.blockPrefix || [],
531
+ ["", statement]
532
+ ];
539
533
  const block = {
540
534
  type: "BlockStatement",
541
- children,
535
+ children: [" { ", expressions, " }"],
542
536
  expressions
543
537
  };
544
- children = [...post.children];
545
- children.push(block);
538
+ const children = [...post.children, block];
546
539
  if (!isWhitespaceOrEmpty(ws))
547
540
  children.push(ws);
548
541
  post = { ...post, children, block };
@@ -1983,6 +1976,66 @@ ${input.slice(result.pos)}
1983
1976
  }
1984
1977
  return parts;
1985
1978
  }
1979
+ function duplicateBlock(block) {
1980
+ const expressions = [...block.expressions];
1981
+ const children = [...block.children];
1982
+ children.splice(children.indexOf(block.expressions), 1, expressions);
1983
+ return {
1984
+ ...block,
1985
+ expressions,
1986
+ children
1987
+ };
1988
+ }
1989
+ function makeGetterMethod(name, ws, value, block, kind = { token: "get" }, autoReturn = true) {
1990
+ const { token } = kind;
1991
+ ws = insertTrimmingSpace(ws, "");
1992
+ let setVal;
1993
+ const parameters = token === "get" ? {
1994
+ type: "Parameters",
1995
+ children: ["()"],
1996
+ names: [],
1997
+ implicit: true
1998
+ } : {
1999
+ type: "Parameters",
2000
+ children: ["(", setVal = makeRef("value"), ")"],
2001
+ names: [],
2002
+ implicit: false
2003
+ };
2004
+ let expressions;
2005
+ if (block) {
2006
+ block = duplicateBlock(block);
2007
+ expressions = block.expressions;
2008
+ } else {
2009
+ expressions = [];
2010
+ block = {
2011
+ type: "BlockStatement",
2012
+ expressions,
2013
+ children: ["{ ", expressions, " }"]
2014
+ };
2015
+ }
2016
+ if (autoReturn) {
2017
+ const finalStatement = token === "get" ? [[expressions[0]?.[0] || "", ws], wrapWithReturn(value)] : [[expressions[0]?.[0] || "", ws], [value, " = ", setVal]];
2018
+ expressions.push(finalStatement);
2019
+ }
2020
+ const children = [kind, " ", name, parameters, block];
2021
+ return {
2022
+ type: "MethodDefinition",
2023
+ children,
2024
+ name,
2025
+ signature: {
2026
+ type: "MethodSignature",
2027
+ modifier: {
2028
+ get: token === "get",
2029
+ set: token === "set",
2030
+ async: false
2031
+ },
2032
+ name,
2033
+ returnType: void 0
2034
+ },
2035
+ block,
2036
+ parameters
2037
+ };
2038
+ }
1986
2039
  function needsRef(expression, base = "ref") {
1987
2040
  switch (expression.type) {
1988
2041
  case "Ref":
@@ -2058,6 +2111,81 @@ ${input.slice(result.pos)}
2058
2111
  children
2059
2112
  };
2060
2113
  }
2114
+ function processDeclarationCondition(condition) {
2115
+ if (!(condition.type === "DeclarationCondition")) {
2116
+ return;
2117
+ }
2118
+ const ref = makeRef();
2119
+ const { decl, bindings } = condition.declaration;
2120
+ const binding = bindings[0];
2121
+ const { pattern, suffix, initializer, splices, thisAssignments } = binding;
2122
+ const initCondition = {
2123
+ type: "AssignmentExpression",
2124
+ children: [ref, initializer],
2125
+ hoistDec: {
2126
+ type: "Declaration",
2127
+ children: ["let ", ref, suffix],
2128
+ names: []
2129
+ },
2130
+ blockPrefix: [
2131
+ ["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
2132
+ ...thisAssignments
2133
+ ],
2134
+ pattern,
2135
+ ref
2136
+ };
2137
+ Object.assign(condition, initCondition);
2138
+ }
2139
+ function processDeclarationConditions(node) {
2140
+ gatherRecursiveAll(node, (n) => {
2141
+ return n.type === "IfStatement" || n.type === "IterationStatement";
2142
+ }).forEach(processDeclarationConditionStatement);
2143
+ }
2144
+ function processDeclarationConditionStatement(s) {
2145
+ const { condition } = s;
2146
+ if (!condition) {
2147
+ return;
2148
+ }
2149
+ processDeclarationCondition(condition.expression);
2150
+ const { ref, pattern } = condition.expression;
2151
+ if (pattern) {
2152
+ let conditions = [];
2153
+ getPatternConditions(pattern, ref, conditions);
2154
+ conditions = conditions.filter((c) => {
2155
+ return !(c.length === 3 && c[0] === "typeof " && c[1] === ref && c[2] === " === 'object'") && !(c.length === 2 && c[0] === ref && c[1] === " != null");
2156
+ });
2157
+ if (conditions.length) {
2158
+ condition.children.unshift("(");
2159
+ conditions.forEach(function(c) {
2160
+ return condition.children.push(" && ", c);
2161
+ });
2162
+ condition.children.push(")");
2163
+ }
2164
+ }
2165
+ switch (s.type) {
2166
+ case "IfStatement": {
2167
+ const { else: e } = s;
2168
+ const block = blockWithPrefix(condition.expression.blockPrefix, s.then);
2169
+ s.then = block;
2170
+ const toAdd = [block];
2171
+ if (block.bare && e) {
2172
+ toAdd.push(";");
2173
+ }
2174
+ s.children.splice(2, 1, ...toAdd);
2175
+ updateParentPointers(block, s);
2176
+ break;
2177
+ }
2178
+ case "IterationStatement": {
2179
+ const { children, block } = s;
2180
+ const newBlock = blockWithPrefix(condition.expression.blockPrefix, block);
2181
+ s.children = children.map(function(c) {
2182
+ return c.type === "BlockStatement" ? newBlock : c;
2183
+ });
2184
+ updateParentPointers(newBlock, s);
2185
+ break;
2186
+ }
2187
+ }
2188
+ }
2061
2189
  function implicitFunctionBlock(f) {
2062
2190
  if (f.abstract || f.block || f.signature?.optional)
2063
2191
  return;
@@ -2731,6 +2859,7 @@ ${input.slice(result.pos)}
2731
2859
  assert.equal(m.JSXTagStack.length, 1, "JSXTagStack");
2732
2860
  addParentPointers(root);
2733
2861
  const { expressions: statements } = root;
2862
+ processDeclarationConditions(statements);
2734
2863
  processPipelineExpressions(statements);
2735
2864
  processAssignments(statements);
2736
2865
  processPatternMatching(statements, ReservedWord);
@@ -3281,6 +3410,7 @@ ${input.slice(result.pos)}
3281
3410
  literalValue,
3282
3411
  makeAsConst,
3283
3412
  makeEmptyBlock,
3413
+ makeGetterMethod,
3284
3414
  makeLeftHandSideExpression,
3285
3415
  makeRef,
3286
3416
  maybeRef,
@@ -3376,6 +3506,9 @@ ${input.slice(result.pos)}
3376
3506
  RHS,
3377
3507
  ParenthesizedAssignment,
3378
3508
  UnaryExpression,
3509
+ UnaryWithoutParenthesizedAssignment,
3510
+ UnaryBody,
3511
+ UnaryWithoutParenthesizedAssignmentBody,
3379
3512
  UnaryPostfix,
3380
3513
  UpdateExpression,
3381
3514
  UpdateExpressionSymbol,
@@ -3432,6 +3565,7 @@ ${input.slice(result.pos)}
3432
3565
  OptionalDot,
3433
3566
  NonNullAssertion,
3434
3567
  MemberExpression,
3568
+ MemberBase,
3435
3569
  MemberExpressionRest,
3436
3570
  MemberExpressionRestBody,
3437
3571
  MemberBracketContent,
@@ -4650,7 +4784,7 @@ ${input.slice(result.pos)}
4650
4784
  function ParenthesizedAssignment(ctx, state) {
4651
4785
  return $EVENT(ctx, state, "ParenthesizedAssignment", ParenthesizedAssignment$0);
4652
4786
  }
4653
- var UnaryExpression$0 = $TS($S($Q(UnaryOp), $C(UpdateExpression, NestedNonAssignmentExtendedExpression), $E(UnaryPostfix)), function($skip, $loc, $0, $1, $2, $3) {
4787
+ var UnaryExpression$0 = $TS($S($Q(UnaryOp), UnaryBody, $E(UnaryPostfix)), function($skip, $loc, $0, $1, $2, $3) {
4654
4788
  var pre = $1;
4655
4789
  var exp = $2;
4656
4790
  var post = $3;
@@ -4666,6 +4800,30 @@ ${input.slice(result.pos)}
4666
4800
  function UnaryExpression(ctx, state) {
4667
4801
  return $EVENT_C(ctx, state, "UnaryExpression", UnaryExpression$$);
4668
4802
  }
4803
+ var UnaryWithoutParenthesizedAssignment$0 = $TS($S($Q(UnaryOp), UnaryWithoutParenthesizedAssignmentBody, $E(UnaryPostfix)), function($skip, $loc, $0, $1, $2, $3) {
4804
+ var pre = $1;
4805
+ var exp = $2;
4806
+ var post = $3;
4807
+ return processUnaryExpression(pre, exp, post);
4808
+ });
4809
+ function UnaryWithoutParenthesizedAssignment(ctx, state) {
4810
+ return $EVENT(ctx, state, "UnaryWithoutParenthesizedAssignment", UnaryWithoutParenthesizedAssignment$0);
4811
+ }
4812
+ var UnaryBody$0 = ParenthesizedAssignment;
4813
+ var UnaryBody$1 = UpdateExpression;
4814
+ var UnaryBody$2 = ExpressionizedStatementWithTrailingCallExpressions;
4815
+ var UnaryBody$3 = NestedNonAssignmentExtendedExpression;
4816
+ var UnaryBody$$ = [UnaryBody$0, UnaryBody$1, UnaryBody$2, UnaryBody$3];
4817
+ function UnaryBody(ctx, state) {
4818
+ return $EVENT_C(ctx, state, "UnaryBody", UnaryBody$$);
4819
+ }
4820
+ var UnaryWithoutParenthesizedAssignmentBody$0 = UpdateExpression;
4821
+ var UnaryWithoutParenthesizedAssignmentBody$1 = ExpressionizedStatementWithTrailingCallExpressions;
4822
+ var UnaryWithoutParenthesizedAssignmentBody$2 = NestedNonAssignmentExtendedExpression;
4823
+ var UnaryWithoutParenthesizedAssignmentBody$$ = [UnaryWithoutParenthesizedAssignmentBody$0, UnaryWithoutParenthesizedAssignmentBody$1, UnaryWithoutParenthesizedAssignmentBody$2];
4824
+ function UnaryWithoutParenthesizedAssignmentBody(ctx, state) {
4825
+ return $EVENT_C(ctx, state, "UnaryWithoutParenthesizedAssignmentBody", UnaryWithoutParenthesizedAssignmentBody$$);
4826
+ }
4669
4827
  var UnaryPostfix$0 = QuestionMark;
4670
4828
  var UnaryPostfix$1 = $T($P($S(__, $C(As, Satisfies), Type)), function(value) {
4671
4829
  return { "ts": true, "children": value };
@@ -4674,7 +4832,7 @@ ${input.slice(result.pos)}
4674
4832
  function UnaryPostfix(ctx, state) {
4675
4833
  return $EVENT_C(ctx, state, "UnaryPostfix", UnaryPostfix$$);
4676
4834
  }
4677
- var UpdateExpression$0 = $TS($S(UpdateExpressionSymbol, UnaryExpression), function($skip, $loc, $0, $1, $2) {
4835
+ var UpdateExpression$0 = $TS($S(UpdateExpressionSymbol, UnaryWithoutParenthesizedAssignment), function($skip, $loc, $0, $1, $2) {
4678
4836
  return {
4679
4837
  type: "UpdateExpression",
4680
4838
  assigned: $2,
@@ -5067,10 +5225,22 @@ ${input.slice(result.pos)}
5067
5225
  return $EVENT(ctx, state, "NestedClassElement", NestedClassElement$0);
5068
5226
  }
5069
5227
  var ClassElement$0 = $TS($S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), ClassElementDefinition), function($skip, $loc, $0, $1, $2, $3, $4) {
5228
+ var decorators = $1;
5070
5229
  var definition = $4;
5230
+ if (definition.type === "ShorthandMethodDefinition") {
5231
+ return {
5232
+ ...definition,
5233
+ children: definition.children.map((c) => {
5234
+ return {
5235
+ ...c,
5236
+ children: [decorators, ...c.children]
5237
+ };
5238
+ })
5239
+ };
5240
+ }
5071
5241
  return {
5072
5242
  ...definition,
5073
- children: [$1, $2, $3, ...definition.children]
5243
+ children: [decorators, $2, $3, ...definition.children]
5074
5244
  };
5075
5245
  });
5076
5246
  var ClassElement$1 = $TS($S(Static, BracedBlock), function($skip, $loc, $0, $1, $2) {
@@ -5180,7 +5350,14 @@ ${input.slice(result.pos)}
5180
5350
  var ThisLiteral$1 = $TS($S(AtThis, $TEXT($S($E(Hash), IdentifierName))), function($skip, $loc, $0, $1, $2) {
5181
5351
  var at = $1;
5182
5352
  var id = $2;
5183
- return [at, ".", id];
5353
+ return {
5354
+ type: "MemberExpression",
5355
+ children: [at, {
5356
+ type: "PropertyAccess",
5357
+ name: id,
5358
+ children: [".", id]
5359
+ }]
5360
+ };
5184
5361
  });
5185
5362
  var ThisLiteral$2 = AtThis;
5186
5363
  var ThisLiteral$3 = PrivateThis;
@@ -5194,7 +5371,14 @@ ${input.slice(result.pos)}
5194
5371
  });
5195
5372
  var PrivateThis$1 = $TV(PrivateIdentifier, function($skip, $loc, $0, $1) {
5196
5373
  var id = $0;
5197
- return ["this.", id];
5374
+ return {
5375
+ type: "MemberExpression",
5376
+ children: ["this", {
5377
+ type: "PropertyAccess",
5378
+ name: id.name,
5379
+ children: [".", id]
5380
+ }]
5381
+ };
5198
5382
  });
5199
5383
  var PrivateThis$$ = [PrivateThis$0, PrivateThis$1];
5200
5384
  function PrivateThis(ctx, state) {
@@ -5281,7 +5465,7 @@ ${input.slice(result.pos)}
5281
5465
  function NonNullAssertion(ctx, state) {
5282
5466
  return $EVENT(ctx, state, "NonNullAssertion", NonNullAssertion$0);
5283
5467
  }
5284
- var MemberExpression$0 = $TS($S($C(PrimaryExpression, SuperProperty, MetaProperty), $Q(MemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
5468
+ var MemberExpression$0 = $TS($S(MemberBase, $Q(MemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
5285
5469
  var rest = $2;
5286
5470
  if (rest.length || Array.isArray($1)) {
5287
5471
  return processCallMemberExpression({
@@ -5294,6 +5478,13 @@ ${input.slice(result.pos)}
5294
5478
  function MemberExpression(ctx, state) {
5295
5479
  return $EVENT(ctx, state, "MemberExpression", MemberExpression$0);
5296
5480
  }
5481
+ var MemberBase$0 = PrimaryExpression;
5482
+ var MemberBase$1 = SuperProperty;
5483
+ var MemberBase$2 = MetaProperty;
5484
+ var MemberBase$$ = [MemberBase$0, MemberBase$1, MemberBase$2];
5485
+ function MemberBase(ctx, state) {
5486
+ return $EVENT_C(ctx, state, "MemberBase", MemberBase$$);
5487
+ }
5297
5488
  var MemberExpressionRest$0 = $TS($S($Q(MultiLineComment), MemberExpressionRestBody), function($skip, $loc, $0, $1, $2) {
5298
5489
  var comments = $1;
5299
5490
  var body = $2;
@@ -5497,7 +5688,7 @@ ${input.slice(result.pos)}
5497
5688
  function PropertyAccess(ctx, state) {
5498
5689
  return $EVENT_C(ctx, state, "PropertyAccess", PropertyAccess$$);
5499
5690
  }
5500
- var PropertyGlob$0 = $TS($S(OptionalDot, $Q(MultiLineComment), BracedObjectLiteral), function($skip, $loc, $0, $1, $2, $3) {
5691
+ var PropertyGlob$0 = $TS($S($S($E($C(QuestionMark, NonNullAssertion)), OptionalDot), $Q(MultiLineComment), BracedObjectLiteral), function($skip, $loc, $0, $1, $2, $3) {
5501
5692
  var dot = $1;
5502
5693
  var object = $3;
5503
5694
  return {
@@ -7303,7 +7494,76 @@ ${input.slice(result.pos)}
7303
7494
  parameters: signature.parameters
7304
7495
  };
7305
7496
  });
7306
- var MethodDefinition$$ = [MethodDefinition$0, MethodDefinition$1];
7497
+ var MethodDefinition$2 = $TS($S(GetOrSet, $E(_), ForbidIndentedApplication, $E($S(MemberBase, $Q(CallExpressionRest))), RestoreIndentedApplication, $E(BracedBlock)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
7498
+ var kind = $1;
7499
+ var ws = $2;
7500
+ var value = $4;
7501
+ var block = $6;
7502
+ if (!value)
7503
+ return $skip;
7504
+ const rest = value[1];
7505
+ if (!rest.length) {
7506
+ const base = value[0];
7507
+ let name2;
7508
+ if (base.type === "MemberExpression") {
7509
+ const lastAccess2 = lastAccessInCallExpression(base);
7510
+ if (lastAccess2) {
7511
+ ({ name: name2 } = lastAccess2);
7512
+ }
7513
+ }
7514
+ if (!name2)
7515
+ ({ name: name2 } = base);
7516
+ if (!name2)
7517
+ return $skip;
7518
+ if (name2[0] === "#")
7519
+ name2 = name2.slice(1);
7520
+ const autoReturn = !block || base.type !== "Identifier";
7521
+ return makeGetterMethod(name2, ws, base, block, kind, autoReturn);
7522
+ }
7523
+ let last = rest[rest.length - 1];
7524
+ while (Array.isArray(last)) {
7525
+ last = last[last.length - 1];
7526
+ }
7527
+ switch (last.type) {
7528
+ case "Call":
7529
+ return $skip;
7530
+ case "PropertyAccess":
7531
+ const { name: name2 } = last;
7532
+ return makeGetterMethod(name2, ws, value, block, kind);
7533
+ case "PropertyGlob":
7534
+ return {
7535
+ type: "ShorthandMethodDefinition",
7536
+ children: last.object.properties.map((p) => {
7537
+ const { name: name3, type } = p;
7538
+ let v;
7539
+ switch (type) {
7540
+ case "Identifier":
7541
+ v = insertTrimmingSpace(p, "");
7542
+ break;
7543
+ case "Property":
7544
+ v = insertTrimmingSpace(p.value, "");
7545
+ break;
7546
+ }
7547
+ const exp = processCallMemberExpression({
7548
+ type: "CallExpression",
7549
+ children: [value[0], ...value[1].slice(0, -1), {
7550
+ type: "PropertyAccess",
7551
+ children: [last.dot, {
7552
+ ...v,
7553
+ children: [v.children.slice(0, 2)]
7554
+ // Remove potential delimiter
7555
+ }]
7556
+ }]
7557
+ });
7558
+ return makeGetterMethod(name3, ws, exp, block, kind);
7559
+ })
7560
+ };
7561
+ }
7562
+ const lastAccess = lastAccessInCallExpression({ children: rest });
7563
+ const { name } = lastAccess;
7564
+ return makeGetterMethod(name, ws, value, block, kind);
7565
+ });
7566
+ var MethodDefinition$$ = [MethodDefinition$0, MethodDefinition$1, MethodDefinition$2];
7307
7567
  function MethodDefinition(ctx, state) {
7308
7568
  return $EVENT_C(ctx, state, "MethodDefinition", MethodDefinition$$);
7309
7569
  }
@@ -7389,13 +7649,14 @@ ${input.slice(result.pos)}
7389
7649
  return $EVENT_C(ctx, state, "ClassElementName", ClassElementName$$);
7390
7650
  }
7391
7651
  var PrivateIdentifier$0 = $TV($TEXT($S(Hash, IdentifierName)), function($skip, $loc, $0, $1) {
7652
+ var id = $0;
7392
7653
  return {
7393
7654
  type: "Identifier",
7394
- name: $0,
7395
- names: [$0],
7655
+ name: id,
7656
+ names: [id],
7396
7657
  children: [{
7397
7658
  $loc,
7398
- token: $0
7659
+ token: id
7399
7660
  }]
7400
7661
  };
7401
7662
  });
@@ -7904,16 +8165,10 @@ ${input.slice(result.pos)}
7904
8165
  var clause = $1;
7905
8166
  var block = $2;
7906
8167
  var e = $3;
7907
- const children = [...clause.children];
7908
- block = blockWithPrefix(clause.condition.expression.blockPrefix, block);
7909
- children.push(block);
7910
- if (block.bare && e)
7911
- children.push(";");
7912
- if (e)
7913
- children.push(e);
7914
8168
  return {
7915
- ...clause,
7916
- children,
8169
+ type: "IfStatement",
8170
+ children: [...clause.children, block, e],
8171
+ condition: clause.condition,
7917
8172
  then: block,
7918
8173
  else: e
7919
8174
  };
@@ -8136,7 +8391,6 @@ ${input.slice(result.pos)}
8136
8391
  var WhileStatement$0 = $TS($S(WhileClause, Block), function($skip, $loc, $0, $1, $2) {
8137
8392
  var clause = $1;
8138
8393
  var block = $2;
8139
- block = blockWithPrefix(clause.condition.expression.blockPrefix, block);
8140
8394
  return {
8141
8395
  ...clause,
8142
8396
  children: [...clause.children, block],
@@ -8755,27 +9009,13 @@ ${input.slice(result.pos)}
8755
9009
  return $EVENT_C(ctx, state, "Condition", Condition$$);
8756
9010
  }
8757
9011
  var DeclarationCondition$0 = $TS($S(ForbidIndentedApplication, $E(LexicalDeclaration), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3) {
8758
- var dec = $2;
8759
- if (!dec)
9012
+ var declaration = $2;
9013
+ if (!declaration)
8760
9014
  return $skip;
8761
- const ref = makeRef();
8762
- const { decl, bindings } = dec;
8763
- const binding = bindings[0];
8764
- const { pattern, suffix, initializer, splices, thisAssignments } = binding;
8765
- const initCondition = {
8766
- type: "AssignmentExpression",
8767
- children: [ref, initializer],
8768
- hoistDec: {
8769
- type: "Declaration",
8770
- children: ["let ", ref, suffix],
8771
- names: []
8772
- },
8773
- blockPrefix: [
8774
- ["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
8775
- ...thisAssignments
8776
- ]
9015
+ return {
9016
+ type: "DeclarationCondition",
9017
+ declaration
8777
9018
  };
8778
- return initCondition;
8779
9019
  });
8780
9020
  function DeclarationCondition(ctx, state) {
8781
9021
  return $EVENT(ctx, state, "DeclarationCondition", DeclarationCondition$0);
@@ -12431,6 +12671,9 @@ ${input.slice(result.pos)}
12431
12671
  exports.RHS = RHS;
12432
12672
  exports.ParenthesizedAssignment = ParenthesizedAssignment;
12433
12673
  exports.UnaryExpression = UnaryExpression;
12674
+ exports.UnaryWithoutParenthesizedAssignment = UnaryWithoutParenthesizedAssignment;
12675
+ exports.UnaryBody = UnaryBody;
12676
+ exports.UnaryWithoutParenthesizedAssignmentBody = UnaryWithoutParenthesizedAssignmentBody;
12434
12677
  exports.UnaryPostfix = UnaryPostfix;
12435
12678
  exports.UpdateExpression = UpdateExpression;
12436
12679
  exports.UpdateExpressionSymbol = UpdateExpressionSymbol;
@@ -12487,6 +12730,7 @@ ${input.slice(result.pos)}
12487
12730
  exports.OptionalDot = OptionalDot;
12488
12731
  exports.NonNullAssertion = NonNullAssertion;
12489
12732
  exports.MemberExpression = MemberExpression;
12733
+ exports.MemberBase = MemberBase;
12490
12734
  exports.MemberExpressionRest = MemberExpressionRest;
12491
12735
  exports.MemberExpressionRestBody = MemberExpressionRestBody;
12492
12736
  exports.MemberBracketContent = MemberBracketContent;
@@ -13083,6 +13327,7 @@ ${input.slice(result.pos)}
13083
13327
  lastAccessInCallExpression,
13084
13328
  literalValue,
13085
13329
  makeEmptyBlock,
13330
+ makeGetterMethod,
13086
13331
  makeLeftHandSideExpression,
13087
13332
  makeRef,
13088
13333
  maybeRef,
package/dist/civet CHANGED
@@ -64,7 +64,7 @@ encoding = "utf8";
64
64
  fs = require("fs/promises");
65
65
  path = require("path");
66
66
  parseArgs = function(args) {
67
- var options, filenames, scriptArgs, i, endOfArgs, arg, char;
67
+ var options, filenames, scriptArgs, i, endOfArgs, arg;
68
68
  options = {};
69
69
  Object.defineProperty(options, "run", {
70
70
  get: function() {
@@ -90,6 +90,7 @@ parseArgs = function(args) {
90
90
  arg = args[i];
91
91
  if (/^-\w{2,}$/.test(arg)) {
92
92
  args.splice(i, 1 + i - i, ...(() => {
93
+ var char;
93
94
  const results = [];
94
95
  for (let ref = arg.slice(1), i1 = 0, len = ref.length; i1 < len; i1++) {
95
96
  char = ref[i1];
@@ -156,7 +157,7 @@ parseArgs = function(args) {
156
157
  return { filenames, scriptArgs, options };
157
158
  };
158
159
  readFiles = async function* (filenames, options) {
159
- var filename, stdin, lines, rl, content, chunk;
160
+ var filename, stdin, lines, rl, content;
160
161
  const results1 = [];
161
162
  for (let i2 = 0, len1 = filenames.length; i2 < len1; i2++) {
162
163
  filename = filenames[i2];
@@ -185,6 +186,7 @@ readFiles = async function* (filenames, options) {
185
186
  });
186
187
  } else {
187
188
  content = (await (async () => {
189
+ var chunk;
188
190
  const results2 = [];
189
191
  for await (chunk of process.stdin) {
190
192
  results2.push(chunk);
@@ -127,10 +127,7 @@ function civet(options = {}) {
127
127
  }
128
128
  var defaultPlugin = civet();
129
129
  civet.setup = defaultPlugin.setup;
130
- if (typeof module !== "undefined") {
131
- module.exports = civet;
132
- module.exports.default = civet;
133
- }
134
130
  var esbuild_plugin_default = civet;
135
131
  // Annotate the CommonJS export names for ESM import in node:
136
132
  0 && (module.exports = {});
133
+ module.exports = module.exports.default;