@weapp-vite/miniprogram-automator 1.2.9 → 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 +13 -13
- package/dist/{launch-kobGwssZ.mjs → launch-BFWwqoyn.mjs} +170 -140
- package/package.json +2 -2
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-
|
|
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.
|
|
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))
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
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
|
-
|
|
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)
|
|
1472
|
-
this.
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
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))
|
|
1505
|
-
this.
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
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 {
|
|
@@ -1828,9 +1830,7 @@ var Tokenizer$1 = class {
|
|
|
1828
1830
|
case State$1.InProcessingInstruction:
|
|
1829
1831
|
this.stateInProcessingInstruction(c);
|
|
1830
1832
|
break;
|
|
1831
|
-
case State$1.InEntity:
|
|
1832
|
-
this.stateInEntity();
|
|
1833
|
-
break;
|
|
1833
|
+
case State$1.InEntity: this.stateInEntity();
|
|
1834
1834
|
}
|
|
1835
1835
|
this.index++;
|
|
1836
1836
|
}
|
|
@@ -1846,13 +1846,14 @@ var Tokenizer$1 = class {
|
|
|
1846
1846
|
}
|
|
1847
1847
|
handleTrailingCommentLikeData(endIndex) {
|
|
1848
1848
|
if (this.state !== State$1.InCommentLike) return false;
|
|
1849
|
-
if (this.currentSequence === Sequences.CdataEnd)
|
|
1850
|
-
if (this.
|
|
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
|
+
}
|
|
1851
1856
|
} else {
|
|
1852
|
-
const cdataStart = this.sectionStart - Sequences.Cdata.length - 1;
|
|
1853
|
-
this.cbs.oncomment(cdataStart, endIndex, 0);
|
|
1854
|
-
}
|
|
1855
|
-
else {
|
|
1856
1857
|
const offset = this.xmlMode ? 0 : Math.min(this.sequenceIndex, Sequences.CommentEnd.length - 1);
|
|
1857
1858
|
this.cbs.oncomment(this.sectionStart, endIndex, offset);
|
|
1858
1859
|
}
|
|
@@ -3561,12 +3562,10 @@ const estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
3561
3562
|
node.exported = node.specifiers[0].exported;
|
|
3562
3563
|
delete node.specifiers;
|
|
3563
3564
|
}
|
|
3564
|
-
case "ExportDefaultDeclaration":
|
|
3565
|
-
{
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
}
|
|
3569
|
-
break;
|
|
3565
|
+
case "ExportDefaultDeclaration": {
|
|
3566
|
+
const { declaration } = node;
|
|
3567
|
+
if (declaration?.type === "ClassDeclaration" && declaration.decorators?.length > 0 && declaration.start === node.start) this.resetStartLocation(node, exportStartLoc);
|
|
3568
|
+
}
|
|
3570
3569
|
}
|
|
3571
3570
|
return node;
|
|
3572
3571
|
}
|
|
@@ -4536,12 +4535,13 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
4536
4535
|
if (this.match(76)) return this.flowParseDeclareClass(node);
|
|
4537
4536
|
else if (this.match(64)) return this.flowParseDeclareFunction(node);
|
|
4538
4537
|
else if (this.match(70)) return this.flowParseDeclareVariable(node);
|
|
4539
|
-
else if (this.eatContextual(123))
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
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);
|
|
4545
4545
|
else if (this.isContextual(127)) return this.flowParseDeclareOpaqueType(node);
|
|
4546
4546
|
else if (this.isContextual(125)) return this.flowParseDeclareInterface(node);
|
|
4547
4547
|
else if (this.match(78)) return this.flowParseDeclareExportDeclaration(node, insideModule);
|
|
@@ -5153,10 +5153,12 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
5153
5153
|
case 6: {
|
|
5154
5154
|
const node = this.startNode();
|
|
5155
5155
|
this.next();
|
|
5156
|
-
if (!this.match(7) && !this.match(17))
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
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
|
+
}
|
|
5160
5162
|
if (isGroupedType) {
|
|
5161
5163
|
this.state.noAnonFunctionType = false;
|
|
5162
5164
|
type = this.flowParseType();
|
|
@@ -5562,9 +5564,10 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
5562
5564
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
5563
5565
|
if (code === 123 && next === 124) this.finishOp(3, 2);
|
|
5564
5566
|
else if (this.state.inType && (code === 62 || code === 60)) this.finishOp(code === 62 ? 44 : 43, 1);
|
|
5565
|
-
else if (this.state.inType && code === 63)
|
|
5566
|
-
|
|
5567
|
-
|
|
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))) {
|
|
5568
5571
|
this.state.pos += 2;
|
|
5569
5572
|
this.readIterator();
|
|
5570
5573
|
} else super.getTokenFromCode(code);
|
|
@@ -6961,8 +6964,10 @@ var TypeScriptScopeHandler = class extends ScopeHandler {
|
|
|
6961
6964
|
if (bindingType & 256) return (bindingType & 512) > 0 !== (type & 4) > 0;
|
|
6962
6965
|
return true;
|
|
6963
6966
|
}
|
|
6964
|
-
if (bindingType & 128 && (type & 8) > 0)
|
|
6965
|
-
|
|
6967
|
+
if (bindingType & 128 && (type & 8) > 0) {
|
|
6968
|
+
if (scope.names.get(name) & 2) return !!(bindingType & 1);
|
|
6969
|
+
else return false;
|
|
6970
|
+
}
|
|
6966
6971
|
if (bindingType & 2 && (type & 1) > 0) return true;
|
|
6967
6972
|
return super.isRedeclaredInScope(scope, name, bindingType);
|
|
6968
6973
|
}
|
|
@@ -7347,14 +7352,15 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
|
|
|
7347
7352
|
++pos;
|
|
7348
7353
|
++curLine;
|
|
7349
7354
|
lineStart = pos;
|
|
7350
|
-
} else if (ch === 10 || ch === 13)
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
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;
|
|
7358
7364
|
}
|
|
7359
7365
|
return {
|
|
7360
7366
|
pos,
|
|
@@ -7415,8 +7421,10 @@ function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
|
7415
7421
|
}
|
|
7416
7422
|
pos += octalStr.length - 1;
|
|
7417
7423
|
const next = input.charCodeAt(pos);
|
|
7418
|
-
if (octalStr !== "0" || next === 56 || next === 57)
|
|
7419
|
-
|
|
7424
|
+
if (octalStr !== "0" || next === 56 || next === 57) {
|
|
7425
|
+
if (inTemplate) return res(null);
|
|
7426
|
+
else errors.strictNumericEscape(startPos, lineStart, curLine);
|
|
7427
|
+
}
|
|
7420
7428
|
return res(String.fromCharCode(octal));
|
|
7421
7429
|
}
|
|
7422
7430
|
return res(String.fromCharCode(ch));
|
|
@@ -7426,8 +7434,10 @@ function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInval
|
|
|
7426
7434
|
const initialPos = pos;
|
|
7427
7435
|
let n;
|
|
7428
7436
|
({n, pos} = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
|
|
7429
|
-
if (n === null)
|
|
7430
|
-
|
|
7437
|
+
if (n === null) {
|
|
7438
|
+
if (throwOnInvalid) errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
|
7439
|
+
else pos = initialPos - 1;
|
|
7440
|
+
}
|
|
7431
7441
|
return {
|
|
7432
7442
|
code: n,
|
|
7433
7443
|
pos
|
|
@@ -7465,15 +7475,17 @@ function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumS
|
|
|
7465
7475
|
else if (code >= 65) val = code - 65 + 10;
|
|
7466
7476
|
else if (_isDigit(code)) val = code - 48;
|
|
7467
7477
|
else val = Infinity;
|
|
7468
|
-
if (val >= radix)
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
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
|
+
}
|
|
7477
7489
|
++pos;
|
|
7478
7490
|
total = total * radix + val;
|
|
7479
7491
|
}
|
|
@@ -7493,11 +7505,13 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
|
|
7493
7505
|
++pos;
|
|
7494
7506
|
({code, pos} = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
|
|
7495
7507
|
++pos;
|
|
7496
|
-
if (code !== null && code > 1114111)
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7508
|
+
if (code !== null && code > 1114111) {
|
|
7509
|
+
if (throwOnInvalid) errors.invalidCodePoint(pos, lineStart, curLine);
|
|
7510
|
+
else return {
|
|
7511
|
+
code: null,
|
|
7512
|
+
pos
|
|
7513
|
+
};
|
|
7514
|
+
}
|
|
7501
7515
|
} else ({code, pos} = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
|
|
7502
7516
|
return {
|
|
7503
7517
|
code,
|
|
@@ -7931,9 +7945,10 @@ var Tokenizer = class extends CommentsParser {
|
|
|
7931
7945
|
readToken_question() {
|
|
7932
7946
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
7933
7947
|
const next2 = this.input.charCodeAt(this.state.pos + 2);
|
|
7934
|
-
if (next === 63)
|
|
7935
|
-
|
|
7936
|
-
|
|
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)) {
|
|
7937
7952
|
this.state.pos += 2;
|
|
7938
7953
|
this.finishToken(14);
|
|
7939
7954
|
} else {
|
|
@@ -8830,9 +8845,7 @@ var LValParser = class extends NodeUtils {
|
|
|
8830
8845
|
if (node.left.type === "VoidPattern") this.raise(Errors.VoidPatternInitializer, node.left);
|
|
8831
8846
|
this.toAssignable(node.left, isLHS);
|
|
8832
8847
|
break;
|
|
8833
|
-
case "ParenthesizedExpression":
|
|
8834
|
-
this.toAssignable(parenthesized, isLHS);
|
|
8835
|
-
break;
|
|
8848
|
+
case "ParenthesizedExpression": this.toAssignable(parenthesized, isLHS);
|
|
8836
8849
|
}
|
|
8837
8850
|
}
|
|
8838
8851
|
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
|
|
@@ -9023,8 +9036,10 @@ var LValParser = class extends NodeUtils {
|
|
|
9023
9036
|
if (type === "Identifier") {
|
|
9024
9037
|
this.checkIdentifier(expression, binding, strictModeChanged);
|
|
9025
9038
|
const { name } = expression;
|
|
9026
|
-
if (checkClashes)
|
|
9027
|
-
|
|
9039
|
+
if (checkClashes) {
|
|
9040
|
+
if (checkClashes.has(name)) this.raise(Errors.ParamDupe, expression);
|
|
9041
|
+
else checkClashes.add(name);
|
|
9042
|
+
}
|
|
9028
9043
|
return;
|
|
9029
9044
|
} else if (type === "VoidPattern" && ancestor.type === "CatchClause") this.raise(Errors.VoidPatternCatchClauseParam, expression);
|
|
9030
9045
|
const unwrappedExpression = unwrapParenthesizedExpression(expression);
|
|
@@ -9048,8 +9063,10 @@ var LValParser = class extends NodeUtils {
|
|
|
9048
9063
|
} else if (val) this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, disallowCallExpression);
|
|
9049
9064
|
}
|
|
9050
9065
|
checkIdentifier(at, bindingType, strictModeChanged = false) {
|
|
9051
|
-
if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name)))
|
|
9052
|
-
|
|
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
|
+
}
|
|
9053
9070
|
if (bindingType & 8192 && at.name === "let") this.raise(Errors.LetInLexicalBinding, at);
|
|
9054
9071
|
if (!(bindingType & 64)) this.declareNameFromIdentifier(at, bindingType);
|
|
9055
9072
|
}
|
|
@@ -9079,9 +9096,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
9079
9096
|
if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) return sawProto;
|
|
9080
9097
|
const key = prop.key;
|
|
9081
9098
|
if ((key.type === "Identifier" ? key.name : key.value) === "__proto__") {
|
|
9082
|
-
if (sawProto)
|
|
9083
|
-
if (refExpressionErrors
|
|
9084
|
-
|
|
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
|
+
}
|
|
9085
9104
|
return true;
|
|
9086
9105
|
}
|
|
9087
9106
|
return sawProto;
|
|
@@ -9476,9 +9495,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
9476
9495
|
node = this.startNode();
|
|
9477
9496
|
this.next();
|
|
9478
9497
|
if (this.match(12)) return this.parseImportMetaPropertyOrPhaseCall(node);
|
|
9479
|
-
if (this.match(6))
|
|
9480
|
-
|
|
9481
|
-
|
|
9498
|
+
if (this.match(6)) {
|
|
9499
|
+
if (this.optionFlags & 1024) return this.parseImportCall(node);
|
|
9500
|
+
else return this.finishNode(node, "Import");
|
|
9501
|
+
} else {
|
|
9482
9502
|
this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
|
|
9483
9503
|
return this.finishNode(node, "Import");
|
|
9484
9504
|
}
|
|
@@ -9547,9 +9567,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
9547
9567
|
this.resetPreviousNodeTrailingComments(id);
|
|
9548
9568
|
this.next();
|
|
9549
9569
|
return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
|
|
9550
|
-
} else if (tokenIsIdentifier(type))
|
|
9551
|
-
|
|
9552
|
-
|
|
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) {
|
|
9553
9574
|
this.resetPreviousNodeTrailingComments(id);
|
|
9554
9575
|
return this.parseDo(this.startNodeAtNode(id), true);
|
|
9555
9576
|
}
|
|
@@ -10199,8 +10220,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
10199
10220
|
const node = this.startNodeAt(startLoc);
|
|
10200
10221
|
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, startIndex);
|
|
10201
10222
|
if (this.eat(51)) this.raise(Errors.ObsoleteAwaitStar, startLoc);
|
|
10202
|
-
if (!this.scope.inFunction && !(this.optionFlags & 1))
|
|
10203
|
-
|
|
10223
|
+
if (!this.scope.inFunction && !(this.optionFlags & 1)) {
|
|
10224
|
+
if (this.isAmbiguousPrefixOrIdentifier()) this.ambiguousScriptDifferentAst = true;
|
|
10225
|
+
else this.sawUnambiguousESM = true;
|
|
10226
|
+
}
|
|
10204
10227
|
if (!soloAwait) node.argument = this.parseMaybeUnary(null, true);
|
|
10205
10228
|
return this.finishNode(node, "AwaitExpression");
|
|
10206
10229
|
}
|
|
@@ -11125,9 +11148,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
11125
11148
|
allowsDirectSuper = state.hadSuperClass;
|
|
11126
11149
|
}
|
|
11127
11150
|
this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
|
|
11128
|
-
} else if (this.isClassProperty())
|
|
11129
|
-
|
|
11130
|
-
|
|
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()) {
|
|
11131
11155
|
this.resetPreviousNodeTrailingComments(key);
|
|
11132
11156
|
const isGenerator = this.eat(51);
|
|
11133
11157
|
if (publicMember.optional) this.unexpected(maybeQuestionTokenStartLoc);
|
|
@@ -11157,9 +11181,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
11157
11181
|
const isPrivate = this.match(134);
|
|
11158
11182
|
this.parseClassElementName(publicProp);
|
|
11159
11183
|
this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
|
|
11160
|
-
} else if (this.isLineTerminator())
|
|
11161
|
-
|
|
11162
|
-
|
|
11184
|
+
} else if (this.isLineTerminator()) {
|
|
11185
|
+
if (isPrivate) this.pushClassPrivateProperty(classBody, privateProp);
|
|
11186
|
+
else this.pushClassProperty(classBody, publicProp);
|
|
11187
|
+
} else this.unexpected();
|
|
11163
11188
|
}
|
|
11164
11189
|
parseClassElementName(member) {
|
|
11165
11190
|
const { type, value } = this.state;
|
|
@@ -11459,8 +11484,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
11459
11484
|
else if (node.type === "AssignmentPattern") this.checkDeclaration(node.left);
|
|
11460
11485
|
}
|
|
11461
11486
|
checkDuplicateExports(node, exportName) {
|
|
11462
|
-
if (this.exportedIdentifiers.has(exportName))
|
|
11463
|
-
|
|
11487
|
+
if (this.exportedIdentifiers.has(exportName)) {
|
|
11488
|
+
if (exportName === "default") this.raise(Errors.DuplicateDefaultExport, node);
|
|
11489
|
+
else this.raise(Errors.DuplicateExport, node, { exportName });
|
|
11490
|
+
}
|
|
11464
11491
|
this.exportedIdentifiers.add(exportName);
|
|
11465
11492
|
}
|
|
11466
11493
|
parseExportSpecifiers(isInTypeExport) {
|
|
@@ -11813,14 +11840,15 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
11813
11840
|
const { startLoc } = this.state;
|
|
11814
11841
|
const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers ?? []), stopOnStartOfClassStaticBlock, modified.static);
|
|
11815
11842
|
if (!modifier) break;
|
|
11816
|
-
if (tsIsAccessModifier(modifier))
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
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)) {
|
|
11824
11852
|
if (modified[modifier]) this.raise(TSErrors.DuplicateModifier, startLoc, { modifier });
|
|
11825
11853
|
modified[modifier] = true;
|
|
11826
11854
|
enforceOrder(startLoc, modifier, "in", "out");
|
|
@@ -11877,8 +11905,10 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
11877
11905
|
return result;
|
|
11878
11906
|
}
|
|
11879
11907
|
tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {
|
|
11880
|
-
if (!skipFirstToken)
|
|
11881
|
-
|
|
11908
|
+
if (!skipFirstToken) {
|
|
11909
|
+
if (bracket) this.expect(0);
|
|
11910
|
+
else this.expect(43);
|
|
11911
|
+
}
|
|
11882
11912
|
const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);
|
|
11883
11913
|
if (bracket) this.expect(1);
|
|
11884
11914
|
else this.expect(44);
|
|
@@ -11932,13 +11962,14 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
11932
11962
|
}
|
|
11933
11963
|
tsParseEntityName(flags) {
|
|
11934
11964
|
let entity;
|
|
11935
|
-
if (flags & 1 && this.match(74))
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
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));
|
|
11942
11973
|
while (this.eat(12)) {
|
|
11943
11974
|
const node = this.startNodeAtNode(entity);
|
|
11944
11975
|
node.left = entity;
|
|
@@ -12873,9 +12904,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
12873
12904
|
return this.tsParseNamespaceDeclaration(node);
|
|
12874
12905
|
}
|
|
12875
12906
|
break;
|
|
12876
|
-
case 126:
|
|
12877
|
-
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) return this.tsParseTypeAliasDeclaration(node);
|
|
12878
|
-
break;
|
|
12907
|
+
case 126: if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) return this.tsParseTypeAliasDeclaration(node);
|
|
12879
12908
|
}
|
|
12880
12909
|
}
|
|
12881
12910
|
tsCheckLineTerminator(next) {
|
|
@@ -13262,14 +13291,12 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
13262
13291
|
return this.tsParseDeclaration(node, 124, false, decorators);
|
|
13263
13292
|
}
|
|
13264
13293
|
break;
|
|
13265
|
-
case 126:
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
}
|
|
13272
|
-
break;
|
|
13294
|
+
case 126: if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
13295
|
+
const node = this.startNode();
|
|
13296
|
+
if (!allowDeclaration) this.raise(TSErrors.UnexpectedTypeDeclaration, node, "type");
|
|
13297
|
+
this.next();
|
|
13298
|
+
return this.tsParseTypeAliasDeclaration(node);
|
|
13299
|
+
}
|
|
13273
13300
|
}
|
|
13274
13301
|
return super.parseStatementContent(flags, decorators);
|
|
13275
13302
|
}
|
|
@@ -13771,11 +13798,13 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
13771
13798
|
if (this.match(76)) {
|
|
13772
13799
|
node.abstract = true;
|
|
13773
13800
|
return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
|
|
13774
|
-
} else if (this.isContextual(125))
|
|
13775
|
-
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
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
|
+
}
|
|
13779
13808
|
throw this.unexpected(null, 76);
|
|
13780
13809
|
}
|
|
13781
13810
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
@@ -14112,13 +14141,14 @@ const placeholders = (superClass) => class PlaceholdersParserMixin extends super
|
|
|
14112
14141
|
this.next();
|
|
14113
14142
|
const oldStrict = this.state.strict;
|
|
14114
14143
|
const placeholder = this.parsePlaceholder("Identifier");
|
|
14115
|
-
if (placeholder)
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
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);
|
|
14122
14152
|
super.parseClassSuper(node);
|
|
14123
14153
|
node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict);
|
|
14124
14154
|
return this.finishNode(node, type);
|
|
@@ -17292,7 +17322,7 @@ function deriveMenuButtonBoundingClientRect(systemInfo) {
|
|
|
17292
17322
|
}
|
|
17293
17323
|
//#endregion
|
|
17294
17324
|
//#region ../../mpcore/packages/simulator/src/runtime/wxState.ts
|
|
17295
|
-
const STORAGE_LIMIT_SIZE =
|
|
17325
|
+
const STORAGE_LIMIT_SIZE = 10240;
|
|
17296
17326
|
const DEFAULT_MODAL_CANCEL_COLOR = "#000000";
|
|
17297
17327
|
const DEFAULT_MODAL_CANCEL_TEXT = "取消";
|
|
17298
17328
|
const DEFAULT_MODAL_CONFIRM_COLOR = "#576B95";
|
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.
|
|
4
|
+
"version": "1.2.11",
|
|
5
5
|
"description": "完全兼容微信 miniprogram-automator 的现代化替代实现",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"obug": "^2.1.4",
|
|
45
|
-
"ws": "^8.21.
|
|
45
|
+
"ws": "^8.21.2",
|
|
46
46
|
"@weapp-vite/qr": "1.1.1"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|