weapp-tailwindcss 5.2.11 → 5.2.13
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/bundlers/shared/generator-css/user-css/source-fragments.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/user-css.d.ts +1 -1
- package/dist/bundlers/shared/hmr-timing.d.ts +1 -0
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +2 -0
- package/dist/bundlers/vite/css-finalizer/generic-web-fast-path.d.ts +16 -0
- package/dist/bundlers/vite/css-finalizer/options.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +1 -0
- package/dist/bundlers/vite/shared/generic-web-production-fast-path.d.ts +28 -0
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +1 -0
- package/dist/cli.cjs +372 -293
- package/dist/cli.js +20 -11
- package/dist/{context-DbL0d-zB.js → context-CKQKq4Mv.js} +19 -8
- package/dist/{context-C3TryIjF.cjs → context-vWlNv-Cf.cjs} +17 -11
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{css-imports-DfNC3e6a.cjs → css-imports-BFMU7Hpd.cjs} +1 -1
- package/dist/css-macro/postcss.cjs +1 -1
- package/dist/css-macro.cjs +1 -1
- package/dist/defaults.cjs +2 -0
- package/dist/defaults.js +2 -0
- package/dist/framework.cjs +1 -1
- package/dist/{generator-BLpOsd5O.js → generator-BP4WmgIo.js} +36 -15
- package/dist/{generator-B0dCFlP1.cjs → generator-BXrWA7Sj.cjs} +43 -22
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-DSrcDQsA.cjs → gulp-DxKLSgXX.cjs} +16 -13
- package/dist/{gulp-BLaGc0MJ.js → gulp-G--cGMcR.js} +12 -9
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-BnGBBJ6S.cjs → hmr-timing-BtqnyxAO.cjs} +5 -5
- package/dist/{hmr-timing-DXyGw6jp.js → hmr-timing-iTua_Z55.js} +47 -16
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{object-Bvy6-w9r.js → object-B-8IHefx.js} +4 -4
- package/dist/{object-C_Vr6_S5.cjs → object-DbHtAXRk.cjs} +4 -4
- package/dist/{options-zpZez7qe.cjs → options-DbYws6lr.cjs} +8 -17
- package/dist/{pipeline-helpers-B5CzvTUJ.cjs → pipeline-helpers-DnYpfbat.cjs} +25 -10
- package/dist/postcss-html-transform.cjs +1 -1
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +6 -5
- package/dist/presets.js +4 -3
- package/dist/reset.cjs +1 -1
- package/dist/{rolldown-runtime-CVvi-lCc.cjs → rolldown-runtime-Ctb5zv51.cjs} +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +1 -1
- package/dist/{runtime-registry-Y7NrD2WH.cjs → runtime-registry-BlIjpImP.cjs} +10 -0
- package/dist/{source-candidate-scan-signature-GjsLzP8Z.cjs → source-candidate-scan-signature-Ggn8fzkT.cjs} +6 -5
- package/dist/{source-candidate-scan-signature-xgmxO8_F.js → source-candidate-scan-signature-TKJIs7VF.js} +5 -4
- package/dist/{style-options-COpQc8fr.cjs → style-options-Cta1OP3i.cjs} +9 -4
- package/dist/{tailwindcss-2zdmASlM.js → tailwindcss-C2K-vjJv.js} +20 -20
- package/dist/{tailwindcss-LtnGCxF0.cjs → tailwindcss-D1M2xj5O.cjs} +17 -13
- package/dist/{transform-BlsDWgjt.js → transform-52FLRu-0.js} +2 -2
- package/dist/{transform-9wbmvHcC.cjs → transform-BiHG42Rp.cjs} +2 -2
- package/dist/types/user-defined-options/general.d.ts +2 -0
- package/dist/{v4-generation-core-D4zQcQqW.cjs → v4-generation-core-D-zVR2mt.cjs} +53 -16
- package/dist/{vite-BWmBFzgf.js → vite-B577QMUl.js} +317 -82
- package/dist/{vite-DTDbD-95.cjs → vite-BFWJAH16.cjs} +322 -87
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-BZGubvuJ.cjs → watch-dependencies-DLZDrWdH.cjs} +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +14 -12
- package/dist/weapp-tw-runtime-classset-loader.cjs +5 -4
- package/dist/{webpack-CtUyQNqC.js → webpack-DLJkStre.js} +41 -22
- package/dist/{webpack-Bpovb6YE.cjs → webpack-DTqFKvcE.cjs} +46 -36
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/{wxml-CWJc0yY-.js → wxml-B7OAVpXJ.js} +10 -6
- package/dist/{wxml-DUIdXCVa.cjs → wxml-CQmBCjOR.cjs} +386 -311
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_object = require("./object-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
+
const require_object = require("./object-DbHtAXRk.cjs");
|
|
3
3
|
const require_cache_options = require("./cache-options-DavPxrhC.cjs");
|
|
4
4
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
5
5
|
let lru_cache = require("lru-cache");
|
|
@@ -960,15 +960,16 @@ var Tokenizer$2 = class {
|
|
|
960
960
|
if (c === CharCodes.ExclamationMark) {
|
|
961
961
|
this.state = State$1.BeforeDeclaration;
|
|
962
962
|
this.sectionStart = this.index + 1;
|
|
963
|
-
} else if (c === CharCodes.Questionmark)
|
|
964
|
-
this.
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
963
|
+
} else if (c === CharCodes.Questionmark) {
|
|
964
|
+
if (this.xmlMode) {
|
|
965
|
+
this.state = State$1.InProcessingInstruction;
|
|
966
|
+
this.sequenceIndex = 0;
|
|
967
|
+
this.sectionStart = this.index + 1;
|
|
968
|
+
} else {
|
|
969
|
+
this.state = State$1.InSpecialComment;
|
|
970
|
+
this.sectionStart = this.index;
|
|
971
|
+
}
|
|
972
|
+
} else if (this.isTagStartChar(c)) {
|
|
972
973
|
this.sectionStart = this.index;
|
|
973
974
|
const special = this.xmlMode || this.cbs.isInForeignContext?.() ? void 0 : specialStartSequences.get(c | 32);
|
|
974
975
|
if (special === void 0) this.state = State$1.InTagName;
|
|
@@ -993,11 +994,12 @@ var Tokenizer$2 = class {
|
|
|
993
994
|
}
|
|
994
995
|
}
|
|
995
996
|
stateBeforeClosingTagName(c) {
|
|
996
|
-
if (isWhitespace$2(c))
|
|
997
|
-
this.
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
997
|
+
if (isWhitespace$2(c)) {
|
|
998
|
+
if (this.xmlMode) {} else {
|
|
999
|
+
this.state = State$1.InSpecialComment;
|
|
1000
|
+
this.sectionStart = this.index;
|
|
1001
|
+
}
|
|
1002
|
+
} else if (c === CharCodes.Gt) {
|
|
1001
1003
|
this.state = State$1.Text;
|
|
1002
1004
|
if (!this.xmlMode) this.sectionStart = this.index + 1;
|
|
1003
1005
|
} else {
|
|
@@ -1320,9 +1322,7 @@ var Tokenizer$2 = class {
|
|
|
1320
1322
|
case State$1.InProcessingInstruction:
|
|
1321
1323
|
this.stateInProcessingInstruction(c);
|
|
1322
1324
|
break;
|
|
1323
|
-
case State$1.InEntity:
|
|
1324
|
-
this.stateInEntity();
|
|
1325
|
-
break;
|
|
1325
|
+
case State$1.InEntity: this.stateInEntity();
|
|
1326
1326
|
}
|
|
1327
1327
|
this.index++;
|
|
1328
1328
|
}
|
|
@@ -1338,13 +1338,14 @@ var Tokenizer$2 = class {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
handleTrailingCommentLikeData(endIndex) {
|
|
1340
1340
|
if (this.state !== State$1.InCommentLike) return false;
|
|
1341
|
-
if (this.currentSequence === Sequences.CdataEnd)
|
|
1342
|
-
if (this.
|
|
1341
|
+
if (this.currentSequence === Sequences.CdataEnd) {
|
|
1342
|
+
if (this.xmlMode) {
|
|
1343
|
+
if (this.sectionStart < endIndex) this.cbs.oncdata(this.sectionStart, endIndex, 0);
|
|
1344
|
+
} else {
|
|
1345
|
+
const cdataStart = this.sectionStart - Sequences.Cdata.length - 1;
|
|
1346
|
+
this.cbs.oncomment(cdataStart, endIndex, 0);
|
|
1347
|
+
}
|
|
1343
1348
|
} else {
|
|
1344
|
-
const cdataStart = this.sectionStart - Sequences.Cdata.length - 1;
|
|
1345
|
-
this.cbs.oncomment(cdataStart, endIndex, 0);
|
|
1346
|
-
}
|
|
1347
|
-
else {
|
|
1348
1349
|
const offset = this.xmlMode ? 0 : Math.min(this.sequenceIndex, Sequences.CommentEnd.length - 1);
|
|
1349
1350
|
this.cbs.oncomment(this.sectionStart, endIndex, offset);
|
|
1350
1351
|
}
|
|
@@ -2312,9 +2313,10 @@ function getMarkerLines(loc, source, opts, startLineBaseZero) {
|
|
|
2312
2313
|
else if (i === lineDiff) markerLines[lineNumber] = [0, endColumn];
|
|
2313
2314
|
else markerLines[lineNumber] = [0, source[lineNumber - 1].length];
|
|
2314
2315
|
}
|
|
2315
|
-
else if (startColumn === endColumn)
|
|
2316
|
-
|
|
2317
|
-
|
|
2316
|
+
else if (startColumn === endColumn) {
|
|
2317
|
+
if (startColumn != null) markerLines[startLine] = [startColumn, 0];
|
|
2318
|
+
else markerLines[startLine] = true;
|
|
2319
|
+
} else {
|
|
2318
2320
|
const safeStart = startColumn ?? 0;
|
|
2319
2321
|
markerLines[startLine] = [safeStart, (endColumn ?? safeStart) - safeStart];
|
|
2320
2322
|
}
|
|
@@ -3116,14 +3118,15 @@ function readStringContents$1(type, input, pos, lineStart, curLine, errors) {
|
|
|
3116
3118
|
++pos;
|
|
3117
3119
|
++curLine;
|
|
3118
3120
|
lineStart = pos;
|
|
3119
|
-
} else if (ch === 10 || ch === 13)
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3121
|
+
} else if (ch === 10 || ch === 13) {
|
|
3122
|
+
if (type === "template") {
|
|
3123
|
+
out += input.slice(chunkStart, pos) + "\n";
|
|
3124
|
+
++pos;
|
|
3125
|
+
if (ch === 13 && input.charCodeAt(pos) === 10) ++pos;
|
|
3126
|
+
++curLine;
|
|
3127
|
+
chunkStart = lineStart = pos;
|
|
3128
|
+
} else errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
|
3129
|
+
} else ++pos;
|
|
3127
3130
|
}
|
|
3128
3131
|
return {
|
|
3129
3132
|
pos,
|
|
@@ -3184,8 +3187,10 @@ function readEscapedChar$1(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
|
3184
3187
|
}
|
|
3185
3188
|
pos += octalStr.length - 1;
|
|
3186
3189
|
const next = input.charCodeAt(pos);
|
|
3187
|
-
if (octalStr !== "0" || next === 56 || next === 57)
|
|
3188
|
-
|
|
3190
|
+
if (octalStr !== "0" || next === 56 || next === 57) {
|
|
3191
|
+
if (inTemplate) return res(null);
|
|
3192
|
+
else errors.strictNumericEscape(startPos, lineStart, curLine);
|
|
3193
|
+
}
|
|
3189
3194
|
return res(String.fromCharCode(octal));
|
|
3190
3195
|
}
|
|
3191
3196
|
return res(String.fromCharCode(ch));
|
|
@@ -3195,8 +3200,10 @@ function readHexChar$1(input, pos, lineStart, curLine, len, forceLen, throwOnInv
|
|
|
3195
3200
|
const initialPos = pos;
|
|
3196
3201
|
let n;
|
|
3197
3202
|
({n, pos} = readInt$1(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
|
|
3198
|
-
if (n === null)
|
|
3199
|
-
|
|
3203
|
+
if (n === null) {
|
|
3204
|
+
if (throwOnInvalid) errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
|
3205
|
+
else pos = initialPos - 1;
|
|
3206
|
+
}
|
|
3200
3207
|
return {
|
|
3201
3208
|
code: n,
|
|
3202
3209
|
pos
|
|
@@ -3234,15 +3241,17 @@ function readInt$1(input, pos, lineStart, curLine, radix, len, forceLen, allowNu
|
|
|
3234
3241
|
else if (code >= 65) val = code - 65 + 10;
|
|
3235
3242
|
else if (_isDigit$1(code)) val = code - 48;
|
|
3236
3243
|
else val = Infinity;
|
|
3237
|
-
if (val >= radix)
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3244
|
+
if (val >= radix) {
|
|
3245
|
+
if (val <= 9 && bailOnError) return {
|
|
3246
|
+
n: null,
|
|
3247
|
+
pos
|
|
3248
|
+
};
|
|
3249
|
+
else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) val = 0;
|
|
3250
|
+
else if (forceLen) {
|
|
3251
|
+
val = 0;
|
|
3252
|
+
invalid = true;
|
|
3253
|
+
} else break;
|
|
3254
|
+
}
|
|
3246
3255
|
++pos;
|
|
3247
3256
|
total = total * radix + val;
|
|
3248
3257
|
}
|
|
@@ -3262,11 +3271,13 @@ function readCodePoint$1(input, pos, lineStart, curLine, throwOnInvalid, errors)
|
|
|
3262
3271
|
++pos;
|
|
3263
3272
|
({code, pos} = readHexChar$1(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
|
|
3264
3273
|
++pos;
|
|
3265
|
-
if (code !== null && code > 1114111)
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3274
|
+
if (code !== null && code > 1114111) {
|
|
3275
|
+
if (throwOnInvalid) errors.invalidCodePoint(pos, lineStart, curLine);
|
|
3276
|
+
else return {
|
|
3277
|
+
code: null,
|
|
3278
|
+
pos
|
|
3279
|
+
};
|
|
3280
|
+
}
|
|
3270
3281
|
} else ({code, pos} = readHexChar$1(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
|
|
3271
3282
|
return {
|
|
3272
3283
|
code,
|
|
@@ -8117,9 +8128,10 @@ defineType$4("VariableDeclaration", {
|
|
|
8117
8128
|
if (parentIsForX) {
|
|
8118
8129
|
if (declarations.length !== 1) throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
|
|
8119
8130
|
}
|
|
8120
|
-
for (const decl of declarations) if (kind === "const" || kind === "let" || kind === "var")
|
|
8121
|
-
|
|
8122
|
-
|
|
8131
|
+
for (const decl of declarations) if (kind === "const" || kind === "let" || kind === "var") {
|
|
8132
|
+
if (!parentIsForX && !decl.init) withoutInit(decl, "id", decl.id);
|
|
8133
|
+
else constOrLetOrVar(decl, "id", decl.id);
|
|
8134
|
+
} else usingOrAwaitUsing(decl, "id", decl.id);
|
|
8123
8135
|
};
|
|
8124
8136
|
})()
|
|
8125
8137
|
});
|
|
@@ -8569,9 +8581,7 @@ defineType$4("MetaProperty", {
|
|
|
8569
8581
|
case "new":
|
|
8570
8582
|
property = "target";
|
|
8571
8583
|
break;
|
|
8572
|
-
case "import":
|
|
8573
|
-
property = "meta";
|
|
8574
|
-
break;
|
|
8584
|
+
case "import": property = "meta";
|
|
8575
8585
|
}
|
|
8576
8586
|
if (!is("Identifier", node.property, { name: property })) throw new TypeError("Unrecognised MetaProperty");
|
|
8577
8587
|
}, { oneOfNodeTypes: ["Identifier"] })) },
|
|
@@ -14585,10 +14595,14 @@ function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache)
|
|
|
14585
14595
|
if (hasOwn(node, "typeAnnotation")) newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc, commentsCache) : node.typeAnnotation;
|
|
14586
14596
|
if (hasOwn(node, "decorators")) newNode.decorators = deep ? cloneIfNodeOrArray(node.decorators, true, withoutLoc, commentsCache) : node.decorators;
|
|
14587
14597
|
} else if (!hasOwn(NODE_FIELDS$1, type)) throw new Error(`Unknown node type: "${type}"`);
|
|
14588
|
-
else for (const field of Object.keys(NODE_FIELDS$1[type])) if (hasOwn(node, field))
|
|
14589
|
-
|
|
14590
|
-
|
|
14591
|
-
|
|
14598
|
+
else for (const field of Object.keys(NODE_FIELDS$1[type])) if (hasOwn(node, field)) {
|
|
14599
|
+
if (deep) newNode[field] = isFile(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc, commentsCache) : cloneIfNodeOrArray(node[field], true, withoutLoc, commentsCache);
|
|
14600
|
+
else newNode[field] = node[field];
|
|
14601
|
+
}
|
|
14602
|
+
if (hasOwn(node, "loc")) {
|
|
14603
|
+
if (withoutLoc) newNode.loc = null;
|
|
14604
|
+
else newNode.loc = node.loc;
|
|
14605
|
+
}
|
|
14592
14606
|
if (hasOwn(node, "leadingComments")) newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc, commentsCache);
|
|
14593
14607
|
if (hasOwn(node, "innerComments")) newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc, commentsCache);
|
|
14594
14608
|
if (hasOwn(node, "trailingComments")) newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc, commentsCache);
|
|
@@ -14626,9 +14640,10 @@ function cloneWithoutLoc(node) {
|
|
|
14626
14640
|
function addComments$1(node, type, comments) {
|
|
14627
14641
|
if (!comments || !node) return node;
|
|
14628
14642
|
const key = `${type}Comments`;
|
|
14629
|
-
if (node[key])
|
|
14630
|
-
|
|
14631
|
-
|
|
14643
|
+
if (node[key]) {
|
|
14644
|
+
if (type === "leading") node[key] = comments.concat(node[key]);
|
|
14645
|
+
else node[key].push(...comments);
|
|
14646
|
+
} else node[key] = comments;
|
|
14632
14647
|
return node;
|
|
14633
14648
|
}
|
|
14634
14649
|
function addComment$1(node, type, content, line) {
|
|
@@ -14722,8 +14737,10 @@ function toBlock(node, parent) {
|
|
|
14722
14737
|
let blockNodes;
|
|
14723
14738
|
if (isEmptyStatement$1(node)) blockNodes = [];
|
|
14724
14739
|
else {
|
|
14725
|
-
if (!isStatement$6(node))
|
|
14726
|
-
|
|
14740
|
+
if (!isStatement$6(node)) {
|
|
14741
|
+
if (isFunction$3(parent)) node = returnStatement$2(node);
|
|
14742
|
+
else node = expressionStatement$5(node);
|
|
14743
|
+
}
|
|
14727
14744
|
blockNodes = [node];
|
|
14728
14745
|
}
|
|
14729
14746
|
return blockStatement$4(blockNodes);
|
|
@@ -14837,8 +14854,10 @@ function toStatement(node, ignore) {
|
|
|
14837
14854
|
newType = "FunctionDeclaration";
|
|
14838
14855
|
} else if (isAssignmentExpression$1(node)) return expressionStatement$5(node);
|
|
14839
14856
|
if (mustHaveId && !node.id) newType = false;
|
|
14840
|
-
if (!newType)
|
|
14841
|
-
|
|
14857
|
+
if (!newType) {
|
|
14858
|
+
if (ignore) return false;
|
|
14859
|
+
else throw new Error(`cannot turn ${node.type} to a statement`);
|
|
14860
|
+
}
|
|
14842
14861
|
node.type = newType;
|
|
14843
14862
|
return node;
|
|
14844
14863
|
}
|
|
@@ -14868,8 +14887,10 @@ function valueToNode(value) {
|
|
|
14868
14887
|
if (value < 0 || Object.is(value, -0)) result = unaryExpression$1("-", result);
|
|
14869
14888
|
return result;
|
|
14870
14889
|
}
|
|
14871
|
-
if (typeof value === "bigint")
|
|
14872
|
-
|
|
14890
|
+
if (typeof value === "bigint") {
|
|
14891
|
+
if (value < 0) return unaryExpression$1("-", bigIntLiteral(-value));
|
|
14892
|
+
else return bigIntLiteral(value);
|
|
14893
|
+
}
|
|
14873
14894
|
if (isRegExp(value)) {
|
|
14874
14895
|
const pattern = value.source;
|
|
14875
14896
|
const flags = /\/([a-z]*)$/.exec(value.toString())[1];
|
|
@@ -14880,11 +14901,12 @@ function valueToNode(value) {
|
|
|
14880
14901
|
const props = [];
|
|
14881
14902
|
for (const key of Object.keys(value)) {
|
|
14882
14903
|
let nodeKey, computed = false;
|
|
14883
|
-
if (isValidIdentifier(key))
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
|
|
14904
|
+
if (isValidIdentifier(key)) {
|
|
14905
|
+
if (key === "__proto__") {
|
|
14906
|
+
computed = true;
|
|
14907
|
+
nodeKey = stringLiteral$2(key);
|
|
14908
|
+
} else nodeKey = identifier$5(key);
|
|
14909
|
+
} else nodeKey = stringLiteral$2(key);
|
|
14888
14910
|
props.push(objectProperty(nodeKey, valueToNode(value[key]), computed));
|
|
14889
14911
|
}
|
|
14890
14912
|
return objectExpression$1(props);
|
|
@@ -14939,9 +14961,7 @@ function getAssignmentIdentifiers$2(node) {
|
|
|
14939
14961
|
case "UnaryExpression":
|
|
14940
14962
|
if (id.operator === "delete") search.push(id.argument);
|
|
14941
14963
|
break;
|
|
14942
|
-
case "Identifier":
|
|
14943
|
-
ids[id.name] = id;
|
|
14944
|
-
break;
|
|
14964
|
+
case "Identifier": ids[id.name] = id;
|
|
14945
14965
|
}
|
|
14946
14966
|
}
|
|
14947
14967
|
return ids;
|
|
@@ -14972,8 +14992,10 @@ function getBindingIdentifiers$3(node, duplicates, outerOnly, newBindingsOnly) {
|
|
|
14972
14992
|
const keys = getBindingIdentifiers$3.keys[id.type];
|
|
14973
14993
|
if (keys) for (let i = 0; i < keys.length; i++) {
|
|
14974
14994
|
const nodes = id[keys[i]];
|
|
14975
|
-
if (nodes)
|
|
14976
|
-
|
|
14995
|
+
if (nodes) {
|
|
14996
|
+
if (Array.isArray(nodes)) search.push(...nodes);
|
|
14997
|
+
else search.push(nodes);
|
|
14998
|
+
}
|
|
14977
14999
|
}
|
|
14978
15000
|
}
|
|
14979
15001
|
return ids;
|
|
@@ -15111,8 +15133,10 @@ function isBlockScoped$1(node) {
|
|
|
15111
15133
|
}
|
|
15112
15134
|
function isImmutable(node) {
|
|
15113
15135
|
if (isType$1(node.type, "Immutable")) return true;
|
|
15114
|
-
if (isIdentifier$7(node))
|
|
15115
|
-
|
|
15136
|
+
if (isIdentifier$7(node)) {
|
|
15137
|
+
if (node.name === "undefined") return true;
|
|
15138
|
+
else return false;
|
|
15139
|
+
}
|
|
15116
15140
|
return false;
|
|
15117
15141
|
}
|
|
15118
15142
|
function isNodesEquivalent(a, b) {
|
|
@@ -15818,12 +15842,10 @@ const estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
15818
15842
|
node.exported = node.specifiers[0].exported;
|
|
15819
15843
|
delete node.specifiers;
|
|
15820
15844
|
}
|
|
15821
|
-
case "ExportDefaultDeclaration":
|
|
15822
|
-
{
|
|
15823
|
-
|
|
15824
|
-
|
|
15825
|
-
}
|
|
15826
|
-
break;
|
|
15845
|
+
case "ExportDefaultDeclaration": {
|
|
15846
|
+
const { declaration } = node;
|
|
15847
|
+
if (declaration?.type === "ClassDeclaration" && declaration.decorators?.length > 0 && declaration.start === node.start) this.resetStartLocation(node, exportStartLoc);
|
|
15848
|
+
}
|
|
15827
15849
|
}
|
|
15828
15850
|
return node;
|
|
15829
15851
|
}
|
|
@@ -16799,12 +16821,13 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
16799
16821
|
if (this.match(76)) return this.flowParseDeclareClass(node);
|
|
16800
16822
|
else if (this.match(64)) return this.flowParseDeclareFunction(node);
|
|
16801
16823
|
else if (this.match(70)) return this.flowParseDeclareVariable(node);
|
|
16802
|
-
else if (this.eatContextual(123))
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16824
|
+
else if (this.eatContextual(123)) {
|
|
16825
|
+
if (this.match(12)) return this.flowParseDeclareModuleExports(node);
|
|
16826
|
+
else {
|
|
16827
|
+
if (insideModule) this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
|
|
16828
|
+
return this.flowParseDeclareModule(node);
|
|
16829
|
+
}
|
|
16830
|
+
} else if (this.isContextual(126)) return this.flowParseDeclareTypeAlias(node);
|
|
16808
16831
|
else if (this.isContextual(127)) return this.flowParseDeclareOpaqueType(node);
|
|
16809
16832
|
else if (this.isContextual(125)) return this.flowParseDeclareInterface(node);
|
|
16810
16833
|
else if (this.match(78)) return this.flowParseDeclareExportDeclaration(node, insideModule);
|
|
@@ -17416,10 +17439,12 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
17416
17439
|
case 6: {
|
|
17417
17440
|
const node = this.startNode();
|
|
17418
17441
|
this.next();
|
|
17419
|
-
if (!this.match(7) && !this.match(17))
|
|
17420
|
-
|
|
17421
|
-
|
|
17422
|
-
|
|
17442
|
+
if (!this.match(7) && !this.match(17)) {
|
|
17443
|
+
if (tokenIsIdentifier(this.state.type) || this.match(74)) {
|
|
17444
|
+
const token = this.lookahead().type;
|
|
17445
|
+
isGroupedType = token !== 13 && token !== 10;
|
|
17446
|
+
} else isGroupedType = true;
|
|
17447
|
+
}
|
|
17423
17448
|
if (isGroupedType) {
|
|
17424
17449
|
this.state.noAnonFunctionType = false;
|
|
17425
17450
|
type = this.flowParseType();
|
|
@@ -17825,9 +17850,10 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
17825
17850
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
17826
17851
|
if (code === 123 && next === 124) this.finishOp(3, 2);
|
|
17827
17852
|
else if (this.state.inType && (code === 62 || code === 60)) this.finishOp(code === 62 ? 44 : 43, 1);
|
|
17828
|
-
else if (this.state.inType && code === 63)
|
|
17829
|
-
|
|
17830
|
-
|
|
17853
|
+
else if (this.state.inType && code === 63) {
|
|
17854
|
+
if (next === 46) this.finishOp(14, 2);
|
|
17855
|
+
else this.finishOp(13, 1);
|
|
17856
|
+
} else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) {
|
|
17831
17857
|
this.state.pos += 2;
|
|
17832
17858
|
this.readIterator();
|
|
17833
17859
|
} else super.getTokenFromCode(code);
|
|
@@ -19230,8 +19256,10 @@ var TypeScriptScopeHandler = class extends ScopeHandler {
|
|
|
19230
19256
|
if (bindingType & 256) return (bindingType & 512) > 0 !== (type & 4) > 0;
|
|
19231
19257
|
return true;
|
|
19232
19258
|
}
|
|
19233
|
-
if (bindingType & 128 && (type & 8) > 0)
|
|
19234
|
-
|
|
19259
|
+
if (bindingType & 128 && (type & 8) > 0) {
|
|
19260
|
+
if (scope.names.get(name) & 2) return !!(bindingType & 1);
|
|
19261
|
+
else return false;
|
|
19262
|
+
}
|
|
19235
19263
|
if (bindingType & 2 && (type & 1) > 0) return true;
|
|
19236
19264
|
return super.isRedeclaredInScope(scope, name, bindingType);
|
|
19237
19265
|
}
|
|
@@ -19620,14 +19648,15 @@ function readStringContents(type, input, pos, lineStart, curLine, errors) {
|
|
|
19620
19648
|
++pos;
|
|
19621
19649
|
++curLine;
|
|
19622
19650
|
lineStart = pos;
|
|
19623
|
-
} else if (ch === 10 || ch === 13)
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
|
|
19629
|
-
|
|
19630
|
-
|
|
19651
|
+
} else if (ch === 10 || ch === 13) {
|
|
19652
|
+
if (type === "template") {
|
|
19653
|
+
out += input.slice(chunkStart, pos) + "\n";
|
|
19654
|
+
++pos;
|
|
19655
|
+
if (ch === 13 && input.charCodeAt(pos) === 10) ++pos;
|
|
19656
|
+
++curLine;
|
|
19657
|
+
chunkStart = lineStart = pos;
|
|
19658
|
+
} else errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
|
19659
|
+
} else ++pos;
|
|
19631
19660
|
}
|
|
19632
19661
|
return {
|
|
19633
19662
|
pos,
|
|
@@ -19688,8 +19717,10 @@ function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
|
19688
19717
|
}
|
|
19689
19718
|
pos += octalStr.length - 1;
|
|
19690
19719
|
const next = input.charCodeAt(pos);
|
|
19691
|
-
if (octalStr !== "0" || next === 56 || next === 57)
|
|
19692
|
-
|
|
19720
|
+
if (octalStr !== "0" || next === 56 || next === 57) {
|
|
19721
|
+
if (inTemplate) return res(null);
|
|
19722
|
+
else errors.strictNumericEscape(startPos, lineStart, curLine);
|
|
19723
|
+
}
|
|
19693
19724
|
return res(String.fromCharCode(octal));
|
|
19694
19725
|
}
|
|
19695
19726
|
return res(String.fromCharCode(ch));
|
|
@@ -19699,8 +19730,10 @@ function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInval
|
|
|
19699
19730
|
const initialPos = pos;
|
|
19700
19731
|
let n;
|
|
19701
19732
|
({n, pos} = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
|
|
19702
|
-
if (n === null)
|
|
19703
|
-
|
|
19733
|
+
if (n === null) {
|
|
19734
|
+
if (throwOnInvalid) errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
|
19735
|
+
else pos = initialPos - 1;
|
|
19736
|
+
}
|
|
19704
19737
|
return {
|
|
19705
19738
|
code: n,
|
|
19706
19739
|
pos
|
|
@@ -19738,15 +19771,17 @@ function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumS
|
|
|
19738
19771
|
else if (code >= 65) val = code - 65 + 10;
|
|
19739
19772
|
else if (_isDigit(code)) val = code - 48;
|
|
19740
19773
|
else val = Infinity;
|
|
19741
|
-
if (val >= radix)
|
|
19742
|
-
|
|
19743
|
-
|
|
19744
|
-
|
|
19745
|
-
|
|
19746
|
-
|
|
19747
|
-
|
|
19748
|
-
|
|
19749
|
-
|
|
19774
|
+
if (val >= radix) {
|
|
19775
|
+
if (val <= 9 && bailOnError) return {
|
|
19776
|
+
n: null,
|
|
19777
|
+
pos
|
|
19778
|
+
};
|
|
19779
|
+
else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) val = 0;
|
|
19780
|
+
else if (forceLen) {
|
|
19781
|
+
val = 0;
|
|
19782
|
+
invalid = true;
|
|
19783
|
+
} else break;
|
|
19784
|
+
}
|
|
19750
19785
|
++pos;
|
|
19751
19786
|
total = total * radix + val;
|
|
19752
19787
|
}
|
|
@@ -19766,11 +19801,13 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
|
|
19766
19801
|
++pos;
|
|
19767
19802
|
({code, pos} = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
|
|
19768
19803
|
++pos;
|
|
19769
|
-
if (code !== null && code > 1114111)
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19804
|
+
if (code !== null && code > 1114111) {
|
|
19805
|
+
if (throwOnInvalid) errors.invalidCodePoint(pos, lineStart, curLine);
|
|
19806
|
+
else return {
|
|
19807
|
+
code: null,
|
|
19808
|
+
pos
|
|
19809
|
+
};
|
|
19810
|
+
}
|
|
19774
19811
|
} else ({code, pos} = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
|
|
19775
19812
|
return {
|
|
19776
19813
|
code,
|
|
@@ -20234,9 +20271,10 @@ var Tokenizer$1 = class extends CommentsParser {
|
|
|
20234
20271
|
readToken_question() {
|
|
20235
20272
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
20236
20273
|
const next2 = this.input.charCodeAt(this.state.pos + 2);
|
|
20237
|
-
if (next === 63)
|
|
20238
|
-
|
|
20239
|
-
|
|
20274
|
+
if (next === 63) {
|
|
20275
|
+
if (next2 === 61) this.finishOp(26, 3);
|
|
20276
|
+
else this.finishOp(36, 2);
|
|
20277
|
+
} else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
|
|
20240
20278
|
this.state.pos += 2;
|
|
20241
20279
|
this.finishToken(14);
|
|
20242
20280
|
} else {
|
|
@@ -21109,9 +21147,7 @@ var LValParser = class extends NodeUtils {
|
|
|
21109
21147
|
if (node.left.type === "VoidPattern") this.raise(Errors.VoidPatternInitializer, node.left);
|
|
21110
21148
|
this.toAssignable(node.left, isLHS);
|
|
21111
21149
|
break;
|
|
21112
|
-
case "ParenthesizedExpression":
|
|
21113
|
-
this.toAssignable(parenthesized, isLHS);
|
|
21114
|
-
break;
|
|
21150
|
+
case "ParenthesizedExpression": this.toAssignable(parenthesized, isLHS);
|
|
21115
21151
|
}
|
|
21116
21152
|
}
|
|
21117
21153
|
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
|
|
@@ -21302,8 +21338,10 @@ var LValParser = class extends NodeUtils {
|
|
|
21302
21338
|
if (type === "Identifier") {
|
|
21303
21339
|
this.checkIdentifier(expression, binding, strictModeChanged);
|
|
21304
21340
|
const { name } = expression;
|
|
21305
|
-
if (checkClashes)
|
|
21306
|
-
|
|
21341
|
+
if (checkClashes) {
|
|
21342
|
+
if (checkClashes.has(name)) this.raise(Errors.ParamDupe, expression);
|
|
21343
|
+
else checkClashes.add(name);
|
|
21344
|
+
}
|
|
21307
21345
|
return;
|
|
21308
21346
|
} else if (type === "VoidPattern" && ancestor.type === "CatchClause") this.raise(Errors.VoidPatternCatchClauseParam, expression);
|
|
21309
21347
|
const unwrappedExpression = unwrapParenthesizedExpression(expression);
|
|
@@ -21327,8 +21365,10 @@ var LValParser = class extends NodeUtils {
|
|
|
21327
21365
|
} else if (val) this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, disallowCallExpression);
|
|
21328
21366
|
}
|
|
21329
21367
|
checkIdentifier(at, bindingType, strictModeChanged = false) {
|
|
21330
|
-
if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name)))
|
|
21331
|
-
|
|
21368
|
+
if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {
|
|
21369
|
+
if (bindingType === 64) this.raise(Errors.StrictEvalArguments, at, { referenceName: at.name });
|
|
21370
|
+
else this.raise(Errors.StrictEvalArgumentsBinding, at, { bindingName: at.name });
|
|
21371
|
+
}
|
|
21332
21372
|
if (bindingType & 8192 && at.name === "let") this.raise(Errors.LetInLexicalBinding, at);
|
|
21333
21373
|
if (!(bindingType & 64)) this.declareNameFromIdentifier(at, bindingType);
|
|
21334
21374
|
}
|
|
@@ -21358,9 +21398,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
21358
21398
|
if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) return sawProto;
|
|
21359
21399
|
const key = prop.key;
|
|
21360
21400
|
if ((key.type === "Identifier" ? key.name : key.value) === "__proto__") {
|
|
21361
|
-
if (sawProto)
|
|
21362
|
-
if (refExpressionErrors
|
|
21363
|
-
|
|
21401
|
+
if (sawProto) {
|
|
21402
|
+
if (refExpressionErrors) {
|
|
21403
|
+
if (refExpressionErrors.doubleProtoLoc === null) refExpressionErrors.doubleProtoLoc = this.getLoc(key.start);
|
|
21404
|
+
} else this.raise(Errors.DuplicateProto, key);
|
|
21405
|
+
}
|
|
21364
21406
|
return true;
|
|
21365
21407
|
}
|
|
21366
21408
|
return sawProto;
|
|
@@ -21755,9 +21797,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
21755
21797
|
node = this.startNode();
|
|
21756
21798
|
this.next();
|
|
21757
21799
|
if (this.match(12)) return this.parseImportMetaPropertyOrPhaseCall(node);
|
|
21758
|
-
if (this.match(6))
|
|
21759
|
-
|
|
21760
|
-
|
|
21800
|
+
if (this.match(6)) {
|
|
21801
|
+
if (this.optionFlags & 1024) return this.parseImportCall(node);
|
|
21802
|
+
else return this.finishNode(node, "Import");
|
|
21803
|
+
} else {
|
|
21761
21804
|
this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
|
|
21762
21805
|
return this.finishNode(node, "Import");
|
|
21763
21806
|
}
|
|
@@ -21826,9 +21869,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
21826
21869
|
this.resetPreviousNodeTrailingComments(id);
|
|
21827
21870
|
this.next();
|
|
21828
21871
|
return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
|
|
21829
|
-
} else if (tokenIsIdentifier(type))
|
|
21830
|
-
|
|
21831
|
-
|
|
21872
|
+
} else if (tokenIsIdentifier(type)) {
|
|
21873
|
+
if (canStartArrow && this.lookaheadCharCode() === 61) return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
|
|
21874
|
+
else return id;
|
|
21875
|
+
} else if (type === 86) {
|
|
21832
21876
|
this.resetPreviousNodeTrailingComments(id);
|
|
21833
21877
|
return this.parseDo(this.startNodeAtNode(id), true);
|
|
21834
21878
|
}
|
|
@@ -22478,8 +22522,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
22478
22522
|
const node = this.startNodeAt(startLoc);
|
|
22479
22523
|
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, startIndex);
|
|
22480
22524
|
if (this.eat(51)) this.raise(Errors.ObsoleteAwaitStar, startLoc);
|
|
22481
|
-
if (!this.scope.inFunction && !(this.optionFlags & 1))
|
|
22482
|
-
|
|
22525
|
+
if (!this.scope.inFunction && !(this.optionFlags & 1)) {
|
|
22526
|
+
if (this.isAmbiguousPrefixOrIdentifier()) this.ambiguousScriptDifferentAst = true;
|
|
22527
|
+
else this.sawUnambiguousESM = true;
|
|
22528
|
+
}
|
|
22483
22529
|
if (!soloAwait) node.argument = this.parseMaybeUnary(null, true);
|
|
22484
22530
|
return this.finishNode(node, "AwaitExpression");
|
|
22485
22531
|
}
|
|
@@ -23404,9 +23450,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
23404
23450
|
allowsDirectSuper = state.hadSuperClass;
|
|
23405
23451
|
}
|
|
23406
23452
|
this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
|
|
23407
|
-
} else if (this.isClassProperty())
|
|
23408
|
-
|
|
23409
|
-
|
|
23453
|
+
} else if (this.isClassProperty()) {
|
|
23454
|
+
if (isPrivate) this.pushClassPrivateProperty(classBody, privateProp);
|
|
23455
|
+
else this.pushClassProperty(classBody, publicProp);
|
|
23456
|
+
} else if (maybeContextualKw === "async" && !this.isLineTerminator()) {
|
|
23410
23457
|
this.resetPreviousNodeTrailingComments(key);
|
|
23411
23458
|
const isGenerator = this.eat(51);
|
|
23412
23459
|
if (publicMember.optional) this.unexpected(maybeQuestionTokenStartLoc);
|
|
@@ -23436,9 +23483,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
23436
23483
|
const isPrivate = this.match(134);
|
|
23437
23484
|
this.parseClassElementName(publicProp);
|
|
23438
23485
|
this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
|
|
23439
|
-
} else if (this.isLineTerminator())
|
|
23440
|
-
|
|
23441
|
-
|
|
23486
|
+
} else if (this.isLineTerminator()) {
|
|
23487
|
+
if (isPrivate) this.pushClassPrivateProperty(classBody, privateProp);
|
|
23488
|
+
else this.pushClassProperty(classBody, publicProp);
|
|
23489
|
+
} else this.unexpected();
|
|
23442
23490
|
}
|
|
23443
23491
|
parseClassElementName(member) {
|
|
23444
23492
|
const { type, value } = this.state;
|
|
@@ -23738,8 +23786,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
23738
23786
|
else if (node.type === "AssignmentPattern") this.checkDeclaration(node.left);
|
|
23739
23787
|
}
|
|
23740
23788
|
checkDuplicateExports(node, exportName) {
|
|
23741
|
-
if (this.exportedIdentifiers.has(exportName))
|
|
23742
|
-
|
|
23789
|
+
if (this.exportedIdentifiers.has(exportName)) {
|
|
23790
|
+
if (exportName === "default") this.raise(Errors.DuplicateDefaultExport, node);
|
|
23791
|
+
else this.raise(Errors.DuplicateExport, node, { exportName });
|
|
23792
|
+
}
|
|
23743
23793
|
this.exportedIdentifiers.add(exportName);
|
|
23744
23794
|
}
|
|
23745
23795
|
parseExportSpecifiers(isInTypeExport) {
|
|
@@ -24131,14 +24181,15 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
24131
24181
|
const { startLoc } = this.state;
|
|
24132
24182
|
const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers ?? []), stopOnStartOfClassStaticBlock, modified.static);
|
|
24133
24183
|
if (!modifier) break;
|
|
24134
|
-
if (tsIsAccessModifier(modifier))
|
|
24135
|
-
|
|
24136
|
-
|
|
24137
|
-
|
|
24138
|
-
|
|
24139
|
-
|
|
24140
|
-
|
|
24141
|
-
|
|
24184
|
+
if (tsIsAccessModifier(modifier)) {
|
|
24185
|
+
if (modified.accessibility) this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { modifier });
|
|
24186
|
+
else {
|
|
24187
|
+
enforceOrder(startLoc, modifier, modifier, "override");
|
|
24188
|
+
enforceOrder(startLoc, modifier, modifier, "static");
|
|
24189
|
+
enforceOrder(startLoc, modifier, modifier, "readonly");
|
|
24190
|
+
modified.accessibility = modifier;
|
|
24191
|
+
}
|
|
24192
|
+
} else if (tsIsVarianceAnnotations(modifier)) {
|
|
24142
24193
|
if (modified[modifier]) this.raise(TSErrors.DuplicateModifier, startLoc, { modifier });
|
|
24143
24194
|
modified[modifier] = true;
|
|
24144
24195
|
enforceOrder(startLoc, modifier, "in", "out");
|
|
@@ -24195,8 +24246,10 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
24195
24246
|
return result;
|
|
24196
24247
|
}
|
|
24197
24248
|
tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {
|
|
24198
|
-
if (!skipFirstToken)
|
|
24199
|
-
|
|
24249
|
+
if (!skipFirstToken) {
|
|
24250
|
+
if (bracket) this.expect(0);
|
|
24251
|
+
else this.expect(43);
|
|
24252
|
+
}
|
|
24200
24253
|
const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);
|
|
24201
24254
|
if (bracket) this.expect(1);
|
|
24202
24255
|
else this.expect(44);
|
|
@@ -24250,13 +24303,14 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
24250
24303
|
}
|
|
24251
24304
|
tsParseEntityName(flags) {
|
|
24252
24305
|
let entity;
|
|
24253
|
-
if (flags & 1 && this.match(74))
|
|
24254
|
-
|
|
24255
|
-
|
|
24256
|
-
|
|
24257
|
-
|
|
24258
|
-
|
|
24259
|
-
|
|
24306
|
+
if (flags & 1 && this.match(74)) {
|
|
24307
|
+
if (flags & 2) entity = this.parseIdentifier(true);
|
|
24308
|
+
else {
|
|
24309
|
+
const node = this.startNode();
|
|
24310
|
+
this.next();
|
|
24311
|
+
entity = this.finishNode(node, "ThisExpression");
|
|
24312
|
+
}
|
|
24313
|
+
} else entity = this.parseIdentifier(!!(flags & 1));
|
|
24260
24314
|
while (this.eat(12)) {
|
|
24261
24315
|
const node = this.startNodeAtNode(entity);
|
|
24262
24316
|
node.left = entity;
|
|
@@ -25155,9 +25209,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
25155
25209
|
return this.tsParseNamespaceDeclaration(node);
|
|
25156
25210
|
}
|
|
25157
25211
|
break;
|
|
25158
|
-
case 126:
|
|
25159
|
-
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) return this.tsParseTypeAliasDeclaration(node);
|
|
25160
|
-
break;
|
|
25212
|
+
case 126: if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) return this.tsParseTypeAliasDeclaration(node);
|
|
25161
25213
|
}
|
|
25162
25214
|
}
|
|
25163
25215
|
tsCheckLineTerminator(next) {
|
|
@@ -25544,14 +25596,12 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
25544
25596
|
return this.tsParseDeclaration(node, 124, false, decorators);
|
|
25545
25597
|
}
|
|
25546
25598
|
break;
|
|
25547
|
-
case 126:
|
|
25548
|
-
|
|
25549
|
-
|
|
25550
|
-
|
|
25551
|
-
|
|
25552
|
-
|
|
25553
|
-
}
|
|
25554
|
-
break;
|
|
25599
|
+
case 126: if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
25600
|
+
const node = this.startNode();
|
|
25601
|
+
if (!allowDeclaration) this.raise(TSErrors.UnexpectedTypeDeclaration, node, "type");
|
|
25602
|
+
this.next();
|
|
25603
|
+
return this.tsParseTypeAliasDeclaration(node);
|
|
25604
|
+
}
|
|
25555
25605
|
}
|
|
25556
25606
|
return super.parseStatementContent(flags, decorators);
|
|
25557
25607
|
}
|
|
@@ -26053,11 +26103,13 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
26053
26103
|
if (this.match(76)) {
|
|
26054
26104
|
node.abstract = true;
|
|
26055
26105
|
return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
|
|
26056
|
-
} else if (this.isContextual(125))
|
|
26057
|
-
|
|
26058
|
-
|
|
26059
|
-
|
|
26060
|
-
|
|
26106
|
+
} else if (this.isContextual(125)) {
|
|
26107
|
+
if (!this.hasFollowingLineBreak()) {
|
|
26108
|
+
node.abstract = true;
|
|
26109
|
+
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
|
|
26110
|
+
return this.tsParseInterfaceDeclaration(node);
|
|
26111
|
+
} else return null;
|
|
26112
|
+
}
|
|
26061
26113
|
throw this.unexpected(null, 76);
|
|
26062
26114
|
}
|
|
26063
26115
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
@@ -26394,13 +26446,14 @@ const placeholders = (superClass) => class PlaceholdersParserMixin extends super
|
|
|
26394
26446
|
this.next();
|
|
26395
26447
|
const oldStrict = this.state.strict;
|
|
26396
26448
|
const placeholder = this.parsePlaceholder("Identifier");
|
|
26397
|
-
if (placeholder)
|
|
26398
|
-
|
|
26399
|
-
|
|
26400
|
-
|
|
26401
|
-
|
|
26402
|
-
|
|
26403
|
-
|
|
26449
|
+
if (placeholder) {
|
|
26450
|
+
if (this.match(77) || this.match(129) || this.match(2)) node.id = placeholder;
|
|
26451
|
+
else if (optionalId || !isStatement) {
|
|
26452
|
+
node.id = null;
|
|
26453
|
+
node.body = this.finishPlaceholder(placeholder, "ClassBody");
|
|
26454
|
+
return this.finishNode(node, type);
|
|
26455
|
+
} else throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc);
|
|
26456
|
+
} else this.parseClassId(node, isStatement, optionalId);
|
|
26404
26457
|
super.parseClassSuper(node);
|
|
26405
26458
|
node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict);
|
|
26406
26459
|
return this.finishNode(node, type);
|
|
@@ -26755,7 +26808,7 @@ function hasMoreVlq(reader, max) {
|
|
|
26755
26808
|
if (reader.pos >= max) return false;
|
|
26756
26809
|
return reader.peek() !== comma;
|
|
26757
26810
|
}
|
|
26758
|
-
var bufLength =
|
|
26811
|
+
var bufLength = 16384;
|
|
26759
26812
|
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
|
|
26760
26813
|
return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
|
|
26761
26814
|
} } : { decode(buf) {
|
|
@@ -27597,22 +27650,24 @@ var SourceMap$1 = class {
|
|
|
27597
27650
|
mark(generated, generatedIdentifierName, line, column, identifierName, identifierNamePos, filename) {
|
|
27598
27651
|
this._rawMappings = void 0;
|
|
27599
27652
|
let originalMapping;
|
|
27600
|
-
if (line != null)
|
|
27601
|
-
|
|
27653
|
+
if (line != null) {
|
|
27654
|
+
if (this._inputMap) {
|
|
27655
|
+
originalMapping = originalPositionFor(this._inputMap, {
|
|
27656
|
+
line,
|
|
27657
|
+
column
|
|
27658
|
+
});
|
|
27659
|
+
if (originalMapping.name && (identifierNamePos || identifierName != null && originalMapping.column === column)) identifierName = originalMapping.name;
|
|
27660
|
+
else if (identifierNamePos) {
|
|
27661
|
+
const originalIdentifierMapping = originalPositionFor(this._inputMap, identifierNamePos);
|
|
27662
|
+
if (originalIdentifierMapping.name) identifierName = originalIdentifierMapping.name;
|
|
27663
|
+
}
|
|
27664
|
+
} else originalMapping = {
|
|
27665
|
+
name: null,
|
|
27666
|
+
source: filename?.replace(/\\/g, "/") || this._sourceFileName,
|
|
27602
27667
|
line,
|
|
27603
27668
|
column
|
|
27604
|
-
}
|
|
27605
|
-
|
|
27606
|
-
else if (identifierNamePos) {
|
|
27607
|
-
const originalIdentifierMapping = originalPositionFor(this._inputMap, identifierNamePos);
|
|
27608
|
-
if (originalIdentifierMapping.name) identifierName = originalIdentifierMapping.name;
|
|
27609
|
-
}
|
|
27610
|
-
} else originalMapping = {
|
|
27611
|
-
name: null,
|
|
27612
|
-
source: filename?.replace(/\\/g, "/") || this._sourceFileName,
|
|
27613
|
-
line,
|
|
27614
|
-
column
|
|
27615
|
-
};
|
|
27669
|
+
};
|
|
27670
|
+
}
|
|
27616
27671
|
if (identifierName != null && identifierName === generatedIdentifierName) identifierName = null;
|
|
27617
27672
|
maybeAddMapping(this._map, {
|
|
27618
27673
|
name: identifierName,
|
|
@@ -31269,11 +31324,13 @@ var Printer = class {
|
|
|
31269
31324
|
let oldNoLineTerminatorAfterNode;
|
|
31270
31325
|
if (!shouldPrintParens) {
|
|
31271
31326
|
noLineTerminatorAfter || (noLineTerminatorAfter = !!parent && this._noLineTerminatorAfterNode === parent && isLastChild(parent, node));
|
|
31272
|
-
if (noLineTerminatorAfter)
|
|
31273
|
-
if (
|
|
31274
|
-
|
|
31275
|
-
|
|
31276
|
-
|
|
31327
|
+
if (noLineTerminatorAfter) {
|
|
31328
|
+
if (node.trailingComments?.some(commentIsNewline)) {
|
|
31329
|
+
if (isExpression$4(node)) shouldPrintParens = true;
|
|
31330
|
+
} else {
|
|
31331
|
+
oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
|
|
31332
|
+
this._noLineTerminatorAfterNode = node;
|
|
31333
|
+
}
|
|
31277
31334
|
}
|
|
31278
31335
|
}
|
|
31279
31336
|
if (shouldPrintParens) {
|
|
@@ -31351,17 +31408,19 @@ var Printer = class {
|
|
|
31351
31408
|
if (i < len - 1) separator.call(this, i, false);
|
|
31352
31409
|
else if (printTrailingSeparator) separator.call(this, i, true);
|
|
31353
31410
|
}
|
|
31354
|
-
if (statement)
|
|
31355
|
-
|
|
31356
|
-
|
|
31357
|
-
|
|
31358
|
-
|
|
31359
|
-
|
|
31360
|
-
|
|
31361
|
-
|
|
31411
|
+
if (statement) {
|
|
31412
|
+
if (i + 1 === len) this.newline(1, flags);
|
|
31413
|
+
else {
|
|
31414
|
+
const lastCommentLine = this._lastCommentLine;
|
|
31415
|
+
if (lastCommentLine > 0) {
|
|
31416
|
+
const offset = (nodes[i + 1].loc?.start.line || 0) - lastCommentLine;
|
|
31417
|
+
if (offset >= 0) {
|
|
31418
|
+
this.newline(offset || 1, flags);
|
|
31419
|
+
continue;
|
|
31420
|
+
}
|
|
31362
31421
|
}
|
|
31422
|
+
this.newline(1, flags);
|
|
31363
31423
|
}
|
|
31364
|
-
this.newline(1, flags);
|
|
31365
31424
|
}
|
|
31366
31425
|
}
|
|
31367
31426
|
if (indent) this.dedent(flags);
|
|
@@ -31830,10 +31889,11 @@ function applyReplacement(placeholder, ast, replacement) {
|
|
|
31830
31889
|
set(parent, key, replacement);
|
|
31831
31890
|
} else {
|
|
31832
31891
|
const items = parent[key].slice();
|
|
31833
|
-
if (placeholder.type === "statement" || placeholder.type === "param")
|
|
31834
|
-
|
|
31835
|
-
|
|
31836
|
-
|
|
31892
|
+
if (placeholder.type === "statement" || placeholder.type === "param") {
|
|
31893
|
+
if (replacement == null) items.splice(index, 1);
|
|
31894
|
+
else if (Array.isArray(replacement)) items.splice(index, 1, ...replacement);
|
|
31895
|
+
else set(items, index, replacement);
|
|
31896
|
+
} else set(items, index, replacement);
|
|
31837
31897
|
validate$2(parent, key, items);
|
|
31838
31898
|
parent[key] = items;
|
|
31839
31899
|
}
|
|
@@ -31994,8 +32054,10 @@ var TraversalContext = class {
|
|
|
31994
32054
|
this.opts = opts;
|
|
31995
32055
|
}
|
|
31996
32056
|
maybeQueue(path, notPriority) {
|
|
31997
|
-
if (this.queue)
|
|
31998
|
-
|
|
32057
|
+
if (this.queue) {
|
|
32058
|
+
if (notPriority) this.queue.push(path);
|
|
32059
|
+
else this.priorityQueue.push(path);
|
|
32060
|
+
}
|
|
31999
32061
|
}
|
|
32000
32062
|
};
|
|
32001
32063
|
const { VISITOR_KEYS: VISITOR_KEYS$4 } = lib_exports;
|
|
@@ -32651,7 +32713,6 @@ function gatherNodeParts(node, parts) {
|
|
|
32651
32713
|
case "JSXNamespacedName":
|
|
32652
32714
|
gatherNodeParts(node.namespace, parts);
|
|
32653
32715
|
gatherNodeParts(node.name, parts);
|
|
32654
|
-
break;
|
|
32655
32716
|
}
|
|
32656
32717
|
}
|
|
32657
32718
|
function resetScope(scope) {
|
|
@@ -33123,9 +33184,10 @@ var Scope = class Scope {
|
|
|
33123
33184
|
let previousPath;
|
|
33124
33185
|
do {
|
|
33125
33186
|
const binding = scope.getOwnBinding(name);
|
|
33126
|
-
if (binding)
|
|
33127
|
-
|
|
33128
|
-
|
|
33187
|
+
if (binding) {
|
|
33188
|
+
if (previousPath?.isPattern() && binding.kind !== "param" && binding.kind !== "local");
|
|
33189
|
+
else return binding;
|
|
33190
|
+
} else if (!binding && name === "arguments" && scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) break;
|
|
33129
33191
|
previousPath = scope.path;
|
|
33130
33192
|
} while (scope = scope.parent);
|
|
33131
33193
|
}
|
|
@@ -33281,9 +33343,10 @@ function getDeepestCommonAncestorFrom(paths, filter) {
|
|
|
33281
33343
|
lastCommonIndex = i;
|
|
33282
33344
|
lastCommon = shouldMatch;
|
|
33283
33345
|
}
|
|
33284
|
-
if (lastCommon)
|
|
33285
|
-
|
|
33286
|
-
|
|
33346
|
+
if (lastCommon) {
|
|
33347
|
+
if (filter) return filter(lastCommon, lastCommonIndex, ancestries);
|
|
33348
|
+
else return lastCommon;
|
|
33349
|
+
} else throw new Error("Couldn't find intersection");
|
|
33287
33350
|
}
|
|
33288
33351
|
function getAncestry() {
|
|
33289
33352
|
let path = this;
|
|
@@ -33316,8 +33379,10 @@ const { BOOLEAN_NUMBER_BINARY_OPERATORS, createTypeAnnotationBasedOnTypeof, numb
|
|
|
33316
33379
|
function infererReference(node) {
|
|
33317
33380
|
if (!this.isReferenced()) return;
|
|
33318
33381
|
const binding = this.scope.getBinding(node.name);
|
|
33319
|
-
if (binding)
|
|
33320
|
-
|
|
33382
|
+
if (binding) {
|
|
33383
|
+
if (binding.identifier.typeAnnotation) return binding.identifier.typeAnnotation;
|
|
33384
|
+
else return getTypeAnnotationBindingConstantViolations(binding, this, node.name);
|
|
33385
|
+
}
|
|
33321
33386
|
if (node.name === "undefined") return voidTypeAnnotation$2();
|
|
33322
33387
|
else if (node.name === "NaN" || node.name === "Infinity") return numberTypeAnnotation$1();
|
|
33323
33388
|
else if (node.name === "arguments");
|
|
@@ -33521,9 +33586,10 @@ function resolveCall(callee) {
|
|
|
33521
33586
|
callee = callee.resolve();
|
|
33522
33587
|
if (callee.isFunction()) {
|
|
33523
33588
|
const { node } = callee;
|
|
33524
|
-
if (node.async)
|
|
33525
|
-
|
|
33526
|
-
|
|
33589
|
+
if (node.async) {
|
|
33590
|
+
if (node.generator) return genericTypeAnnotation(identifier$2("AsyncIterator"));
|
|
33591
|
+
else return genericTypeAnnotation(identifier$2("Promise"));
|
|
33592
|
+
} else if (node.generator) return genericTypeAnnotation(identifier$2("Iterator"));
|
|
33527
33593
|
else if (callee.node.returnType) return callee.node.returnType;
|
|
33528
33594
|
}
|
|
33529
33595
|
}
|
|
@@ -33572,13 +33638,15 @@ function getTypeAnnotation() {
|
|
|
33572
33638
|
const typeAnnotationInferringNodes = /* @__PURE__ */ new WeakSet();
|
|
33573
33639
|
function _getTypeAnnotation() {
|
|
33574
33640
|
const node = this.node;
|
|
33575
|
-
if (!node)
|
|
33576
|
-
|
|
33577
|
-
|
|
33578
|
-
|
|
33579
|
-
|
|
33580
|
-
|
|
33581
|
-
|
|
33641
|
+
if (!node) {
|
|
33642
|
+
if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
|
|
33643
|
+
const declar = this.parentPath.parentPath;
|
|
33644
|
+
const declarParent = declar.parentPath;
|
|
33645
|
+
if (declar.key === "left" && declarParent.isForInStatement()) return stringTypeAnnotation();
|
|
33646
|
+
if (declar.key === "left" && declarParent.isForOfStatement()) return anyTypeAnnotation();
|
|
33647
|
+
return voidTypeAnnotation();
|
|
33648
|
+
} else return;
|
|
33649
|
+
}
|
|
33582
33650
|
if (node.typeAnnotation) return node.typeAnnotation;
|
|
33583
33651
|
if (typeAnnotationInferringNodes.has(node)) return;
|
|
33584
33652
|
typeAnnotationInferringNodes.add(node);
|
|
@@ -33984,13 +34052,14 @@ function gatherSequenceExpressions(nodes, declars) {
|
|
|
33984
34052
|
}
|
|
33985
34053
|
function replaceInline(nodes) {
|
|
33986
34054
|
resync.call(this);
|
|
33987
|
-
if (Array.isArray(nodes))
|
|
33988
|
-
|
|
33989
|
-
|
|
33990
|
-
|
|
33991
|
-
|
|
33992
|
-
|
|
33993
|
-
|
|
34055
|
+
if (Array.isArray(nodes)) {
|
|
34056
|
+
if (Array.isArray(this.container)) {
|
|
34057
|
+
nodes = _verifyNodeList.call(this, nodes);
|
|
34058
|
+
const paths = _containerInsertAfter.call(this, nodes);
|
|
34059
|
+
this.remove();
|
|
34060
|
+
return paths;
|
|
34061
|
+
} else return this.replaceWithMultiple(nodes);
|
|
34062
|
+
} else return this.replaceWith(nodes);
|
|
33994
34063
|
}
|
|
33995
34064
|
const VALID_OBJECT_CALLEES = [
|
|
33996
34065
|
"Number",
|
|
@@ -34367,11 +34436,13 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
|
|
|
34367
34436
|
return p.isFunction() || p.isProgram() || p.isClassProperty({ static: false }) || p.isClassPrivateProperty({ static: false });
|
|
34368
34437
|
});
|
|
34369
34438
|
const inConstructor = thisEnvFn.isClassMethod({ kind: "constructor" });
|
|
34370
|
-
if (thisEnvFn.isClassProperty() || thisEnvFn.isClassPrivateProperty())
|
|
34371
|
-
|
|
34372
|
-
|
|
34373
|
-
|
|
34374
|
-
|
|
34439
|
+
if (thisEnvFn.isClassProperty() || thisEnvFn.isClassPrivateProperty()) {
|
|
34440
|
+
if (arrowParent) thisEnvFn = arrowParent;
|
|
34441
|
+
else if (allowInsertArrow) {
|
|
34442
|
+
thisEnvFn = fnPath.replaceWith(callExpression(arrowFunctionExpression([], toExpression(fnPath.node)), []))[0].get("callee");
|
|
34443
|
+
fnPath = thisEnvFn.get("body");
|
|
34444
|
+
} else throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property");
|
|
34445
|
+
}
|
|
34375
34446
|
const { thisPaths, argumentsPaths, newTargetPaths, superProps, superCalls } = getScopeInformation(fnPath);
|
|
34376
34447
|
if (inConstructor && superCalls.length > 0) {
|
|
34377
34448
|
if (!allowInsertArrow) throw superCalls[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', it's not possible to compile `super()` in an arrow function without compiling classes.\nPlease add '@babel/plugin-transform-classes' to your Babel configuration.");
|
|
@@ -34982,8 +35053,10 @@ function normalCompletionToBreak(completions) {
|
|
|
34982
35053
|
}
|
|
34983
35054
|
function replaceBreakStatementInBreakCompletion(completions, reachable) {
|
|
34984
35055
|
completions.forEach((c) => {
|
|
34985
|
-
if (c.path.isBreakStatement({ label: null }))
|
|
34986
|
-
|
|
35056
|
+
if (c.path.isBreakStatement({ label: null })) {
|
|
35057
|
+
if (reachable) c.path.replaceWith(buildUndefinedNode());
|
|
35058
|
+
else c.path.remove();
|
|
35059
|
+
}
|
|
34987
35060
|
});
|
|
34988
35061
|
}
|
|
34989
35062
|
function getStatementListCompletion(paths, context) {
|
|
@@ -35623,9 +35696,10 @@ function createNameMatcher(list, { exact = false } = {}) {
|
|
|
35623
35696
|
const exactStrings = exact ? /* @__PURE__ */ new Set() : void 0;
|
|
35624
35697
|
const fuzzyStrings = [];
|
|
35625
35698
|
const regexList = [];
|
|
35626
|
-
for (const item of list) if (typeof item === "string")
|
|
35627
|
-
|
|
35628
|
-
|
|
35699
|
+
for (const item of list) if (typeof item === "string") {
|
|
35700
|
+
if (exact) exactStrings.add(item);
|
|
35701
|
+
else fuzzyStrings.push(item);
|
|
35702
|
+
} else regexList.push(normaliseRegex(item));
|
|
35629
35703
|
if (exact) {
|
|
35630
35704
|
const exactStringCount = exactStrings?.size ?? 0;
|
|
35631
35705
|
if (exactStringCount === 1 && regexList.length === 0) {
|
|
@@ -35698,7 +35772,7 @@ function babelParse(code, opts = {}) {
|
|
|
35698
35772
|
return result;
|
|
35699
35773
|
}
|
|
35700
35774
|
//#endregion
|
|
35701
|
-
//#region ../../node_modules/.pnpm/magic-string@1.
|
|
35775
|
+
//#region ../../node_modules/.pnpm/magic-string@1.1.0/node_modules/magic-string/dist/index.mjs
|
|
35702
35776
|
var BitSet = class BitSet {
|
|
35703
35777
|
constructor(arg) {
|
|
35704
35778
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -35809,10 +35883,8 @@ var Chunk = class Chunk {
|
|
|
35809
35883
|
if (this.outro.length) return true;
|
|
35810
35884
|
const trimmed = this.content.replace(rx, "");
|
|
35811
35885
|
if (trimmed.length) {
|
|
35812
|
-
if (trimmed !== this.content)
|
|
35813
|
-
|
|
35814
|
-
if (this.edited) this.edit(trimmed, this.storeName, true);
|
|
35815
|
-
}
|
|
35886
|
+
if (trimmed !== this.content) if (this.edited) this.edit(trimmed, this.storeName, true);
|
|
35887
|
+
else this.split(this.start + trimmed.length).edit("", void 0, true);
|
|
35816
35888
|
return true;
|
|
35817
35889
|
} else {
|
|
35818
35890
|
this.edit("", void 0, true);
|
|
@@ -35825,9 +35897,9 @@ var Chunk = class Chunk {
|
|
|
35825
35897
|
if (this.intro.length) return true;
|
|
35826
35898
|
const trimmed = this.content.replace(rx, "");
|
|
35827
35899
|
if (trimmed.length) {
|
|
35828
|
-
if (trimmed !== this.content)
|
|
35829
|
-
|
|
35830
|
-
|
|
35900
|
+
if (trimmed !== this.content) if (this.edited) this.edit(trimmed, this.storeName, true);
|
|
35901
|
+
else {
|
|
35902
|
+
this.split(this.end - trimmed.length);
|
|
35831
35903
|
this.edit("", void 0, true);
|
|
35832
35904
|
}
|
|
35833
35905
|
return true;
|
|
@@ -36095,8 +36167,8 @@ var MagicString = class MagicString {
|
|
|
36095
36167
|
value: options.offset || 0
|
|
36096
36168
|
}
|
|
36097
36169
|
});
|
|
36098
|
-
this.byStart[0
|
|
36099
|
-
this.byEnd[string.length
|
|
36170
|
+
this.byStart = /* @__PURE__ */ new Map([[0, chunk]]);
|
|
36171
|
+
this.byEnd = /* @__PURE__ */ new Map([[string.length, chunk]]);
|
|
36100
36172
|
}
|
|
36101
36173
|
/**
|
|
36102
36174
|
* Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false.
|
|
@@ -36121,7 +36193,7 @@ var MagicString = class MagicString {
|
|
|
36121
36193
|
index = index + this.offset;
|
|
36122
36194
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
36123
36195
|
this._split(index);
|
|
36124
|
-
const chunk = this.byEnd
|
|
36196
|
+
const chunk = this.byEnd.get(index);
|
|
36125
36197
|
if (chunk) chunk.appendLeft(content);
|
|
36126
36198
|
else this.intro += content;
|
|
36127
36199
|
return this;
|
|
@@ -36135,7 +36207,7 @@ var MagicString = class MagicString {
|
|
|
36135
36207
|
index = index + this.offset;
|
|
36136
36208
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
36137
36209
|
this._split(index);
|
|
36138
|
-
const chunk = this.byStart
|
|
36210
|
+
const chunk = this.byStart.get(index);
|
|
36139
36211
|
if (chunk) chunk.appendRight(content);
|
|
36140
36212
|
else this.outro += content;
|
|
36141
36213
|
return this;
|
|
@@ -36151,8 +36223,8 @@ var MagicString = class MagicString {
|
|
|
36151
36223
|
let originalChunk = this.firstChunk;
|
|
36152
36224
|
let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
36153
36225
|
while (originalChunk) {
|
|
36154
|
-
cloned.byStart
|
|
36155
|
-
cloned.byEnd
|
|
36226
|
+
cloned.byStart.set(clonedChunk.start, clonedChunk);
|
|
36227
|
+
cloned.byEnd.set(clonedChunk.end, clonedChunk);
|
|
36156
36228
|
const nextOriginalChunk = originalChunk.next;
|
|
36157
36229
|
const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
|
|
36158
36230
|
if (nextClonedChunk) {
|
|
@@ -36325,11 +36397,11 @@ var MagicString = class MagicString {
|
|
|
36325
36397
|
this._split(start);
|
|
36326
36398
|
this._split(end);
|
|
36327
36399
|
this._split(index);
|
|
36328
|
-
const first = this.byStart
|
|
36329
|
-
const last = this.byEnd
|
|
36400
|
+
const first = this.byStart.get(start);
|
|
36401
|
+
const last = this.byEnd.get(end);
|
|
36330
36402
|
const oldLeft = first.previous;
|
|
36331
36403
|
const oldRight = last.next;
|
|
36332
|
-
const newRight = this.byStart
|
|
36404
|
+
const newRight = this.byStart.get(index);
|
|
36333
36405
|
if (!newRight && last === this.lastChunk) return this;
|
|
36334
36406
|
const newLeft = newRight ? newRight.previous : this.lastChunk;
|
|
36335
36407
|
if (oldLeft) oldLeft.next = oldRight;
|
|
@@ -36401,12 +36473,12 @@ var MagicString = class MagicString {
|
|
|
36401
36473
|
enumerable: true
|
|
36402
36474
|
});
|
|
36403
36475
|
}
|
|
36404
|
-
const first = this.byStart
|
|
36405
|
-
const last = this.byEnd
|
|
36476
|
+
const first = this.byStart.get(start);
|
|
36477
|
+
const last = this.byEnd.get(end);
|
|
36406
36478
|
if (first) {
|
|
36407
36479
|
let chunk = first;
|
|
36408
36480
|
while (chunk !== last) {
|
|
36409
|
-
if (chunk.next !== this.byStart
|
|
36481
|
+
if (chunk.next !== this.byStart.get(chunk.end)) throw new Error("Cannot overwrite across a split point");
|
|
36410
36482
|
chunk = chunk.next;
|
|
36411
36483
|
chunk.edit("", false);
|
|
36412
36484
|
}
|
|
@@ -36433,7 +36505,7 @@ var MagicString = class MagicString {
|
|
|
36433
36505
|
index = index + this.offset;
|
|
36434
36506
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
36435
36507
|
this._split(index);
|
|
36436
|
-
const chunk = this.byEnd
|
|
36508
|
+
const chunk = this.byEnd.get(index);
|
|
36437
36509
|
if (chunk) chunk.prependLeft(content);
|
|
36438
36510
|
else this.intro = content + this.intro;
|
|
36439
36511
|
return this;
|
|
@@ -36445,7 +36517,7 @@ var MagicString = class MagicString {
|
|
|
36445
36517
|
index = index + this.offset;
|
|
36446
36518
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
36447
36519
|
this._split(index);
|
|
36448
|
-
const chunk = this.byStart
|
|
36520
|
+
const chunk = this.byStart.get(index);
|
|
36449
36521
|
if (chunk) chunk.prependRight(content);
|
|
36450
36522
|
else this.outro = content + this.outro;
|
|
36451
36523
|
return this;
|
|
@@ -36466,12 +36538,12 @@ var MagicString = class MagicString {
|
|
|
36466
36538
|
if (start > end) throw new Error("end must be greater than start");
|
|
36467
36539
|
this._split(start);
|
|
36468
36540
|
this._split(end);
|
|
36469
|
-
let chunk = this.byStart
|
|
36541
|
+
let chunk = this.byStart.get(start);
|
|
36470
36542
|
while (chunk) {
|
|
36471
36543
|
chunk.intro = "";
|
|
36472
36544
|
chunk.outro = "";
|
|
36473
36545
|
chunk.edit("");
|
|
36474
|
-
chunk = end > chunk.end ? this.byStart
|
|
36546
|
+
chunk = end > chunk.end ? this.byStart.get(chunk.end) : null;
|
|
36475
36547
|
}
|
|
36476
36548
|
return this;
|
|
36477
36549
|
}
|
|
@@ -36490,10 +36562,10 @@ var MagicString = class MagicString {
|
|
|
36490
36562
|
if (start > end) throw new Error("end must be greater than start");
|
|
36491
36563
|
this._split(start);
|
|
36492
36564
|
this._split(end);
|
|
36493
|
-
let chunk = this.byStart
|
|
36565
|
+
let chunk = this.byStart.get(start);
|
|
36494
36566
|
while (chunk) {
|
|
36495
36567
|
chunk.reset();
|
|
36496
|
-
chunk = end > chunk.end ? this.byStart
|
|
36568
|
+
chunk = end > chunk.end ? this.byStart.get(chunk.end) : null;
|
|
36497
36569
|
}
|
|
36498
36570
|
return this;
|
|
36499
36571
|
}
|
|
@@ -36579,13 +36651,13 @@ var MagicString = class MagicString {
|
|
|
36579
36651
|
}
|
|
36580
36652
|
/** @internal */
|
|
36581
36653
|
_split(index) {
|
|
36582
|
-
if (this.byStart
|
|
36654
|
+
if (this.byStart.get(index) || this.byEnd.get(index)) return;
|
|
36583
36655
|
let chunk = this.lastSearchedChunk;
|
|
36584
36656
|
let previousChunk = chunk;
|
|
36585
36657
|
const searchForward = index > chunk.end;
|
|
36586
36658
|
while (chunk) {
|
|
36587
36659
|
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
36588
|
-
chunk = searchForward ? this.byStart
|
|
36660
|
+
chunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start);
|
|
36589
36661
|
if (chunk === previousChunk) return;
|
|
36590
36662
|
previousChunk = chunk;
|
|
36591
36663
|
}
|
|
@@ -36597,9 +36669,9 @@ var MagicString = class MagicString {
|
|
|
36597
36669
|
throw new Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`);
|
|
36598
36670
|
}
|
|
36599
36671
|
const newChunk = chunk.split(index);
|
|
36600
|
-
this.byEnd
|
|
36601
|
-
this.byStart
|
|
36602
|
-
this.byEnd
|
|
36672
|
+
this.byEnd.set(index, chunk);
|
|
36673
|
+
this.byStart.set(index, newChunk);
|
|
36674
|
+
this.byEnd.set(newChunk.end, newChunk);
|
|
36603
36675
|
if (chunk === this.lastChunk) this.lastChunk = newChunk;
|
|
36604
36676
|
this.lastSearchedChunk = chunk;
|
|
36605
36677
|
return true;
|
|
@@ -36659,9 +36731,9 @@ var MagicString = class MagicString {
|
|
|
36659
36731
|
const aborted = chunk.trimEnd(rx);
|
|
36660
36732
|
if (chunk.end !== end) {
|
|
36661
36733
|
if (this.lastChunk === chunk) this.lastChunk = chunk.next;
|
|
36662
|
-
this.byEnd
|
|
36663
|
-
this.byStart
|
|
36664
|
-
this.byEnd
|
|
36734
|
+
this.byEnd.set(chunk.end, chunk);
|
|
36735
|
+
this.byStart.set(chunk.next.start, chunk.next);
|
|
36736
|
+
this.byEnd.set(chunk.next.end, chunk.next);
|
|
36665
36737
|
}
|
|
36666
36738
|
if (aborted) return true;
|
|
36667
36739
|
chunk = chunk.previous;
|
|
@@ -36686,9 +36758,9 @@ var MagicString = class MagicString {
|
|
|
36686
36758
|
const aborted = chunk.trimStart(rx);
|
|
36687
36759
|
if (chunk.end !== end) {
|
|
36688
36760
|
if (chunk === this.lastChunk) this.lastChunk = chunk.next;
|
|
36689
|
-
this.byEnd
|
|
36690
|
-
this.byStart
|
|
36691
|
-
this.byEnd
|
|
36761
|
+
this.byEnd.set(chunk.end, chunk);
|
|
36762
|
+
this.byStart.set(chunk.next.start, chunk.next);
|
|
36763
|
+
this.byEnd.set(chunk.next.end, chunk.next);
|
|
36692
36764
|
}
|
|
36693
36765
|
if (aborted) return true;
|
|
36694
36766
|
chunk = chunk.next;
|
|
@@ -37992,7 +38064,7 @@ function analyzeSource(ast, options, handler, collectModuleMetadata = true) {
|
|
|
37992
38064
|
const exportDeclarations = collectModuleMetadata ? /* @__PURE__ */ new Set() : EMPTY_EXPORT_DECLARATIONS;
|
|
37993
38065
|
const requireCallPaths = collectModuleMetadata ? [] : EMPTY_REQUIRE_CALL_PATHS;
|
|
37994
38066
|
const evalHandler = handler ?? getDefaultEvalHandler();
|
|
37995
|
-
|
|
38067
|
+
const traverseOptions = {
|
|
37996
38068
|
StringLiteral: { enter(p) {
|
|
37997
38069
|
if (isEvalPath(p.parentPath)) return;
|
|
37998
38070
|
targetPaths.push(p);
|
|
@@ -38040,7 +38112,10 @@ function analyzeSource(ast, options, handler, collectModuleMetadata = true) {
|
|
|
38040
38112
|
ExportDeclaration: { enter(p) {
|
|
38041
38113
|
exportDeclarations.add(p);
|
|
38042
38114
|
} }
|
|
38043
|
-
} : {}
|
|
38115
|
+
} : {}
|
|
38116
|
+
};
|
|
38117
|
+
traverse(ast, {
|
|
38118
|
+
...traverseOptions,
|
|
38044
38119
|
noScope: !needScope
|
|
38045
38120
|
});
|
|
38046
38121
|
return {
|