@weapp-vite/miniprogram-automator 1.2.10 → 1.2.11

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.mjs CHANGED
@@ -640,7 +640,7 @@ var Connection = class Connection extends EventEmitter {
640
640
  //#endregion
641
641
  //#region src/headless.ts
642
642
  async function launchHeadlessAutomator(options) {
643
- return await (await import("./launch-BRRvdL_K.mjs")).launch({ projectPath: options.projectPath });
643
+ return await (await import("./launch-BFWwqoyn.mjs")).launch({ projectPath: options.projectPath });
644
644
  }
645
645
  //#endregion
646
646
  //#region src/launcher/portLease.ts
@@ -739,7 +739,7 @@ async function acquireAutomatorPortLease(preferredPort) {
739
739
  }
740
740
  //#endregion
741
741
  //#region package.json
742
- var version = "1.2.10";
742
+ var version = "1.2.11";
743
743
  //#endregion
744
744
  //#region src/Native.ts
745
745
  /** Native 的实现。 */
@@ -944,15 +944,16 @@ async function callRouteMethodViaAppService(connection, route, query, method, ar
944
944
  await sleep$1(PAGE_CALL_METHOD_FALLBACK_RETRY_DELAY$1);
945
945
  continue;
946
946
  }
947
- if (isRouteMethodResult(fallbackResult)) if (!fallbackResult.__weappVitePageMethodFound) {
948
- unavailableReads += 1;
949
- if (unavailableReads >= PAGE_CALL_METHOD_FALLBACK_RETRIES$1) return;
950
- } else if (fallbackResult.status === "pending") {
951
- pendingPolls += 1;
952
- if (pendingPolls >= maxPendingPolls) throw new Error(`Timed out waiting for page method ${method} after ${timeout}ms`);
953
- } else if (fallbackResult.status === "rejected") throw new Error(`Page method ${method} failed: ${fallbackResult.error || "unknown error"}`);
954
- else return fallbackResult.value;
955
- else {
947
+ if (isRouteMethodResult(fallbackResult)) {
948
+ if (!fallbackResult.__weappVitePageMethodFound) {
949
+ unavailableReads += 1;
950
+ if (unavailableReads >= PAGE_CALL_METHOD_FALLBACK_RETRIES$1) return;
951
+ } else if (fallbackResult.status === "pending") {
952
+ pendingPolls += 1;
953
+ if (pendingPolls >= maxPendingPolls) throw new Error(`Timed out waiting for page method ${method} after ${timeout}ms`);
954
+ } else if (fallbackResult.status === "rejected") throw new Error(`Page method ${method} failed: ${fallbackResult.error || "unknown error"}`);
955
+ else return fallbackResult.value;
956
+ } else {
956
957
  latestResult = fallbackResult;
957
958
  if (latestResult !== void 0) return latestResult;
958
959
  unavailableReads += 1;
@@ -1901,8 +1902,7 @@ function isCallWxMethodProtocolTimeout(error) {
1901
1902
  }
1902
1903
  function isCaptureScreenshotRecoverableError(error) {
1903
1904
  if (!(error instanceof Error)) return false;
1904
- if ("code" in error && error.code === "DEVTOOLS_PROTOCOL_TIMEOUT" && "method" in error && error.method === "App.captureScreenshot") return true;
1905
- return error.message.includes("fail to capture screenshot") || error.message.includes("App.captureScreenshot");
1905
+ return error.message.includes("fail to capture screenshot");
1906
1906
  }
1907
1907
  function isRouteContextProbeError(error) {
1908
1908
  return isCurrentPageProtocolTimeout(error) || isPageStackProtocolTimeout(error) || isPageMetaMissingError(error) || isCurrentFrameTimedOutError(error);
@@ -1468,15 +1468,16 @@ var Tokenizer$1 = class {
1468
1468
  if (c === CharCodes.ExclamationMark) {
1469
1469
  this.state = State$1.BeforeDeclaration;
1470
1470
  this.sectionStart = this.index + 1;
1471
- } else if (c === CharCodes.Questionmark) if (this.xmlMode) {
1472
- this.state = State$1.InProcessingInstruction;
1473
- this.sequenceIndex = 0;
1474
- this.sectionStart = this.index + 1;
1475
- } else {
1476
- this.state = State$1.InSpecialComment;
1477
- this.sectionStart = this.index;
1478
- }
1479
- else if (this.isTagStartChar(c)) {
1471
+ } else if (c === CharCodes.Questionmark) {
1472
+ if (this.xmlMode) {
1473
+ this.state = State$1.InProcessingInstruction;
1474
+ this.sequenceIndex = 0;
1475
+ this.sectionStart = this.index + 1;
1476
+ } else {
1477
+ this.state = State$1.InSpecialComment;
1478
+ this.sectionStart = this.index;
1479
+ }
1480
+ } else if (this.isTagStartChar(c)) {
1480
1481
  this.sectionStart = this.index;
1481
1482
  const special = this.xmlMode || this.cbs.isInForeignContext?.() ? void 0 : specialStartSequences.get(c | 32);
1482
1483
  if (special === void 0) this.state = State$1.InTagName;
@@ -1501,11 +1502,12 @@ var Tokenizer$1 = class {
1501
1502
  }
1502
1503
  }
1503
1504
  stateBeforeClosingTagName(c) {
1504
- if (isWhitespace$1(c)) if (this.xmlMode) {} else {
1505
- this.state = State$1.InSpecialComment;
1506
- this.sectionStart = this.index;
1507
- }
1508
- else if (c === CharCodes.Gt) {
1505
+ if (isWhitespace$1(c)) {
1506
+ if (this.xmlMode) {} else {
1507
+ this.state = State$1.InSpecialComment;
1508
+ this.sectionStart = this.index;
1509
+ }
1510
+ } else if (c === CharCodes.Gt) {
1509
1511
  this.state = State$1.Text;
1510
1512
  if (!this.xmlMode) this.sectionStart = this.index + 1;
1511
1513
  } else {
@@ -1844,13 +1846,14 @@ var Tokenizer$1 = class {
1844
1846
  }
1845
1847
  handleTrailingCommentLikeData(endIndex) {
1846
1848
  if (this.state !== State$1.InCommentLike) return false;
1847
- if (this.currentSequence === Sequences.CdataEnd) if (this.xmlMode) {
1848
- if (this.sectionStart < endIndex) this.cbs.oncdata(this.sectionStart, endIndex, 0);
1849
+ if (this.currentSequence === Sequences.CdataEnd) {
1850
+ if (this.xmlMode) {
1851
+ if (this.sectionStart < endIndex) this.cbs.oncdata(this.sectionStart, endIndex, 0);
1852
+ } else {
1853
+ const cdataStart = this.sectionStart - Sequences.Cdata.length - 1;
1854
+ this.cbs.oncomment(cdataStart, endIndex, 0);
1855
+ }
1849
1856
  } else {
1850
- const cdataStart = this.sectionStart - Sequences.Cdata.length - 1;
1851
- this.cbs.oncomment(cdataStart, endIndex, 0);
1852
- }
1853
- else {
1854
1857
  const offset = this.xmlMode ? 0 : Math.min(this.sequenceIndex, Sequences.CommentEnd.length - 1);
1855
1858
  this.cbs.oncomment(this.sectionStart, endIndex, offset);
1856
1859
  }
@@ -4532,12 +4535,13 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
4532
4535
  if (this.match(76)) return this.flowParseDeclareClass(node);
4533
4536
  else if (this.match(64)) return this.flowParseDeclareFunction(node);
4534
4537
  else if (this.match(70)) return this.flowParseDeclareVariable(node);
4535
- else if (this.eatContextual(123)) if (this.match(12)) return this.flowParseDeclareModuleExports(node);
4536
- else {
4537
- if (insideModule) this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
4538
- return this.flowParseDeclareModule(node);
4539
- }
4540
- else if (this.isContextual(126)) return this.flowParseDeclareTypeAlias(node);
4538
+ else if (this.eatContextual(123)) {
4539
+ if (this.match(12)) return this.flowParseDeclareModuleExports(node);
4540
+ else {
4541
+ if (insideModule) this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
4542
+ return this.flowParseDeclareModule(node);
4543
+ }
4544
+ } else if (this.isContextual(126)) return this.flowParseDeclareTypeAlias(node);
4541
4545
  else if (this.isContextual(127)) return this.flowParseDeclareOpaqueType(node);
4542
4546
  else if (this.isContextual(125)) return this.flowParseDeclareInterface(node);
4543
4547
  else if (this.match(78)) return this.flowParseDeclareExportDeclaration(node, insideModule);
@@ -5149,10 +5153,12 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
5149
5153
  case 6: {
5150
5154
  const node = this.startNode();
5151
5155
  this.next();
5152
- if (!this.match(7) && !this.match(17)) if (tokenIsIdentifier(this.state.type) || this.match(74)) {
5153
- const token = this.lookahead().type;
5154
- isGroupedType = token !== 13 && token !== 10;
5155
- } else isGroupedType = true;
5156
+ if (!this.match(7) && !this.match(17)) {
5157
+ if (tokenIsIdentifier(this.state.type) || this.match(74)) {
5158
+ const token = this.lookahead().type;
5159
+ isGroupedType = token !== 13 && token !== 10;
5160
+ } else isGroupedType = true;
5161
+ }
5156
5162
  if (isGroupedType) {
5157
5163
  this.state.noAnonFunctionType = false;
5158
5164
  type = this.flowParseType();
@@ -5558,9 +5564,10 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
5558
5564
  const next = this.input.charCodeAt(this.state.pos + 1);
5559
5565
  if (code === 123 && next === 124) this.finishOp(3, 2);
5560
5566
  else if (this.state.inType && (code === 62 || code === 60)) this.finishOp(code === 62 ? 44 : 43, 1);
5561
- else if (this.state.inType && code === 63) if (next === 46) this.finishOp(14, 2);
5562
- else this.finishOp(13, 1);
5563
- else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) {
5567
+ else if (this.state.inType && code === 63) {
5568
+ if (next === 46) this.finishOp(14, 2);
5569
+ else this.finishOp(13, 1);
5570
+ } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) {
5564
5571
  this.state.pos += 2;
5565
5572
  this.readIterator();
5566
5573
  } else super.getTokenFromCode(code);
@@ -6957,8 +6964,10 @@ var TypeScriptScopeHandler = class extends ScopeHandler {
6957
6964
  if (bindingType & 256) return (bindingType & 512) > 0 !== (type & 4) > 0;
6958
6965
  return true;
6959
6966
  }
6960
- if (bindingType & 128 && (type & 8) > 0) if (scope.names.get(name) & 2) return !!(bindingType & 1);
6961
- else return false;
6967
+ if (bindingType & 128 && (type & 8) > 0) {
6968
+ if (scope.names.get(name) & 2) return !!(bindingType & 1);
6969
+ else return false;
6970
+ }
6962
6971
  if (bindingType & 2 && (type & 1) > 0) return true;
6963
6972
  return super.isRedeclaredInScope(scope, name, bindingType);
6964
6973
  }
@@ -7343,14 +7352,15 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
7343
7352
  ++pos;
7344
7353
  ++curLine;
7345
7354
  lineStart = pos;
7346
- } else if (ch === 10 || ch === 13) if (type === "template") {
7347
- out += input.slice(chunkStart, pos) + "\n";
7348
- ++pos;
7349
- if (ch === 13 && input.charCodeAt(pos) === 10) ++pos;
7350
- ++curLine;
7351
- chunkStart = lineStart = pos;
7352
- } else errors.unterminated(initialPos, initialLineStart, initialCurLine);
7353
- else ++pos;
7355
+ } else if (ch === 10 || ch === 13) {
7356
+ if (type === "template") {
7357
+ out += input.slice(chunkStart, pos) + "\n";
7358
+ ++pos;
7359
+ if (ch === 13 && input.charCodeAt(pos) === 10) ++pos;
7360
+ ++curLine;
7361
+ chunkStart = lineStart = pos;
7362
+ } else errors.unterminated(initialPos, initialLineStart, initialCurLine);
7363
+ } else ++pos;
7354
7364
  }
7355
7365
  return {
7356
7366
  pos,
@@ -7411,8 +7421,10 @@ function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
7411
7421
  }
7412
7422
  pos += octalStr.length - 1;
7413
7423
  const next = input.charCodeAt(pos);
7414
- if (octalStr !== "0" || next === 56 || next === 57) if (inTemplate) return res(null);
7415
- else errors.strictNumericEscape(startPos, lineStart, curLine);
7424
+ if (octalStr !== "0" || next === 56 || next === 57) {
7425
+ if (inTemplate) return res(null);
7426
+ else errors.strictNumericEscape(startPos, lineStart, curLine);
7427
+ }
7416
7428
  return res(String.fromCharCode(octal));
7417
7429
  }
7418
7430
  return res(String.fromCharCode(ch));
@@ -7422,8 +7434,10 @@ function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInval
7422
7434
  const initialPos = pos;
7423
7435
  let n;
7424
7436
  ({n, pos} = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
7425
- if (n === null) if (throwOnInvalid) errors.invalidEscapeSequence(initialPos, lineStart, curLine);
7426
- else pos = initialPos - 1;
7437
+ if (n === null) {
7438
+ if (throwOnInvalid) errors.invalidEscapeSequence(initialPos, lineStart, curLine);
7439
+ else pos = initialPos - 1;
7440
+ }
7427
7441
  return {
7428
7442
  code: n,
7429
7443
  pos
@@ -7461,15 +7475,17 @@ function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumS
7461
7475
  else if (code >= 65) val = code - 65 + 10;
7462
7476
  else if (_isDigit(code)) val = code - 48;
7463
7477
  else val = Infinity;
7464
- if (val >= radix) if (val <= 9 && bailOnError) return {
7465
- n: null,
7466
- pos
7467
- };
7468
- else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) val = 0;
7469
- else if (forceLen) {
7470
- val = 0;
7471
- invalid = true;
7472
- } else break;
7478
+ if (val >= radix) {
7479
+ if (val <= 9 && bailOnError) return {
7480
+ n: null,
7481
+ pos
7482
+ };
7483
+ else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) val = 0;
7484
+ else if (forceLen) {
7485
+ val = 0;
7486
+ invalid = true;
7487
+ } else break;
7488
+ }
7473
7489
  ++pos;
7474
7490
  total = total * radix + val;
7475
7491
  }
@@ -7489,11 +7505,13 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
7489
7505
  ++pos;
7490
7506
  ({code, pos} = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
7491
7507
  ++pos;
7492
- if (code !== null && code > 1114111) if (throwOnInvalid) errors.invalidCodePoint(pos, lineStart, curLine);
7493
- else return {
7494
- code: null,
7495
- pos
7496
- };
7508
+ if (code !== null && code > 1114111) {
7509
+ if (throwOnInvalid) errors.invalidCodePoint(pos, lineStart, curLine);
7510
+ else return {
7511
+ code: null,
7512
+ pos
7513
+ };
7514
+ }
7497
7515
  } else ({code, pos} = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
7498
7516
  return {
7499
7517
  code,
@@ -7927,9 +7945,10 @@ var Tokenizer = class extends CommentsParser {
7927
7945
  readToken_question() {
7928
7946
  const next = this.input.charCodeAt(this.state.pos + 1);
7929
7947
  const next2 = this.input.charCodeAt(this.state.pos + 2);
7930
- if (next === 63) if (next2 === 61) this.finishOp(26, 3);
7931
- else this.finishOp(36, 2);
7932
- else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
7948
+ if (next === 63) {
7949
+ if (next2 === 61) this.finishOp(26, 3);
7950
+ else this.finishOp(36, 2);
7951
+ } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
7933
7952
  this.state.pos += 2;
7934
7953
  this.finishToken(14);
7935
7954
  } else {
@@ -9017,8 +9036,10 @@ var LValParser = class extends NodeUtils {
9017
9036
  if (type === "Identifier") {
9018
9037
  this.checkIdentifier(expression, binding, strictModeChanged);
9019
9038
  const { name } = expression;
9020
- if (checkClashes) if (checkClashes.has(name)) this.raise(Errors.ParamDupe, expression);
9021
- else checkClashes.add(name);
9039
+ if (checkClashes) {
9040
+ if (checkClashes.has(name)) this.raise(Errors.ParamDupe, expression);
9041
+ else checkClashes.add(name);
9042
+ }
9022
9043
  return;
9023
9044
  } else if (type === "VoidPattern" && ancestor.type === "CatchClause") this.raise(Errors.VoidPatternCatchClauseParam, expression);
9024
9045
  const unwrappedExpression = unwrapParenthesizedExpression(expression);
@@ -9042,8 +9063,10 @@ var LValParser = class extends NodeUtils {
9042
9063
  } else if (val) this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, disallowCallExpression);
9043
9064
  }
9044
9065
  checkIdentifier(at, bindingType, strictModeChanged = false) {
9045
- if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) if (bindingType === 64) this.raise(Errors.StrictEvalArguments, at, { referenceName: at.name });
9046
- else this.raise(Errors.StrictEvalArgumentsBinding, at, { bindingName: at.name });
9066
+ if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {
9067
+ if (bindingType === 64) this.raise(Errors.StrictEvalArguments, at, { referenceName: at.name });
9068
+ else this.raise(Errors.StrictEvalArgumentsBinding, at, { bindingName: at.name });
9069
+ }
9047
9070
  if (bindingType & 8192 && at.name === "let") this.raise(Errors.LetInLexicalBinding, at);
9048
9071
  if (!(bindingType & 64)) this.declareNameFromIdentifier(at, bindingType);
9049
9072
  }
@@ -9073,9 +9096,11 @@ var ExpressionParser = class extends LValParser {
9073
9096
  if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) return sawProto;
9074
9097
  const key = prop.key;
9075
9098
  if ((key.type === "Identifier" ? key.name : key.value) === "__proto__") {
9076
- if (sawProto) if (refExpressionErrors) {
9077
- if (refExpressionErrors.doubleProtoLoc === null) refExpressionErrors.doubleProtoLoc = this.getLoc(key.start);
9078
- } else this.raise(Errors.DuplicateProto, key);
9099
+ if (sawProto) {
9100
+ if (refExpressionErrors) {
9101
+ if (refExpressionErrors.doubleProtoLoc === null) refExpressionErrors.doubleProtoLoc = this.getLoc(key.start);
9102
+ } else this.raise(Errors.DuplicateProto, key);
9103
+ }
9079
9104
  return true;
9080
9105
  }
9081
9106
  return sawProto;
@@ -9470,9 +9495,10 @@ var ExpressionParser = class extends LValParser {
9470
9495
  node = this.startNode();
9471
9496
  this.next();
9472
9497
  if (this.match(12)) return this.parseImportMetaPropertyOrPhaseCall(node);
9473
- if (this.match(6)) if (this.optionFlags & 1024) return this.parseImportCall(node);
9474
- else return this.finishNode(node, "Import");
9475
- else {
9498
+ if (this.match(6)) {
9499
+ if (this.optionFlags & 1024) return this.parseImportCall(node);
9500
+ else return this.finishNode(node, "Import");
9501
+ } else {
9476
9502
  this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
9477
9503
  return this.finishNode(node, "Import");
9478
9504
  }
@@ -9541,9 +9567,10 @@ var ExpressionParser = class extends LValParser {
9541
9567
  this.resetPreviousNodeTrailingComments(id);
9542
9568
  this.next();
9543
9569
  return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
9544
- } else if (tokenIsIdentifier(type)) if (canStartArrow && this.lookaheadCharCode() === 61) return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
9545
- else return id;
9546
- else if (type === 86) {
9570
+ } else if (tokenIsIdentifier(type)) {
9571
+ if (canStartArrow && this.lookaheadCharCode() === 61) return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
9572
+ else return id;
9573
+ } else if (type === 86) {
9547
9574
  this.resetPreviousNodeTrailingComments(id);
9548
9575
  return this.parseDo(this.startNodeAtNode(id), true);
9549
9576
  }
@@ -10193,8 +10220,10 @@ var ExpressionParser = class extends LValParser {
10193
10220
  const node = this.startNodeAt(startLoc);
10194
10221
  this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, startIndex);
10195
10222
  if (this.eat(51)) this.raise(Errors.ObsoleteAwaitStar, startLoc);
10196
- if (!this.scope.inFunction && !(this.optionFlags & 1)) if (this.isAmbiguousPrefixOrIdentifier()) this.ambiguousScriptDifferentAst = true;
10197
- else this.sawUnambiguousESM = true;
10223
+ if (!this.scope.inFunction && !(this.optionFlags & 1)) {
10224
+ if (this.isAmbiguousPrefixOrIdentifier()) this.ambiguousScriptDifferentAst = true;
10225
+ else this.sawUnambiguousESM = true;
10226
+ }
10198
10227
  if (!soloAwait) node.argument = this.parseMaybeUnary(null, true);
10199
10228
  return this.finishNode(node, "AwaitExpression");
10200
10229
  }
@@ -11119,9 +11148,10 @@ var StatementParser = class extends ExpressionParser {
11119
11148
  allowsDirectSuper = state.hadSuperClass;
11120
11149
  }
11121
11150
  this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
11122
- } else if (this.isClassProperty()) if (isPrivate) this.pushClassPrivateProperty(classBody, privateProp);
11123
- else this.pushClassProperty(classBody, publicProp);
11124
- else if (maybeContextualKw === "async" && !this.isLineTerminator()) {
11151
+ } else if (this.isClassProperty()) {
11152
+ if (isPrivate) this.pushClassPrivateProperty(classBody, privateProp);
11153
+ else this.pushClassProperty(classBody, publicProp);
11154
+ } else if (maybeContextualKw === "async" && !this.isLineTerminator()) {
11125
11155
  this.resetPreviousNodeTrailingComments(key);
11126
11156
  const isGenerator = this.eat(51);
11127
11157
  if (publicMember.optional) this.unexpected(maybeQuestionTokenStartLoc);
@@ -11151,9 +11181,10 @@ var StatementParser = class extends ExpressionParser {
11151
11181
  const isPrivate = this.match(134);
11152
11182
  this.parseClassElementName(publicProp);
11153
11183
  this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
11154
- } else if (this.isLineTerminator()) if (isPrivate) this.pushClassPrivateProperty(classBody, privateProp);
11155
- else this.pushClassProperty(classBody, publicProp);
11156
- else this.unexpected();
11184
+ } else if (this.isLineTerminator()) {
11185
+ if (isPrivate) this.pushClassPrivateProperty(classBody, privateProp);
11186
+ else this.pushClassProperty(classBody, publicProp);
11187
+ } else this.unexpected();
11157
11188
  }
11158
11189
  parseClassElementName(member) {
11159
11190
  const { type, value } = this.state;
@@ -11453,8 +11484,10 @@ var StatementParser = class extends ExpressionParser {
11453
11484
  else if (node.type === "AssignmentPattern") this.checkDeclaration(node.left);
11454
11485
  }
11455
11486
  checkDuplicateExports(node, exportName) {
11456
- if (this.exportedIdentifiers.has(exportName)) if (exportName === "default") this.raise(Errors.DuplicateDefaultExport, node);
11457
- else this.raise(Errors.DuplicateExport, node, { exportName });
11487
+ if (this.exportedIdentifiers.has(exportName)) {
11488
+ if (exportName === "default") this.raise(Errors.DuplicateDefaultExport, node);
11489
+ else this.raise(Errors.DuplicateExport, node, { exportName });
11490
+ }
11458
11491
  this.exportedIdentifiers.add(exportName);
11459
11492
  }
11460
11493
  parseExportSpecifiers(isInTypeExport) {
@@ -11807,14 +11840,15 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
11807
11840
  const { startLoc } = this.state;
11808
11841
  const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers ?? []), stopOnStartOfClassStaticBlock, modified.static);
11809
11842
  if (!modifier) break;
11810
- if (tsIsAccessModifier(modifier)) if (modified.accessibility) this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { modifier });
11811
- else {
11812
- enforceOrder(startLoc, modifier, modifier, "override");
11813
- enforceOrder(startLoc, modifier, modifier, "static");
11814
- enforceOrder(startLoc, modifier, modifier, "readonly");
11815
- modified.accessibility = modifier;
11816
- }
11817
- else if (tsIsVarianceAnnotations(modifier)) {
11843
+ if (tsIsAccessModifier(modifier)) {
11844
+ if (modified.accessibility) this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { modifier });
11845
+ else {
11846
+ enforceOrder(startLoc, modifier, modifier, "override");
11847
+ enforceOrder(startLoc, modifier, modifier, "static");
11848
+ enforceOrder(startLoc, modifier, modifier, "readonly");
11849
+ modified.accessibility = modifier;
11850
+ }
11851
+ } else if (tsIsVarianceAnnotations(modifier)) {
11818
11852
  if (modified[modifier]) this.raise(TSErrors.DuplicateModifier, startLoc, { modifier });
11819
11853
  modified[modifier] = true;
11820
11854
  enforceOrder(startLoc, modifier, "in", "out");
@@ -11871,8 +11905,10 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
11871
11905
  return result;
11872
11906
  }
11873
11907
  tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {
11874
- if (!skipFirstToken) if (bracket) this.expect(0);
11875
- else this.expect(43);
11908
+ if (!skipFirstToken) {
11909
+ if (bracket) this.expect(0);
11910
+ else this.expect(43);
11911
+ }
11876
11912
  const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);
11877
11913
  if (bracket) this.expect(1);
11878
11914
  else this.expect(44);
@@ -11926,13 +11962,14 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
11926
11962
  }
11927
11963
  tsParseEntityName(flags) {
11928
11964
  let entity;
11929
- if (flags & 1 && this.match(74)) if (flags & 2) entity = this.parseIdentifier(true);
11930
- else {
11931
- const node = this.startNode();
11932
- this.next();
11933
- entity = this.finishNode(node, "ThisExpression");
11934
- }
11935
- else entity = this.parseIdentifier(!!(flags & 1));
11965
+ if (flags & 1 && this.match(74)) {
11966
+ if (flags & 2) entity = this.parseIdentifier(true);
11967
+ else {
11968
+ const node = this.startNode();
11969
+ this.next();
11970
+ entity = this.finishNode(node, "ThisExpression");
11971
+ }
11972
+ } else entity = this.parseIdentifier(!!(flags & 1));
11936
11973
  while (this.eat(12)) {
11937
11974
  const node = this.startNodeAtNode(entity);
11938
11975
  node.left = entity;
@@ -13761,11 +13798,13 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
13761
13798
  if (this.match(76)) {
13762
13799
  node.abstract = true;
13763
13800
  return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
13764
- } else if (this.isContextual(125)) if (!this.hasFollowingLineBreak()) {
13765
- node.abstract = true;
13766
- this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
13767
- return this.tsParseInterfaceDeclaration(node);
13768
- } else return null;
13801
+ } else if (this.isContextual(125)) {
13802
+ if (!this.hasFollowingLineBreak()) {
13803
+ node.abstract = true;
13804
+ this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
13805
+ return this.tsParseInterfaceDeclaration(node);
13806
+ } else return null;
13807
+ }
13769
13808
  throw this.unexpected(null, 76);
13770
13809
  }
13771
13810
  parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
@@ -14102,13 +14141,14 @@ const placeholders = (superClass) => class PlaceholdersParserMixin extends super
14102
14141
  this.next();
14103
14142
  const oldStrict = this.state.strict;
14104
14143
  const placeholder = this.parsePlaceholder("Identifier");
14105
- if (placeholder) if (this.match(77) || this.match(129) || this.match(2)) node.id = placeholder;
14106
- else if (optionalId || !isStatement) {
14107
- node.id = null;
14108
- node.body = this.finishPlaceholder(placeholder, "ClassBody");
14109
- return this.finishNode(node, type);
14110
- } else throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc);
14111
- else this.parseClassId(node, isStatement, optionalId);
14144
+ if (placeholder) {
14145
+ if (this.match(77) || this.match(129) || this.match(2)) node.id = placeholder;
14146
+ else if (optionalId || !isStatement) {
14147
+ node.id = null;
14148
+ node.body = this.finishPlaceholder(placeholder, "ClassBody");
14149
+ return this.finishNode(node, type);
14150
+ } else throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc);
14151
+ } else this.parseClassId(node, isStatement, optionalId);
14112
14152
  super.parseClassSuper(node);
14113
14153
  node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict);
14114
14154
  return this.finishNode(node, type);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-vite/miniprogram-automator",
3
3
  "type": "module",
4
- "version": "1.2.10",
4
+ "version": "1.2.11",
5
5
  "description": "完全兼容微信 miniprogram-automator 的现代化替代实现",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",