@vue/compiler-sfc 3.5.0-alpha.5 → 3.5.0-beta.2
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/compiler-sfc.cjs.js +5 -6
- package/dist/compiler-sfc.d.ts +1 -61
- package/dist/compiler-sfc.esm-browser.js +468 -345
- package/package.json +10 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.5.0-
|
|
2
|
+
* @vue/compiler-sfc v3.5.0-beta.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -44,9 +44,11 @@ const cacheStringFunction = (fn) => {
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
const camelizeRE = /-(\w)/g;
|
|
47
|
-
const camelize = cacheStringFunction(
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const camelize = cacheStringFunction(
|
|
48
|
+
(str) => {
|
|
49
|
+
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
|
50
|
+
}
|
|
51
|
+
);
|
|
50
52
|
const hyphenateRE = /\B([A-Z])/g;
|
|
51
53
|
const hyphenate = cacheStringFunction(
|
|
52
54
|
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
@@ -54,10 +56,12 @@ const hyphenate = cacheStringFunction(
|
|
|
54
56
|
const capitalize$1 = cacheStringFunction((str) => {
|
|
55
57
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
56
58
|
});
|
|
57
|
-
const toHandlerKey = cacheStringFunction(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const toHandlerKey = cacheStringFunction(
|
|
60
|
+
(str) => {
|
|
61
|
+
const s = str ? `on${capitalize$1(str)}` : ``;
|
|
62
|
+
return s;
|
|
63
|
+
}
|
|
64
|
+
);
|
|
61
65
|
const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
|
|
62
66
|
function genPropsAccessExp(name) {
|
|
63
67
|
return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
|
|
@@ -317,36 +321,70 @@ const FRAGMENT = Symbol(`Fragment` );
|
|
|
317
321
|
const TELEPORT = Symbol(`Teleport` );
|
|
318
322
|
const SUSPENSE = Symbol(`Suspense` );
|
|
319
323
|
const KEEP_ALIVE = Symbol(`KeepAlive` );
|
|
320
|
-
const BASE_TRANSITION = Symbol(
|
|
324
|
+
const BASE_TRANSITION = Symbol(
|
|
325
|
+
`BaseTransition`
|
|
326
|
+
);
|
|
321
327
|
const OPEN_BLOCK = Symbol(`openBlock` );
|
|
322
328
|
const CREATE_BLOCK = Symbol(`createBlock` );
|
|
323
|
-
const CREATE_ELEMENT_BLOCK = Symbol(
|
|
329
|
+
const CREATE_ELEMENT_BLOCK = Symbol(
|
|
330
|
+
`createElementBlock`
|
|
331
|
+
);
|
|
324
332
|
const CREATE_VNODE = Symbol(`createVNode` );
|
|
325
|
-
const CREATE_ELEMENT_VNODE = Symbol(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
const
|
|
329
|
-
|
|
333
|
+
const CREATE_ELEMENT_VNODE = Symbol(
|
|
334
|
+
`createElementVNode`
|
|
335
|
+
);
|
|
336
|
+
const CREATE_COMMENT = Symbol(
|
|
337
|
+
`createCommentVNode`
|
|
338
|
+
);
|
|
339
|
+
const CREATE_TEXT = Symbol(
|
|
340
|
+
`createTextVNode`
|
|
341
|
+
);
|
|
342
|
+
const CREATE_STATIC = Symbol(
|
|
343
|
+
`createStaticVNode`
|
|
344
|
+
);
|
|
345
|
+
const RESOLVE_COMPONENT = Symbol(
|
|
346
|
+
`resolveComponent`
|
|
347
|
+
);
|
|
330
348
|
const RESOLVE_DYNAMIC_COMPONENT = Symbol(
|
|
331
349
|
`resolveDynamicComponent`
|
|
332
350
|
);
|
|
333
|
-
const RESOLVE_DIRECTIVE = Symbol(
|
|
334
|
-
|
|
335
|
-
|
|
351
|
+
const RESOLVE_DIRECTIVE = Symbol(
|
|
352
|
+
`resolveDirective`
|
|
353
|
+
);
|
|
354
|
+
const RESOLVE_FILTER = Symbol(
|
|
355
|
+
`resolveFilter`
|
|
356
|
+
);
|
|
357
|
+
const WITH_DIRECTIVES = Symbol(
|
|
358
|
+
`withDirectives`
|
|
359
|
+
);
|
|
336
360
|
const RENDER_LIST = Symbol(`renderList` );
|
|
337
361
|
const RENDER_SLOT = Symbol(`renderSlot` );
|
|
338
362
|
const CREATE_SLOTS = Symbol(`createSlots` );
|
|
339
|
-
const TO_DISPLAY_STRING = Symbol(
|
|
363
|
+
const TO_DISPLAY_STRING = Symbol(
|
|
364
|
+
`toDisplayString`
|
|
365
|
+
);
|
|
340
366
|
const MERGE_PROPS = Symbol(`mergeProps` );
|
|
341
|
-
const NORMALIZE_CLASS = Symbol(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const
|
|
367
|
+
const NORMALIZE_CLASS = Symbol(
|
|
368
|
+
`normalizeClass`
|
|
369
|
+
);
|
|
370
|
+
const NORMALIZE_STYLE = Symbol(
|
|
371
|
+
`normalizeStyle`
|
|
372
|
+
);
|
|
373
|
+
const NORMALIZE_PROPS = Symbol(
|
|
374
|
+
`normalizeProps`
|
|
375
|
+
);
|
|
376
|
+
const GUARD_REACTIVE_PROPS = Symbol(
|
|
377
|
+
`guardReactiveProps`
|
|
378
|
+
);
|
|
345
379
|
const TO_HANDLERS = Symbol(`toHandlers` );
|
|
346
380
|
const CAMELIZE = Symbol(`camelize` );
|
|
347
381
|
const CAPITALIZE = Symbol(`capitalize` );
|
|
348
|
-
const TO_HANDLER_KEY = Symbol(
|
|
349
|
-
|
|
382
|
+
const TO_HANDLER_KEY = Symbol(
|
|
383
|
+
`toHandlerKey`
|
|
384
|
+
);
|
|
385
|
+
const SET_BLOCK_TRACKING = Symbol(
|
|
386
|
+
`setBlockTracking`
|
|
387
|
+
);
|
|
350
388
|
const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
|
|
351
389
|
const POP_SCOPE_ID = Symbol(`popScopeId` );
|
|
352
390
|
const WITH_CTX = Symbol(`withCtx` );
|
|
@@ -2376,17 +2414,14 @@ var lib = {};
|
|
|
2376
2414
|
Object.defineProperty(lib, '__esModule', {
|
|
2377
2415
|
value: true
|
|
2378
2416
|
});
|
|
2379
|
-
function _objectWithoutPropertiesLoose(
|
|
2380
|
-
if (
|
|
2381
|
-
var
|
|
2382
|
-
var
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
target[key] = source[key];
|
|
2388
|
-
}
|
|
2389
|
-
return target;
|
|
2417
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
2418
|
+
if (null == r) return {};
|
|
2419
|
+
var t = {};
|
|
2420
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
2421
|
+
if (e.includes(n)) continue;
|
|
2422
|
+
t[n] = r[n];
|
|
2423
|
+
}
|
|
2424
|
+
return t;
|
|
2390
2425
|
}
|
|
2391
2426
|
class Position {
|
|
2392
2427
|
constructor(line, col, index) {
|
|
@@ -2706,8 +2741,7 @@ var PipelineOperatorErrors = {
|
|
|
2706
2741
|
PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
|
|
2707
2742
|
PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
|
|
2708
2743
|
};
|
|
2709
|
-
const _excluded = ["
|
|
2710
|
-
_excluded2 = ["message"];
|
|
2744
|
+
const _excluded = ["message"];
|
|
2711
2745
|
function defineHidden(obj, key, value) {
|
|
2712
2746
|
Object.defineProperty(obj, key, {
|
|
2713
2747
|
enumerable: false,
|
|
@@ -2715,21 +2749,22 @@ function defineHidden(obj, key, value) {
|
|
|
2715
2749
|
value
|
|
2716
2750
|
});
|
|
2717
2751
|
}
|
|
2718
|
-
function toParseErrorConstructor(
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2752
|
+
function toParseErrorConstructor({
|
|
2753
|
+
toMessage,
|
|
2754
|
+
code,
|
|
2755
|
+
reasonCode,
|
|
2756
|
+
syntaxPlugin
|
|
2757
|
+
}) {
|
|
2758
|
+
const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins";
|
|
2723
2759
|
return function constructor(loc, details) {
|
|
2724
2760
|
const error = new SyntaxError();
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
});
|
|
2761
|
+
error.code = code;
|
|
2762
|
+
error.reasonCode = reasonCode;
|
|
2763
|
+
error.loc = loc;
|
|
2764
|
+
error.pos = loc.index;
|
|
2765
|
+
error.syntaxPlugin = syntaxPlugin;
|
|
2766
|
+
if (hasMissingPlugin) {
|
|
2767
|
+
error.missingPlugin = details.missingPlugin;
|
|
2733
2768
|
}
|
|
2734
2769
|
defineHidden(error, "clone", function clone(overrides = {}) {
|
|
2735
2770
|
var _overrides$loc;
|
|
@@ -2765,15 +2800,15 @@ function ParseErrorEnum(argument, syntaxPlugin) {
|
|
|
2765
2800
|
const ParseErrorConstructors = {};
|
|
2766
2801
|
for (const reasonCode of Object.keys(argument)) {
|
|
2767
2802
|
const template = argument[reasonCode];
|
|
2768
|
-
const
|
|
2803
|
+
const _ref = typeof template === "string" ? {
|
|
2769
2804
|
message: () => template
|
|
2770
2805
|
} : typeof template === "function" ? {
|
|
2771
2806
|
message: template
|
|
2772
2807
|
} : template,
|
|
2773
2808
|
{
|
|
2774
2809
|
message
|
|
2775
|
-
} =
|
|
2776
|
-
rest = _objectWithoutPropertiesLoose(
|
|
2810
|
+
} = _ref,
|
|
2811
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2777
2812
|
const toMessage = typeof message === "string" ? () => message : message;
|
|
2778
2813
|
ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
|
|
2779
2814
|
code: "BABEL_PARSER_SYNTAX_ERROR",
|
|
@@ -2789,13 +2824,17 @@ const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(St
|
|
|
2789
2824
|
const {
|
|
2790
2825
|
defineProperty
|
|
2791
2826
|
} = Object;
|
|
2792
|
-
const toUnenumerable = (object, key) =>
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2827
|
+
const toUnenumerable = (object, key) => {
|
|
2828
|
+
if (object) {
|
|
2829
|
+
defineProperty(object, key, {
|
|
2830
|
+
enumerable: false,
|
|
2831
|
+
value: object[key]
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
};
|
|
2796
2835
|
function toESTreeLocation(node) {
|
|
2797
|
-
|
|
2798
|
-
|
|
2836
|
+
toUnenumerable(node.loc.start, "index");
|
|
2837
|
+
toUnenumerable(node.loc.end, "index");
|
|
2799
2838
|
return node;
|
|
2800
2839
|
}
|
|
2801
2840
|
var estree = superClass => class ESTreeParserMixin extends superClass {
|
|
@@ -2813,7 +2852,7 @@ var estree = superClass => class ESTreeParserMixin extends superClass {
|
|
|
2813
2852
|
let regex = null;
|
|
2814
2853
|
try {
|
|
2815
2854
|
regex = new RegExp(pattern, flags);
|
|
2816
|
-
} catch (
|
|
2855
|
+
} catch (_) {}
|
|
2817
2856
|
const node = this.estreeParseLiteral(regex);
|
|
2818
2857
|
node.regex = {
|
|
2819
2858
|
pattern,
|
|
@@ -4159,7 +4198,7 @@ class CommentsParser extends BaseParser {
|
|
|
4159
4198
|
}
|
|
4160
4199
|
}
|
|
4161
4200
|
}
|
|
4162
|
-
const lineBreak = /\r\n
|
|
4201
|
+
const lineBreak = /\r\n|[\r\n\u2028\u2029]/;
|
|
4163
4202
|
const lineBreakG = new RegExp(lineBreak.source, "g");
|
|
4164
4203
|
function isNewLine(code) {
|
|
4165
4204
|
switch (code) {
|
|
@@ -4172,9 +4211,16 @@ function isNewLine(code) {
|
|
|
4172
4211
|
return false;
|
|
4173
4212
|
}
|
|
4174
4213
|
}
|
|
4214
|
+
function hasNewLine(input, start, end) {
|
|
4215
|
+
for (let i = start; i < end; i++) {
|
|
4216
|
+
if (isNewLine(input.charCodeAt(i))) {
|
|
4217
|
+
return true;
|
|
4218
|
+
}
|
|
4219
|
+
}
|
|
4220
|
+
return false;
|
|
4221
|
+
}
|
|
4175
4222
|
const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
4176
4223
|
const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
|
|
4177
|
-
const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y");
|
|
4178
4224
|
function isWhitespace(code) {
|
|
4179
4225
|
switch (code) {
|
|
4180
4226
|
case 0x0009:
|
|
@@ -4316,6 +4362,12 @@ class State {
|
|
|
4316
4362
|
set containsEsc(v) {
|
|
4317
4363
|
if (v) this.flags |= 2048;else this.flags &= -2049;
|
|
4318
4364
|
}
|
|
4365
|
+
get hasTopLevelAwait() {
|
|
4366
|
+
return (this.flags & 4096) > 0;
|
|
4367
|
+
}
|
|
4368
|
+
set hasTopLevelAwait(v) {
|
|
4369
|
+
if (v) this.flags |= 4096;else this.flags &= -4097;
|
|
4370
|
+
}
|
|
4319
4371
|
curPosition() {
|
|
4320
4372
|
return new Position(this.curLine, this.pos - this.lineStart, this.pos);
|
|
4321
4373
|
}
|
|
@@ -4496,7 +4548,7 @@ function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
|
4496
4548
|
default:
|
|
4497
4549
|
if (ch >= 48 && ch <= 55) {
|
|
4498
4550
|
const startPos = pos - 1;
|
|
4499
|
-
const match = input.slice(startPos, pos + 2)
|
|
4551
|
+
const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
|
|
4500
4552
|
let octalStr = match[0];
|
|
4501
4553
|
let octal = parseInt(octalStr, 8);
|
|
4502
4554
|
if (octal > 255) {
|
|
@@ -5869,7 +5921,13 @@ function functionFlags(isAsync, isGenerator) {
|
|
|
5869
5921
|
class UtilParser extends Tokenizer {
|
|
5870
5922
|
addExtra(node, key, value, enumerable = true) {
|
|
5871
5923
|
if (!node) return;
|
|
5872
|
-
|
|
5924
|
+
let {
|
|
5925
|
+
extra
|
|
5926
|
+
} = node;
|
|
5927
|
+
if (extra == null) {
|
|
5928
|
+
extra = {};
|
|
5929
|
+
node.extra = extra;
|
|
5930
|
+
}
|
|
5873
5931
|
if (enumerable) {
|
|
5874
5932
|
extra[key] = value;
|
|
5875
5933
|
} else {
|
|
@@ -5913,11 +5971,10 @@ class UtilParser extends Tokenizer {
|
|
|
5913
5971
|
return this.match(139) || this.match(8) || this.hasPrecedingLineBreak();
|
|
5914
5972
|
}
|
|
5915
5973
|
hasPrecedingLineBreak() {
|
|
5916
|
-
return
|
|
5974
|
+
return hasNewLine(this.input, this.state.lastTokEndLoc.index, this.state.start);
|
|
5917
5975
|
}
|
|
5918
5976
|
hasFollowingLineBreak() {
|
|
5919
|
-
|
|
5920
|
-
return skipWhiteSpaceToLineBreak.test(this.input);
|
|
5977
|
+
return hasNewLine(this.input, this.state.end, this.nextTokenStart());
|
|
5921
5978
|
}
|
|
5922
5979
|
isLineTerminator() {
|
|
5923
5980
|
return this.eat(13) || this.canInsertSemicolon();
|
|
@@ -5927,7 +5984,9 @@ class UtilParser extends Tokenizer {
|
|
|
5927
5984
|
this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc);
|
|
5928
5985
|
}
|
|
5929
5986
|
expect(type, loc) {
|
|
5930
|
-
this.eat(type)
|
|
5987
|
+
if (!this.eat(type)) {
|
|
5988
|
+
this.unexpected(loc, type);
|
|
5989
|
+
}
|
|
5931
5990
|
}
|
|
5932
5991
|
tryParse(fn, oldState = this.state.clone()) {
|
|
5933
5992
|
const abortSignal = {
|
|
@@ -7532,7 +7591,7 @@ var flow = superClass => class FlowParserMixin extends superClass {
|
|
|
7532
7591
|
}
|
|
7533
7592
|
forwardNoArrowParamsConversionAt(node, parse) {
|
|
7534
7593
|
let result;
|
|
7535
|
-
if (this.state.noArrowParamsConversionAt.
|
|
7594
|
+
if (this.state.noArrowParamsConversionAt.includes(node.start)) {
|
|
7536
7595
|
this.state.noArrowParamsConversionAt.push(this.state.start);
|
|
7537
7596
|
result = parse();
|
|
7538
7597
|
this.state.noArrowParamsConversionAt.pop();
|
|
@@ -8042,14 +8101,14 @@ var flow = superClass => class FlowParserMixin extends superClass {
|
|
|
8042
8101
|
return this.match(14) || super.shouldParseArrow(params);
|
|
8043
8102
|
}
|
|
8044
8103
|
setArrowFunctionParameters(node, params) {
|
|
8045
|
-
if (this.state.noArrowParamsConversionAt.
|
|
8104
|
+
if (this.state.noArrowParamsConversionAt.includes(node.start)) {
|
|
8046
8105
|
node.params = params;
|
|
8047
8106
|
} else {
|
|
8048
8107
|
super.setArrowFunctionParameters(node, params);
|
|
8049
8108
|
}
|
|
8050
8109
|
}
|
|
8051
8110
|
checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
|
|
8052
|
-
if (isArrowFunction && this.state.noArrowParamsConversionAt.
|
|
8111
|
+
if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(node.start)) {
|
|
8053
8112
|
return;
|
|
8054
8113
|
}
|
|
8055
8114
|
for (let i = 0; i < node.params.length; i++) {
|
|
@@ -8060,10 +8119,10 @@ var flow = superClass => class FlowParserMixin extends superClass {
|
|
|
8060
8119
|
super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);
|
|
8061
8120
|
}
|
|
8062
8121
|
parseParenAndDistinguishExpression(canBeArrow) {
|
|
8063
|
-
return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.
|
|
8122
|
+
return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.state.start));
|
|
8064
8123
|
}
|
|
8065
8124
|
parseSubscripts(base, startLoc, noCalls) {
|
|
8066
|
-
if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.
|
|
8125
|
+
if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) {
|
|
8067
8126
|
this.next();
|
|
8068
8127
|
const node = this.startNodeAt(startLoc);
|
|
8069
8128
|
node.callee = base;
|
|
@@ -9324,7 +9383,6 @@ class TypeScriptScopeHandler extends ScopeHandler {
|
|
|
9324
9383
|
super.checkLocalExport(id);
|
|
9325
9384
|
}
|
|
9326
9385
|
}
|
|
9327
|
-
const getOwn$1 = (object, key) => hasOwnProperty.call(object, key) && object[key];
|
|
9328
9386
|
const unwrapParenthesizedExpression = node => {
|
|
9329
9387
|
return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
|
|
9330
9388
|
};
|
|
@@ -9583,25 +9641,26 @@ class LValParser extends NodeUtils {
|
|
|
9583
9641
|
return this.finishNode(node, "AssignmentPattern");
|
|
9584
9642
|
}
|
|
9585
9643
|
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9644
|
+
switch (type) {
|
|
9645
|
+
case "AssignmentPattern":
|
|
9646
|
+
return "left";
|
|
9647
|
+
case "RestElement":
|
|
9648
|
+
return "argument";
|
|
9649
|
+
case "ObjectProperty":
|
|
9650
|
+
return "value";
|
|
9651
|
+
case "ParenthesizedExpression":
|
|
9652
|
+
return "expression";
|
|
9653
|
+
case "ArrayPattern":
|
|
9654
|
+
return "elements";
|
|
9655
|
+
case "ObjectPattern":
|
|
9656
|
+
return "properties";
|
|
9657
|
+
}
|
|
9658
|
+
return false;
|
|
9594
9659
|
}
|
|
9595
9660
|
isOptionalMemberExpression(expression) {
|
|
9596
9661
|
return expression.type === "OptionalMemberExpression";
|
|
9597
9662
|
}
|
|
9598
|
-
checkLVal(expression, {
|
|
9599
|
-
in: ancestor,
|
|
9600
|
-
binding = 64,
|
|
9601
|
-
checkClashes = false,
|
|
9602
|
-
strictModeChanged = false,
|
|
9603
|
-
hasParenthesizedAncestor = false
|
|
9604
|
-
}) {
|
|
9663
|
+
checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) {
|
|
9605
9664
|
var _expression$extra;
|
|
9606
9665
|
const type = expression.type;
|
|
9607
9666
|
if (this.isObjectMethod(expression)) return;
|
|
@@ -9643,20 +9702,25 @@ class LValParser extends NodeUtils {
|
|
|
9643
9702
|
});
|
|
9644
9703
|
return;
|
|
9645
9704
|
}
|
|
9646
|
-
|
|
9705
|
+
let key, isParenthesizedExpression;
|
|
9706
|
+
if (typeof validity === "string") {
|
|
9707
|
+
key = validity;
|
|
9708
|
+
isParenthesizedExpression = type === "ParenthesizedExpression";
|
|
9709
|
+
} else {
|
|
9710
|
+
[key, isParenthesizedExpression] = validity;
|
|
9711
|
+
}
|
|
9647
9712
|
const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? {
|
|
9648
9713
|
type
|
|
9649
9714
|
} : ancestor;
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
binding,
|
|
9655
|
-
|
|
9656
|
-
strictModeChanged,
|
|
9657
|
-
hasParenthesizedAncestor: isParenthesizedExpression
|
|
9658
|
-
});
|
|
9715
|
+
const val = expression[key];
|
|
9716
|
+
if (Array.isArray(val)) {
|
|
9717
|
+
for (const child of val) {
|
|
9718
|
+
if (child) {
|
|
9719
|
+
this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
|
|
9720
|
+
}
|
|
9659
9721
|
}
|
|
9722
|
+
} else if (val) {
|
|
9723
|
+
this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
|
|
9660
9724
|
}
|
|
9661
9725
|
}
|
|
9662
9726
|
checkIdentifier(at, bindingType, strictModeChanged = false) {
|
|
@@ -9704,7 +9768,6 @@ class LValParser extends NodeUtils {
|
|
|
9704
9768
|
return true;
|
|
9705
9769
|
}
|
|
9706
9770
|
}
|
|
9707
|
-
const getOwn = (object, key) => hasOwnProperty.call(object, key) && object[key];
|
|
9708
9771
|
function nonNull(x) {
|
|
9709
9772
|
if (x == null) {
|
|
9710
9773
|
throw new Error(`Unexpected ${x} value.`);
|
|
@@ -9878,7 +9941,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9878
9941
|
return undefined;
|
|
9879
9942
|
}
|
|
9880
9943
|
const modifier = this.state.value;
|
|
9881
|
-
if (allowedModifiers.
|
|
9944
|
+
if (allowedModifiers.includes(modifier)) {
|
|
9882
9945
|
if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {
|
|
9883
9946
|
return undefined;
|
|
9884
9947
|
}
|
|
@@ -11887,15 +11950,21 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
11887
11950
|
}
|
|
11888
11951
|
}
|
|
11889
11952
|
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
11890
|
-
|
|
11891
|
-
TSTypeCastExpression:
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11953
|
+
switch (type) {
|
|
11954
|
+
case "TSTypeCastExpression":
|
|
11955
|
+
return true;
|
|
11956
|
+
case "TSParameterProperty":
|
|
11957
|
+
return "parameter";
|
|
11958
|
+
case "TSNonNullExpression":
|
|
11959
|
+
case "TSInstantiationExpression":
|
|
11960
|
+
return "expression";
|
|
11961
|
+
case "TSAsExpression":
|
|
11962
|
+
case "TSSatisfiesExpression":
|
|
11963
|
+
case "TSTypeAssertion":
|
|
11964
|
+
return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true];
|
|
11965
|
+
default:
|
|
11966
|
+
return super.isValidLVal(type, isUnparenthesizedInAssign, binding);
|
|
11967
|
+
}
|
|
11899
11968
|
}
|
|
11900
11969
|
parseBindingAtom() {
|
|
11901
11970
|
if (this.state.type === 78) {
|
|
@@ -12021,12 +12090,17 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
12021
12090
|
return param;
|
|
12022
12091
|
}
|
|
12023
12092
|
tsInAmbientContext(cb) {
|
|
12024
|
-
const
|
|
12093
|
+
const {
|
|
12094
|
+
isAmbientContext: oldIsAmbientContext,
|
|
12095
|
+
strict: oldStrict
|
|
12096
|
+
} = this.state;
|
|
12025
12097
|
this.state.isAmbientContext = true;
|
|
12098
|
+
this.state.strict = false;
|
|
12026
12099
|
try {
|
|
12027
12100
|
return cb();
|
|
12028
12101
|
} finally {
|
|
12029
12102
|
this.state.isAmbientContext = oldIsAmbientContext;
|
|
12103
|
+
this.state.strict = oldStrict;
|
|
12030
12104
|
}
|
|
12031
12105
|
}
|
|
12032
12106
|
parseClass(node, isStatement, optionalId) {
|
|
@@ -12437,107 +12511,71 @@ var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass {
|
|
|
12437
12511
|
return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);
|
|
12438
12512
|
}
|
|
12439
12513
|
};
|
|
12440
|
-
function hasPlugin(plugins, expectedConfig) {
|
|
12441
|
-
const [expectedName, expectedOptions] = typeof expectedConfig === "string" ? [expectedConfig, {}] : expectedConfig;
|
|
12442
|
-
const expectedKeys = Object.keys(expectedOptions);
|
|
12443
|
-
const expectedOptionsIsEmpty = expectedKeys.length === 0;
|
|
12444
|
-
return plugins.some(p => {
|
|
12445
|
-
if (typeof p === "string") {
|
|
12446
|
-
return expectedOptionsIsEmpty && p === expectedName;
|
|
12447
|
-
} else {
|
|
12448
|
-
const [pluginName, pluginOptions] = p;
|
|
12449
|
-
if (pluginName !== expectedName) {
|
|
12450
|
-
return false;
|
|
12451
|
-
}
|
|
12452
|
-
for (const key of expectedKeys) {
|
|
12453
|
-
if (pluginOptions[key] !== expectedOptions[key]) {
|
|
12454
|
-
return false;
|
|
12455
|
-
}
|
|
12456
|
-
}
|
|
12457
|
-
return true;
|
|
12458
|
-
}
|
|
12459
|
-
});
|
|
12460
|
-
}
|
|
12461
|
-
function getPluginOption(plugins, name, option) {
|
|
12462
|
-
const plugin = plugins.find(plugin => {
|
|
12463
|
-
if (Array.isArray(plugin)) {
|
|
12464
|
-
return plugin[0] === name;
|
|
12465
|
-
} else {
|
|
12466
|
-
return plugin === name;
|
|
12467
|
-
}
|
|
12468
|
-
});
|
|
12469
|
-
if (plugin && Array.isArray(plugin) && plugin.length > 1) {
|
|
12470
|
-
return plugin[1][option];
|
|
12471
|
-
}
|
|
12472
|
-
return null;
|
|
12473
|
-
}
|
|
12474
12514
|
const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
|
|
12475
12515
|
const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"];
|
|
12476
|
-
function validatePlugins(
|
|
12477
|
-
if (
|
|
12478
|
-
if (
|
|
12516
|
+
function validatePlugins(pluginsMap) {
|
|
12517
|
+
if (pluginsMap.has("decorators")) {
|
|
12518
|
+
if (pluginsMap.has("decorators-legacy")) {
|
|
12479
12519
|
throw new Error("Cannot use the decorators and decorators-legacy plugin together");
|
|
12480
12520
|
}
|
|
12481
|
-
const decoratorsBeforeExport =
|
|
12521
|
+
const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport;
|
|
12482
12522
|
if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") {
|
|
12483
12523
|
throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");
|
|
12484
12524
|
}
|
|
12485
|
-
const allowCallParenthesized =
|
|
12525
|
+
const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized;
|
|
12486
12526
|
if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") {
|
|
12487
12527
|
throw new Error("'allowCallParenthesized' must be a boolean.");
|
|
12488
12528
|
}
|
|
12489
12529
|
}
|
|
12490
|
-
if (
|
|
12530
|
+
if (pluginsMap.has("flow") && pluginsMap.has("typescript")) {
|
|
12491
12531
|
throw new Error("Cannot combine flow and typescript plugins.");
|
|
12492
12532
|
}
|
|
12493
|
-
if (
|
|
12533
|
+
if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) {
|
|
12494
12534
|
throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
|
|
12495
12535
|
}
|
|
12496
|
-
if (
|
|
12497
|
-
|
|
12536
|
+
if (pluginsMap.has("pipelineOperator")) {
|
|
12537
|
+
var _pluginsMap$get;
|
|
12538
|
+
const proposal = pluginsMap.get("pipelineOperator").proposal;
|
|
12498
12539
|
if (!PIPELINE_PROPOSALS.includes(proposal)) {
|
|
12499
12540
|
const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", ");
|
|
12500
12541
|
throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
|
|
12501
12542
|
}
|
|
12502
|
-
const
|
|
12503
|
-
syntaxType: "hash"
|
|
12504
|
-
}];
|
|
12505
|
-
const tupleSyntaxIsHash = hasPlugin(plugins, recordAndTupleConfigItem);
|
|
12543
|
+
const tupleSyntaxIsHash = ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash";
|
|
12506
12544
|
if (proposal === "hack") {
|
|
12507
|
-
if (
|
|
12545
|
+
if (pluginsMap.has("placeholders")) {
|
|
12508
12546
|
throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
|
|
12509
12547
|
}
|
|
12510
|
-
if (
|
|
12548
|
+
if (pluginsMap.has("v8intrinsic")) {
|
|
12511
12549
|
throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
|
|
12512
12550
|
}
|
|
12513
|
-
const topicToken =
|
|
12551
|
+
const topicToken = pluginsMap.get("pipelineOperator").topicToken;
|
|
12514
12552
|
if (!TOPIC_TOKENS.includes(topicToken)) {
|
|
12515
12553
|
const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", ");
|
|
12516
12554
|
throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
|
|
12517
12555
|
}
|
|
12518
12556
|
if (topicToken === "#" && tupleSyntaxIsHash) {
|
|
12519
|
-
throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(
|
|
12557
|
+
throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
|
|
12520
12558
|
}
|
|
12521
12559
|
} else if (proposal === "smart" && tupleSyntaxIsHash) {
|
|
12522
|
-
throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(
|
|
12560
|
+
throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
|
|
12523
12561
|
}
|
|
12524
12562
|
}
|
|
12525
|
-
if (
|
|
12563
|
+
if (pluginsMap.has("moduleAttributes")) {
|
|
12526
12564
|
{
|
|
12527
|
-
if (
|
|
12565
|
+
if (pluginsMap.has("importAttributes") || pluginsMap.has("importAssertions")) {
|
|
12528
12566
|
throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");
|
|
12529
12567
|
}
|
|
12530
|
-
const moduleAttributesVersionPluginOption =
|
|
12568
|
+
const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version;
|
|
12531
12569
|
if (moduleAttributesVersionPluginOption !== "may-2020") {
|
|
12532
12570
|
throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
|
|
12533
12571
|
}
|
|
12534
12572
|
}
|
|
12535
12573
|
}
|
|
12536
|
-
if (
|
|
12574
|
+
if (pluginsMap.has("importAttributes") && pluginsMap.has("importAssertions")) {
|
|
12537
12575
|
throw new Error("Cannot combine importAssertions and importAttributes plugins.");
|
|
12538
12576
|
}
|
|
12539
|
-
if (
|
|
12540
|
-
const syntaxType =
|
|
12577
|
+
if (pluginsMap.has("recordAndTuple")) {
|
|
12578
|
+
const syntaxType = pluginsMap.get("recordAndTuple").syntaxType;
|
|
12541
12579
|
if (syntaxType != null) {
|
|
12542
12580
|
{
|
|
12543
12581
|
const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
|
|
@@ -12547,12 +12585,12 @@ function validatePlugins(plugins) {
|
|
|
12547
12585
|
}
|
|
12548
12586
|
}
|
|
12549
12587
|
}
|
|
12550
|
-
if (
|
|
12588
|
+
if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) {
|
|
12551
12589
|
const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
|
|
12552
12590
|
error.missingPlugins = "doExpressions";
|
|
12553
12591
|
throw error;
|
|
12554
12592
|
}
|
|
12555
|
-
if (
|
|
12593
|
+
if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") {
|
|
12556
12594
|
throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'.");
|
|
12557
12595
|
}
|
|
12558
12596
|
}
|
|
@@ -12723,9 +12761,7 @@ class ExpressionParser extends LValParser {
|
|
|
12723
12761
|
}
|
|
12724
12762
|
this.next();
|
|
12725
12763
|
node.right = this.parseMaybeAssign();
|
|
12726
|
-
this.checkLVal(left,
|
|
12727
|
-
in: this.finishNode(node, "AssignmentExpression")
|
|
12728
|
-
});
|
|
12764
|
+
this.checkLVal(left, this.finishNode(node, "AssignmentExpression"));
|
|
12729
12765
|
return node;
|
|
12730
12766
|
} else if (ownExpressionErrors) {
|
|
12731
12767
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
@@ -12866,7 +12902,7 @@ class ExpressionParser extends LValParser {
|
|
|
12866
12902
|
parseMaybeUnary(refExpressionErrors, sawUnary) {
|
|
12867
12903
|
const startLoc = this.state.startLoc;
|
|
12868
12904
|
const isAwait = this.isContextual(96);
|
|
12869
|
-
if (isAwait && this.
|
|
12905
|
+
if (isAwait && this.recordAwaitIfAllowed()) {
|
|
12870
12906
|
this.next();
|
|
12871
12907
|
const expr = this.parseAwait(startLoc);
|
|
12872
12908
|
if (!sawUnary) this.checkExponentialAfterUnary(expr);
|
|
@@ -12915,9 +12951,7 @@ class ExpressionParser extends LValParser {
|
|
|
12915
12951
|
parseUpdate(node, update, refExpressionErrors) {
|
|
12916
12952
|
if (update) {
|
|
12917
12953
|
const updateExpressionNode = node;
|
|
12918
|
-
this.checkLVal(updateExpressionNode.argument,
|
|
12919
|
-
in: this.finishNode(updateExpressionNode, "UpdateExpression")
|
|
12920
|
-
});
|
|
12954
|
+
this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression"));
|
|
12921
12955
|
return node;
|
|
12922
12956
|
}
|
|
12923
12957
|
const startLoc = this.state.startLoc;
|
|
@@ -12929,9 +12963,7 @@ class ExpressionParser extends LValParser {
|
|
|
12929
12963
|
node.prefix = false;
|
|
12930
12964
|
node.argument = expr;
|
|
12931
12965
|
this.next();
|
|
12932
|
-
this.checkLVal(expr,
|
|
12933
|
-
in: expr = this.finishNode(node, "UpdateExpression")
|
|
12934
|
-
});
|
|
12966
|
+
this.checkLVal(expr, expr = this.finishNode(node, "UpdateExpression"));
|
|
12935
12967
|
}
|
|
12936
12968
|
return expr;
|
|
12937
12969
|
}
|
|
@@ -13498,10 +13530,12 @@ class ExpressionParser extends LValParser {
|
|
|
13498
13530
|
return this.parseLiteral(value, "DecimalLiteral");
|
|
13499
13531
|
}
|
|
13500
13532
|
parseRegExpLiteral(value) {
|
|
13501
|
-
const node = this.
|
|
13533
|
+
const node = this.startNode();
|
|
13534
|
+
this.addExtra(node, "raw", this.input.slice(node.start, this.state.end));
|
|
13502
13535
|
node.pattern = value.pattern;
|
|
13503
13536
|
node.flags = value.flags;
|
|
13504
|
-
|
|
13537
|
+
this.next();
|
|
13538
|
+
return this.finishNode(node, "RegExpLiteral");
|
|
13505
13539
|
}
|
|
13506
13540
|
parseBooleanLiteral(value) {
|
|
13507
13541
|
const node = this.startNode();
|
|
@@ -14001,12 +14035,7 @@ class ExpressionParser extends LValParser {
|
|
|
14001
14035
|
type: "FormalParameters"
|
|
14002
14036
|
};
|
|
14003
14037
|
for (const param of node.params) {
|
|
14004
|
-
this.checkLVal(param,
|
|
14005
|
-
in: formalParameters,
|
|
14006
|
-
binding: 5,
|
|
14007
|
-
checkClashes,
|
|
14008
|
-
strictModeChanged
|
|
14009
|
-
});
|
|
14038
|
+
this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged);
|
|
14010
14039
|
}
|
|
14011
14040
|
}
|
|
14012
14041
|
parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
|
|
@@ -14127,12 +14156,12 @@ class ExpressionParser extends LValParser {
|
|
|
14127
14156
|
}
|
|
14128
14157
|
}
|
|
14129
14158
|
}
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
if (
|
|
14133
|
-
|
|
14159
|
+
recordAwaitIfAllowed() {
|
|
14160
|
+
const isAwaitAllowed = this.prodParam.hasAwait || this.options.allowAwaitOutsideFunction && !this.scope.inFunction;
|
|
14161
|
+
if (isAwaitAllowed && !this.scope.inFunction) {
|
|
14162
|
+
this.state.hasTopLevelAwait = true;
|
|
14134
14163
|
}
|
|
14135
|
-
return
|
|
14164
|
+
return isAwaitAllowed;
|
|
14136
14165
|
}
|
|
14137
14166
|
parseAwait(startLoc) {
|
|
14138
14167
|
const node = this.startNodeAt(startLoc);
|
|
@@ -14471,12 +14500,15 @@ class StatementParser extends ExpressionParser {
|
|
|
14471
14500
|
program.sourceType = sourceType;
|
|
14472
14501
|
program.interpreter = this.parseInterpreterDirective();
|
|
14473
14502
|
this.parseBlockBody(program, true, true, end);
|
|
14474
|
-
if (this.inModule
|
|
14475
|
-
|
|
14476
|
-
|
|
14477
|
-
|
|
14478
|
-
|
|
14503
|
+
if (this.inModule) {
|
|
14504
|
+
if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
|
|
14505
|
+
for (const [localName, at] of Array.from(this.scope.undefinedExports)) {
|
|
14506
|
+
this.raise(Errors.ModuleExportUndefined, at, {
|
|
14507
|
+
localName
|
|
14508
|
+
});
|
|
14509
|
+
}
|
|
14479
14510
|
}
|
|
14511
|
+
this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait);
|
|
14480
14512
|
}
|
|
14481
14513
|
let finishedProgram;
|
|
14482
14514
|
if (end === 139) {
|
|
@@ -14540,10 +14572,10 @@ class StatementParser extends ExpressionParser {
|
|
|
14540
14572
|
const nextCh = this.codePointAtPos(next);
|
|
14541
14573
|
return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next);
|
|
14542
14574
|
}
|
|
14543
|
-
|
|
14575
|
+
hasInLineFollowingBindingIdentifierOrBrace() {
|
|
14544
14576
|
const next = this.nextTokenInLineStart();
|
|
14545
14577
|
const nextCh = this.codePointAtPos(next);
|
|
14546
|
-
return this.chStartsBindingIdentifier(nextCh, next);
|
|
14578
|
+
return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next);
|
|
14547
14579
|
}
|
|
14548
14580
|
startsUsingForOf() {
|
|
14549
14581
|
const {
|
|
@@ -14596,12 +14628,12 @@ class StatementParser extends ExpressionParser {
|
|
|
14596
14628
|
return this.parseStatementContent(flags, decorators);
|
|
14597
14629
|
}
|
|
14598
14630
|
parseStatementContent(flags, decorators) {
|
|
14599
|
-
const
|
|
14631
|
+
const startType = this.state.type;
|
|
14600
14632
|
const node = this.startNode();
|
|
14601
14633
|
const allowDeclaration = !!(flags & 2);
|
|
14602
14634
|
const allowFunctionDeclaration = !!(flags & 4);
|
|
14603
14635
|
const topLevel = flags & 1;
|
|
14604
|
-
switch (
|
|
14636
|
+
switch (startType) {
|
|
14605
14637
|
case 60:
|
|
14606
14638
|
return this.parseBreakContinueStatement(node, true);
|
|
14607
14639
|
case 63:
|
|
@@ -14633,7 +14665,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14633
14665
|
return this.parseTryStatement(node);
|
|
14634
14666
|
case 96:
|
|
14635
14667
|
if (!this.state.containsEsc && this.startsAwaitUsing()) {
|
|
14636
|
-
if (!this.
|
|
14668
|
+
if (!this.recordAwaitIfAllowed()) {
|
|
14637
14669
|
this.raise(Errors.AwaitUsingNotInAsyncContext, node);
|
|
14638
14670
|
} else if (!allowDeclaration) {
|
|
14639
14671
|
this.raise(Errors.UnexpectedLexicalDeclaration, node);
|
|
@@ -14643,7 +14675,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14643
14675
|
}
|
|
14644
14676
|
break;
|
|
14645
14677
|
case 107:
|
|
14646
|
-
if (this.state.containsEsc || !this.
|
|
14678
|
+
if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) {
|
|
14647
14679
|
break;
|
|
14648
14680
|
}
|
|
14649
14681
|
this.expectPlugin("explicitResourceManagement");
|
|
@@ -14700,7 +14732,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14700
14732
|
}
|
|
14701
14733
|
this.next();
|
|
14702
14734
|
let result;
|
|
14703
|
-
if (
|
|
14735
|
+
if (startType === 83) {
|
|
14704
14736
|
result = this.parseImport(node);
|
|
14705
14737
|
if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
|
|
14706
14738
|
this.sawUnambiguousESM = true;
|
|
@@ -14727,7 +14759,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14727
14759
|
}
|
|
14728
14760
|
const maybeName = this.state.value;
|
|
14729
14761
|
const expr = this.parseExpression();
|
|
14730
|
-
if (tokenIsIdentifier(
|
|
14762
|
+
if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) {
|
|
14731
14763
|
return this.parseLabeledStatement(node, maybeName, expr, flags);
|
|
14732
14764
|
} else {
|
|
14733
14765
|
return this.parseExpressionStatement(node, expr, decorators);
|
|
@@ -14880,8 +14912,9 @@ class StatementParser extends ExpressionParser {
|
|
|
14880
14912
|
this.next();
|
|
14881
14913
|
this.state.labels.push(loopLabel);
|
|
14882
14914
|
let awaitAt = null;
|
|
14883
|
-
if (this.
|
|
14884
|
-
awaitAt = this.state.
|
|
14915
|
+
if (this.isContextual(96) && this.recordAwaitIfAllowed()) {
|
|
14916
|
+
awaitAt = this.state.startLoc;
|
|
14917
|
+
this.next();
|
|
14885
14918
|
}
|
|
14886
14919
|
this.scope.enter(0);
|
|
14887
14920
|
this.expect(10);
|
|
@@ -14901,7 +14934,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14901
14934
|
let kind;
|
|
14902
14935
|
if (startsWithAwaitUsing) {
|
|
14903
14936
|
kind = "await using";
|
|
14904
|
-
if (!this.
|
|
14937
|
+
if (!this.recordAwaitIfAllowed()) {
|
|
14905
14938
|
this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc);
|
|
14906
14939
|
}
|
|
14907
14940
|
this.next();
|
|
@@ -14941,9 +14974,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14941
14974
|
this.toAssignable(init, true);
|
|
14942
14975
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
14943
14976
|
this.checkLVal(init, {
|
|
14944
|
-
|
|
14945
|
-
type
|
|
14946
|
-
}
|
|
14977
|
+
type
|
|
14947
14978
|
});
|
|
14948
14979
|
return this.parseForIn(node, init, awaitAt);
|
|
14949
14980
|
} else {
|
|
@@ -15030,11 +15061,8 @@ class StatementParser extends ExpressionParser {
|
|
|
15030
15061
|
const param = this.parseBindingAtom();
|
|
15031
15062
|
this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0);
|
|
15032
15063
|
this.checkLVal(param, {
|
|
15033
|
-
|
|
15034
|
-
|
|
15035
|
-
},
|
|
15036
|
-
binding: 9
|
|
15037
|
-
});
|
|
15064
|
+
type: "CatchClause"
|
|
15065
|
+
}, 9);
|
|
15038
15066
|
return param;
|
|
15039
15067
|
}
|
|
15040
15068
|
parseTryStatement(node) {
|
|
@@ -15237,12 +15265,14 @@ class StatementParser extends ExpressionParser {
|
|
|
15237
15265
|
}
|
|
15238
15266
|
parseVarId(decl, kind) {
|
|
15239
15267
|
const id = this.parseBindingAtom();
|
|
15268
|
+
if (kind === "using" || kind === "await using") {
|
|
15269
|
+
if (id.type === "ArrayPattern" || id.type === "ObjectPattern") {
|
|
15270
|
+
this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start);
|
|
15271
|
+
}
|
|
15272
|
+
}
|
|
15240
15273
|
this.checkLVal(id, {
|
|
15241
|
-
|
|
15242
|
-
|
|
15243
|
-
},
|
|
15244
|
-
binding: kind === "var" ? 5 : 8201
|
|
15245
|
-
});
|
|
15274
|
+
type: "VariableDeclarator"
|
|
15275
|
+
}, kind === "var" ? 5 : 8201);
|
|
15246
15276
|
decl.id = id;
|
|
15247
15277
|
}
|
|
15248
15278
|
parseAsyncFunctionExpression(node) {
|
|
@@ -15936,7 +15966,7 @@ class StatementParser extends ExpressionParser {
|
|
|
15936
15966
|
parseModuleExportName() {
|
|
15937
15967
|
if (this.match(133)) {
|
|
15938
15968
|
const result = this.parseStringLiteral(this.state.value);
|
|
15939
|
-
const surrogate = result.value
|
|
15969
|
+
const surrogate = loneSurrogate.exec(result.value);
|
|
15940
15970
|
if (surrogate) {
|
|
15941
15971
|
this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
|
|
15942
15972
|
surrogateCharCode: surrogate[0].charCodeAt(0)
|
|
@@ -16087,11 +16117,8 @@ class StatementParser extends ExpressionParser {
|
|
|
16087
16117
|
}
|
|
16088
16118
|
finishImportSpecifier(specifier, type, bindingType = 8201) {
|
|
16089
16119
|
this.checkLVal(specifier.local, {
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
},
|
|
16093
|
-
binding: bindingType
|
|
16094
|
-
});
|
|
16120
|
+
type
|
|
16121
|
+
}, bindingType);
|
|
16095
16122
|
return this.finishNode(specifier, type);
|
|
16096
16123
|
}
|
|
16097
16124
|
parseImportAttributes() {
|
|
@@ -16257,12 +16284,12 @@ class StatementParser extends ExpressionParser {
|
|
|
16257
16284
|
}
|
|
16258
16285
|
}
|
|
16259
16286
|
let Parser$2 = class Parser extends StatementParser {
|
|
16260
|
-
constructor(options, input) {
|
|
16287
|
+
constructor(options, input, pluginsMap) {
|
|
16261
16288
|
options = getOptions(options);
|
|
16262
16289
|
super(options, input);
|
|
16263
16290
|
this.options = options;
|
|
16264
16291
|
this.initializeScopes();
|
|
16265
|
-
this.plugins = pluginsMap
|
|
16292
|
+
this.plugins = pluginsMap;
|
|
16266
16293
|
this.filename = options.sourceFilename;
|
|
16267
16294
|
}
|
|
16268
16295
|
getScopeHandler() {
|
|
@@ -16280,14 +16307,6 @@ let Parser$2 = class Parser extends StatementParser {
|
|
|
16280
16307
|
return file;
|
|
16281
16308
|
}
|
|
16282
16309
|
};
|
|
16283
|
-
function pluginsMap(plugins) {
|
|
16284
|
-
const pluginMap = new Map();
|
|
16285
|
-
for (const plugin of plugins) {
|
|
16286
|
-
const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
|
|
16287
|
-
if (!pluginMap.has(name)) pluginMap.set(name, options || {});
|
|
16288
|
-
}
|
|
16289
|
-
return pluginMap;
|
|
16290
|
-
}
|
|
16291
16310
|
function parse$9(input, options) {
|
|
16292
16311
|
var _options;
|
|
16293
16312
|
if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
|
|
@@ -16336,23 +16355,40 @@ function generateExportedTokenTypes(internalTokenTypes) {
|
|
|
16336
16355
|
const tokTypes = generateExportedTokenTypes(tt);
|
|
16337
16356
|
function getParser(options, input) {
|
|
16338
16357
|
let cls = Parser$2;
|
|
16358
|
+
const pluginsMap = new Map();
|
|
16339
16359
|
if (options != null && options.plugins) {
|
|
16340
|
-
|
|
16341
|
-
|
|
16360
|
+
for (const plugin of options.plugins) {
|
|
16361
|
+
let name, opts;
|
|
16362
|
+
if (typeof plugin === "string") {
|
|
16363
|
+
name = plugin;
|
|
16364
|
+
} else {
|
|
16365
|
+
[name, opts] = plugin;
|
|
16366
|
+
}
|
|
16367
|
+
if (!pluginsMap.has(name)) {
|
|
16368
|
+
pluginsMap.set(name, opts || {});
|
|
16369
|
+
}
|
|
16370
|
+
}
|
|
16371
|
+
validatePlugins(pluginsMap);
|
|
16372
|
+
cls = getParserClass(pluginsMap);
|
|
16342
16373
|
}
|
|
16343
|
-
return new cls(options, input);
|
|
16374
|
+
return new cls(options, input, pluginsMap);
|
|
16344
16375
|
}
|
|
16345
|
-
const parserClassCache =
|
|
16346
|
-
function getParserClass(
|
|
16347
|
-
const pluginList =
|
|
16348
|
-
const
|
|
16349
|
-
|
|
16376
|
+
const parserClassCache = new Map();
|
|
16377
|
+
function getParserClass(pluginsMap) {
|
|
16378
|
+
const pluginList = [];
|
|
16379
|
+
for (const name of mixinPluginNames) {
|
|
16380
|
+
if (pluginsMap.has(name)) {
|
|
16381
|
+
pluginList.push(name);
|
|
16382
|
+
}
|
|
16383
|
+
}
|
|
16384
|
+
const key = pluginList.join("|");
|
|
16385
|
+
let cls = parserClassCache.get(key);
|
|
16350
16386
|
if (!cls) {
|
|
16351
16387
|
cls = Parser$2;
|
|
16352
16388
|
for (const plugin of pluginList) {
|
|
16353
16389
|
cls = mixinPlugins[plugin](cls);
|
|
16354
16390
|
}
|
|
16355
|
-
parserClassCache
|
|
16391
|
+
parserClassCache.set(key, cls);
|
|
16356
16392
|
}
|
|
16357
16393
|
return cls;
|
|
16358
16394
|
}
|
|
@@ -16595,6 +16631,16 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
|
|
|
16595
16631
|
(id) => markScopeIdentifier(node, id, knownIds)
|
|
16596
16632
|
);
|
|
16597
16633
|
}
|
|
16634
|
+
} else if (node.type === "CatchClause" && node.param) {
|
|
16635
|
+
for (const id of extractIdentifiers$1(node.param)) {
|
|
16636
|
+
markScopeIdentifier(node, id, knownIds);
|
|
16637
|
+
}
|
|
16638
|
+
} else if (isForStatement(node)) {
|
|
16639
|
+
walkForStatement(
|
|
16640
|
+
node,
|
|
16641
|
+
false,
|
|
16642
|
+
(id) => markScopeIdentifier(node, id, knownIds)
|
|
16643
|
+
);
|
|
16598
16644
|
}
|
|
16599
16645
|
},
|
|
16600
16646
|
leave(node, parent) {
|
|
@@ -16675,14 +16721,20 @@ function walkBlockDeclarations(block, onIdent) {
|
|
|
16675
16721
|
} else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
|
|
16676
16722
|
if (stmt.declare || !stmt.id) continue;
|
|
16677
16723
|
onIdent(stmt.id);
|
|
16678
|
-
} else if (stmt
|
|
16679
|
-
|
|
16680
|
-
|
|
16681
|
-
|
|
16682
|
-
|
|
16683
|
-
|
|
16684
|
-
|
|
16685
|
-
|
|
16724
|
+
} else if (isForStatement(stmt)) {
|
|
16725
|
+
walkForStatement(stmt, true, onIdent);
|
|
16726
|
+
}
|
|
16727
|
+
}
|
|
16728
|
+
}
|
|
16729
|
+
function isForStatement(stmt) {
|
|
16730
|
+
return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement";
|
|
16731
|
+
}
|
|
16732
|
+
function walkForStatement(stmt, isVar, onIdent) {
|
|
16733
|
+
const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
|
|
16734
|
+
if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) {
|
|
16735
|
+
for (const decl of variable.declarations) {
|
|
16736
|
+
for (const id of extractIdentifiers$1(decl.id)) {
|
|
16737
|
+
onIdent(id);
|
|
16686
16738
|
}
|
|
16687
16739
|
}
|
|
16688
16740
|
}
|
|
@@ -16868,8 +16920,9 @@ const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
|
|
16868
16920
|
const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
|
|
16869
16921
|
const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
|
|
16870
16922
|
const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
|
|
16871
|
-
const
|
|
16872
|
-
|
|
16923
|
+
const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
|
|
16924
|
+
const isMemberExpressionBrowser = (exp) => {
|
|
16925
|
+
const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
|
|
16873
16926
|
let state = 0 /* inMemberExp */;
|
|
16874
16927
|
let stateStack = [];
|
|
16875
16928
|
let currentOpenBracketCount = 0;
|
|
@@ -16930,10 +16983,10 @@ const isMemberExpressionBrowser = (path) => {
|
|
|
16930
16983
|
}
|
|
16931
16984
|
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
16932
16985
|
};
|
|
16933
|
-
const isMemberExpressionNode = (
|
|
16986
|
+
const isMemberExpressionNode = (exp, context) => {
|
|
16934
16987
|
try {
|
|
16935
|
-
let ret = parseExpression_1(
|
|
16936
|
-
plugins: context.expressionPlugins
|
|
16988
|
+
let ret = exp.ast || parseExpression_1(getExpSource(exp), {
|
|
16989
|
+
plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"]
|
|
16937
16990
|
});
|
|
16938
16991
|
ret = unwrapTSNode(ret);
|
|
16939
16992
|
return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier" && ret.name !== "undefined";
|
|
@@ -16942,6 +16995,26 @@ const isMemberExpressionNode = (path, context) => {
|
|
|
16942
16995
|
}
|
|
16943
16996
|
};
|
|
16944
16997
|
const isMemberExpression = isMemberExpressionNode;
|
|
16998
|
+
const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
16999
|
+
const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
|
|
17000
|
+
const isFnExpressionNode = (exp, context) => {
|
|
17001
|
+
try {
|
|
17002
|
+
let ret = exp.ast || parseExpression_1(getExpSource(exp), {
|
|
17003
|
+
plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"]
|
|
17004
|
+
});
|
|
17005
|
+
if (ret.type === "Program") {
|
|
17006
|
+
ret = ret.body[0];
|
|
17007
|
+
if (ret.type === "ExpressionStatement") {
|
|
17008
|
+
ret = ret.expression;
|
|
17009
|
+
}
|
|
17010
|
+
}
|
|
17011
|
+
ret = unwrapTSNode(ret);
|
|
17012
|
+
return ret.type === "FunctionExpression" || ret.type === "ArrowFunctionExpression";
|
|
17013
|
+
} catch (e) {
|
|
17014
|
+
return false;
|
|
17015
|
+
}
|
|
17016
|
+
};
|
|
17017
|
+
const isFnExpression = isFnExpressionNode;
|
|
16945
17018
|
function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
|
|
16946
17019
|
return advancePositionWithMutation(
|
|
16947
17020
|
{
|
|
@@ -23699,7 +23772,7 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
23699
23772
|
} else {
|
|
23700
23773
|
exp = isProp.exp;
|
|
23701
23774
|
if (!exp) {
|
|
23702
|
-
exp = createSimpleExpression(`is`, false, isProp.loc);
|
|
23775
|
+
exp = createSimpleExpression(`is`, false, isProp.arg.loc);
|
|
23703
23776
|
{
|
|
23704
23777
|
exp = isProp.exp = processExpression(exp, context);
|
|
23705
23778
|
}
|
|
@@ -24243,7 +24316,6 @@ function processSlotOutlet(node, context) {
|
|
|
24243
24316
|
};
|
|
24244
24317
|
}
|
|
24245
24318
|
|
|
24246
|
-
const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
24247
24319
|
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
24248
24320
|
const { loc, modifiers, arg } = dir;
|
|
24249
24321
|
if (!dir.exp && !modifiers.length) {
|
|
@@ -24287,8 +24359,8 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
24287
24359
|
}
|
|
24288
24360
|
let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
|
|
24289
24361
|
if (exp) {
|
|
24290
|
-
const isMemberExp = isMemberExpression(exp
|
|
24291
|
-
const isInlineStatement = !(isMemberExp ||
|
|
24362
|
+
const isMemberExp = isMemberExpression(exp, context);
|
|
24363
|
+
const isInlineStatement = !(isMemberExp || isFnExpression(exp, context));
|
|
24292
24364
|
const hasMultipleStatements = exp.content.includes(`;`);
|
|
24293
24365
|
if (context.prefixIdentifiers) {
|
|
24294
24366
|
isInlineStatement && context.addIdentifiers(`$event`);
|
|
@@ -24458,7 +24530,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
24458
24530
|
return createTransformProps();
|
|
24459
24531
|
}
|
|
24460
24532
|
const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref");
|
|
24461
|
-
if (!expString.trim() || !isMemberExpression(
|
|
24533
|
+
if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) {
|
|
24462
24534
|
context.onError(
|
|
24463
24535
|
createCompilerError(42, exp.loc)
|
|
24464
24536
|
);
|
|
@@ -24633,15 +24705,27 @@ const BindingTypes = {
|
|
|
24633
24705
|
const noopDirectiveTransform = () => ({ props: [] });
|
|
24634
24706
|
|
|
24635
24707
|
const V_MODEL_RADIO = Symbol(`vModelRadio` );
|
|
24636
|
-
const V_MODEL_CHECKBOX = Symbol(
|
|
24708
|
+
const V_MODEL_CHECKBOX = Symbol(
|
|
24709
|
+
`vModelCheckbox`
|
|
24710
|
+
);
|
|
24637
24711
|
const V_MODEL_TEXT = Symbol(`vModelText` );
|
|
24638
|
-
const V_MODEL_SELECT = Symbol(
|
|
24639
|
-
|
|
24640
|
-
|
|
24641
|
-
const
|
|
24712
|
+
const V_MODEL_SELECT = Symbol(
|
|
24713
|
+
`vModelSelect`
|
|
24714
|
+
);
|
|
24715
|
+
const V_MODEL_DYNAMIC = Symbol(
|
|
24716
|
+
`vModelDynamic`
|
|
24717
|
+
);
|
|
24718
|
+
const V_ON_WITH_MODIFIERS = Symbol(
|
|
24719
|
+
`vOnModifiersGuard`
|
|
24720
|
+
);
|
|
24721
|
+
const V_ON_WITH_KEYS = Symbol(
|
|
24722
|
+
`vOnKeysGuard`
|
|
24723
|
+
);
|
|
24642
24724
|
const V_SHOW = Symbol(`vShow` );
|
|
24643
24725
|
const TRANSITION = Symbol(`Transition` );
|
|
24644
|
-
const TRANSITION_GROUP = Symbol(
|
|
24726
|
+
const TRANSITION_GROUP = Symbol(
|
|
24727
|
+
`TransitionGroup`
|
|
24728
|
+
);
|
|
24645
24729
|
registerRuntimeHelpers({
|
|
24646
24730
|
[V_MODEL_RADIO]: `vModelRadio`,
|
|
24647
24731
|
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
|
|
@@ -25619,6 +25703,9 @@ var CompilerDOM = /*#__PURE__*/Object.freeze({
|
|
|
25619
25703
|
helperNameMap: helperNameMap,
|
|
25620
25704
|
injectProp: injectProp,
|
|
25621
25705
|
isCoreComponent: isCoreComponent,
|
|
25706
|
+
isFnExpression: isFnExpression,
|
|
25707
|
+
isFnExpressionBrowser: isFnExpressionBrowser,
|
|
25708
|
+
isFnExpressionNode: isFnExpressionNode,
|
|
25622
25709
|
isFunctionType: isFunctionType,
|
|
25623
25710
|
isInDestructureAssignment: isInDestructureAssignment,
|
|
25624
25711
|
isInNewExpression: isInNewExpression,
|
|
@@ -26501,8 +26588,7 @@ function parse$7(source, options = {}) {
|
|
|
26501
26588
|
pad = false,
|
|
26502
26589
|
ignoreEmpty = true,
|
|
26503
26590
|
compiler = CompilerDOM,
|
|
26504
|
-
templateParseOptions = {}
|
|
26505
|
-
parseExpressions = true
|
|
26591
|
+
templateParseOptions = {}
|
|
26506
26592
|
} = options;
|
|
26507
26593
|
const descriptor = {
|
|
26508
26594
|
filename,
|
|
@@ -26519,7 +26605,7 @@ function parse$7(source, options = {}) {
|
|
|
26519
26605
|
const errors = [];
|
|
26520
26606
|
const ast = compiler.parse(source, __spreadProps$9(__spreadValues$a({
|
|
26521
26607
|
parseMode: "sfc",
|
|
26522
|
-
prefixIdentifiers:
|
|
26608
|
+
prefixIdentifiers: true
|
|
26523
26609
|
}, templateParseOptions), {
|
|
26524
26610
|
onError: (e) => {
|
|
26525
26611
|
errors.push(e);
|
|
@@ -30947,11 +31033,17 @@ const SSR_RENDER_ATTRS = Symbol(`ssrRenderAttrs`);
|
|
|
30947
31033
|
const SSR_RENDER_ATTR = Symbol(`ssrRenderAttr`);
|
|
30948
31034
|
const SSR_RENDER_DYNAMIC_ATTR = Symbol(`ssrRenderDynamicAttr`);
|
|
30949
31035
|
const SSR_RENDER_LIST = Symbol(`ssrRenderList`);
|
|
30950
|
-
const SSR_INCLUDE_BOOLEAN_ATTR = Symbol(
|
|
31036
|
+
const SSR_INCLUDE_BOOLEAN_ATTR = Symbol(
|
|
31037
|
+
`ssrIncludeBooleanAttr`
|
|
31038
|
+
);
|
|
30951
31039
|
const SSR_LOOSE_EQUAL = Symbol(`ssrLooseEqual`);
|
|
30952
31040
|
const SSR_LOOSE_CONTAIN = Symbol(`ssrLooseContain`);
|
|
30953
|
-
const SSR_RENDER_DYNAMIC_MODEL = Symbol(
|
|
30954
|
-
|
|
31041
|
+
const SSR_RENDER_DYNAMIC_MODEL = Symbol(
|
|
31042
|
+
`ssrRenderDynamicModel`
|
|
31043
|
+
);
|
|
31044
|
+
const SSR_GET_DYNAMIC_MODEL_PROPS = Symbol(
|
|
31045
|
+
`ssrGetDynamicModelProps`
|
|
31046
|
+
);
|
|
30955
31047
|
const SSR_RENDER_TELEPORT = Symbol(`ssrRenderTeleport`);
|
|
30956
31048
|
const SSR_RENDER_SUSPENSE = Symbol(`ssrRenderSuspense`);
|
|
30957
31049
|
const SSR_GET_DIRECTIVE_PROPS = Symbol(`ssrGetDirectiveProps`);
|
|
@@ -31019,10 +31111,7 @@ function processIfBranch(branch, context, disableNestedFragments = false) {
|
|
|
31019
31111
|
return processChildrenAsStatement(branch, context, needFragmentWrapper);
|
|
31020
31112
|
}
|
|
31021
31113
|
|
|
31022
|
-
const ssrTransformFor = createStructuralDirectiveTransform(
|
|
31023
|
-
"for",
|
|
31024
|
-
processFor
|
|
31025
|
-
);
|
|
31114
|
+
const ssrTransformFor = createStructuralDirectiveTransform("for", processFor);
|
|
31026
31115
|
function ssrProcessFor(node, context, disableNestedFragments = false) {
|
|
31027
31116
|
const needFragmentWrapper = !disableNestedFragments && (node.children.length !== 1 || node.children[0].type !== 1);
|
|
31028
31117
|
const renderLoop = createFunctionExpression(
|
|
@@ -31285,6 +31374,25 @@ const ssrTransformElement = (node, context) => {
|
|
|
31285
31374
|
])
|
|
31286
31375
|
];
|
|
31287
31376
|
}
|
|
31377
|
+
} else if (directives.length && !node.children.length) {
|
|
31378
|
+
const tempId = `_temp${context.temps++}`;
|
|
31379
|
+
propsExp.arguments = [
|
|
31380
|
+
createAssignmentExpression(
|
|
31381
|
+
createSimpleExpression(tempId, false),
|
|
31382
|
+
mergedProps
|
|
31383
|
+
)
|
|
31384
|
+
];
|
|
31385
|
+
rawChildrenMap.set(
|
|
31386
|
+
node,
|
|
31387
|
+
createConditionalExpression(
|
|
31388
|
+
createSimpleExpression(`"textContent" in ${tempId}`, false),
|
|
31389
|
+
createCallExpression(context.helper(SSR_INTERPOLATE), [
|
|
31390
|
+
createSimpleExpression(`${tempId}.textContent`, false)
|
|
31391
|
+
]),
|
|
31392
|
+
createSimpleExpression(`${tempId}.innerHTML ?? ''`, false),
|
|
31393
|
+
false
|
|
31394
|
+
)
|
|
31395
|
+
);
|
|
31288
31396
|
}
|
|
31289
31397
|
if (needTagForRuntime) {
|
|
31290
31398
|
propsExp.arguments.push(`"${node.tag}"`);
|
|
@@ -31573,7 +31681,7 @@ function ssrProcessTransitionGroup(node, context) {
|
|
|
31573
31681
|
context.pushStringPart(` ${scopeId}`);
|
|
31574
31682
|
}
|
|
31575
31683
|
context.pushStringPart(`>`);
|
|
31576
|
-
processChildren(node, context, false, true);
|
|
31684
|
+
processChildren(node, context, false, true, true);
|
|
31577
31685
|
context.pushStringPart(`</${tag.value.content}>`);
|
|
31578
31686
|
}
|
|
31579
31687
|
} else {
|
|
@@ -33956,12 +34064,14 @@ let PreviousMap$2 = class PreviousMap {
|
|
|
33956
34064
|
let charsetUri = /^data:application\/json;charset=utf-?8,/;
|
|
33957
34065
|
let uri = /^data:application\/json,/;
|
|
33958
34066
|
|
|
33959
|
-
|
|
33960
|
-
|
|
34067
|
+
let uriMatch = text.match(charsetUri) || text.match(uri);
|
|
34068
|
+
if (uriMatch) {
|
|
34069
|
+
return decodeURIComponent(text.substr(uriMatch[0].length))
|
|
33961
34070
|
}
|
|
33962
34071
|
|
|
33963
|
-
|
|
33964
|
-
|
|
34072
|
+
let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri);
|
|
34073
|
+
if (baseUriMatch) {
|
|
34074
|
+
return fromBase64(text.substr(baseUriMatch[0].length))
|
|
33965
34075
|
}
|
|
33966
34076
|
|
|
33967
34077
|
let encoding = text.match(/data:application\/json;([^,]+),/)[1];
|
|
@@ -33982,7 +34092,7 @@ let PreviousMap$2 = class PreviousMap {
|
|
|
33982
34092
|
}
|
|
33983
34093
|
|
|
33984
34094
|
loadAnnotation(css) {
|
|
33985
|
-
let comments = css.match(/\/\*\s*# sourceMappingURL=/
|
|
34095
|
+
let comments = css.match(/\/\*\s*# sourceMappingURL=/g);
|
|
33986
34096
|
if (!comments) return
|
|
33987
34097
|
|
|
33988
34098
|
// sourceMappingURLs from comments, strings, etc.
|
|
@@ -34378,7 +34488,7 @@ let MapGenerator$2 = class MapGenerator {
|
|
|
34378
34488
|
}
|
|
34379
34489
|
}
|
|
34380
34490
|
} else if (this.css) {
|
|
34381
|
-
this.css = this.css.replace(/\n
|
|
34491
|
+
this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, '');
|
|
34382
34492
|
}
|
|
34383
34493
|
}
|
|
34384
34494
|
|
|
@@ -34880,7 +34990,7 @@ let Container$7 = class Container extends Node$1 {
|
|
|
34880
34990
|
nodes.value = String(nodes.value);
|
|
34881
34991
|
}
|
|
34882
34992
|
nodes = [new Declaration$3(nodes)];
|
|
34883
|
-
} else if (nodes.selector) {
|
|
34993
|
+
} else if (nodes.selector || nodes.selectors) {
|
|
34884
34994
|
nodes = [new Rule$4(nodes)];
|
|
34885
34995
|
} else if (nodes.name) {
|
|
34886
34996
|
nodes = [new AtRule$4(nodes)];
|
|
@@ -36756,7 +36866,7 @@ let Root$2 = root$2;
|
|
|
36756
36866
|
|
|
36757
36867
|
let Processor$1 = class Processor {
|
|
36758
36868
|
constructor(plugins = []) {
|
|
36759
|
-
this.version = '8.4.
|
|
36869
|
+
this.version = '8.4.41';
|
|
36760
36870
|
this.plugins = this.normalize(plugins);
|
|
36761
36871
|
}
|
|
36762
36872
|
|
|
@@ -44169,6 +44279,20 @@ for (let i = 0; i < chars.length; i++) {
|
|
|
44169
44279
|
intToChar[i] = c;
|
|
44170
44280
|
charToInt[c] = i;
|
|
44171
44281
|
}
|
|
44282
|
+
function encodeInteger(builder, num, relative) {
|
|
44283
|
+
let delta = num - relative;
|
|
44284
|
+
delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;
|
|
44285
|
+
do {
|
|
44286
|
+
let clamped = delta & 0b011111;
|
|
44287
|
+
delta >>>= 5;
|
|
44288
|
+
if (delta > 0)
|
|
44289
|
+
clamped |= 0b100000;
|
|
44290
|
+
builder.write(intToChar[clamped]);
|
|
44291
|
+
} while (delta > 0);
|
|
44292
|
+
return num;
|
|
44293
|
+
}
|
|
44294
|
+
|
|
44295
|
+
const bufLength = 1024 * 16;
|
|
44172
44296
|
// Provide a fallback for older environments.
|
|
44173
44297
|
const td = typeof TextDecoder !== 'undefined'
|
|
44174
44298
|
? /* #__PURE__ */ new TextDecoder()
|
|
@@ -44188,63 +44312,54 @@ const td = typeof TextDecoder !== 'undefined'
|
|
|
44188
44312
|
return out;
|
|
44189
44313
|
},
|
|
44190
44314
|
};
|
|
44315
|
+
class StringWriter {
|
|
44316
|
+
constructor() {
|
|
44317
|
+
this.pos = 0;
|
|
44318
|
+
this.out = '';
|
|
44319
|
+
this.buffer = new Uint8Array(bufLength);
|
|
44320
|
+
}
|
|
44321
|
+
write(v) {
|
|
44322
|
+
const { buffer } = this;
|
|
44323
|
+
buffer[this.pos++] = v;
|
|
44324
|
+
if (this.pos === bufLength) {
|
|
44325
|
+
this.out += td.decode(buffer);
|
|
44326
|
+
this.pos = 0;
|
|
44327
|
+
}
|
|
44328
|
+
}
|
|
44329
|
+
flush() {
|
|
44330
|
+
const { buffer, out, pos } = this;
|
|
44331
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
44332
|
+
}
|
|
44333
|
+
}
|
|
44191
44334
|
function encode(decoded) {
|
|
44192
|
-
const
|
|
44193
|
-
|
|
44194
|
-
|
|
44195
|
-
|
|
44196
|
-
|
|
44197
|
-
let pos = 0;
|
|
44198
|
-
let out = '';
|
|
44335
|
+
const writer = new StringWriter();
|
|
44336
|
+
let sourcesIndex = 0;
|
|
44337
|
+
let sourceLine = 0;
|
|
44338
|
+
let sourceColumn = 0;
|
|
44339
|
+
let namesIndex = 0;
|
|
44199
44340
|
for (let i = 0; i < decoded.length; i++) {
|
|
44200
44341
|
const line = decoded[i];
|
|
44201
|
-
if (i > 0)
|
|
44202
|
-
|
|
44203
|
-
out += td.decode(buf);
|
|
44204
|
-
pos = 0;
|
|
44205
|
-
}
|
|
44206
|
-
buf[pos++] = semicolon;
|
|
44207
|
-
}
|
|
44342
|
+
if (i > 0)
|
|
44343
|
+
writer.write(semicolon);
|
|
44208
44344
|
if (line.length === 0)
|
|
44209
44345
|
continue;
|
|
44210
|
-
|
|
44346
|
+
let genColumn = 0;
|
|
44211
44347
|
for (let j = 0; j < line.length; j++) {
|
|
44212
44348
|
const segment = line[j];
|
|
44213
|
-
// We can push up to 5 ints, each int can take at most 7 chars, and we
|
|
44214
|
-
// may push a comma.
|
|
44215
|
-
if (pos > subLength) {
|
|
44216
|
-
out += td.decode(sub);
|
|
44217
|
-
buf.copyWithin(0, subLength, pos);
|
|
44218
|
-
pos -= subLength;
|
|
44219
|
-
}
|
|
44220
44349
|
if (j > 0)
|
|
44221
|
-
|
|
44222
|
-
|
|
44350
|
+
writer.write(comma);
|
|
44351
|
+
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
44223
44352
|
if (segment.length === 1)
|
|
44224
44353
|
continue;
|
|
44225
|
-
|
|
44226
|
-
|
|
44227
|
-
|
|
44354
|
+
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
44355
|
+
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
44356
|
+
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
44228
44357
|
if (segment.length === 4)
|
|
44229
44358
|
continue;
|
|
44230
|
-
|
|
44359
|
+
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
44231
44360
|
}
|
|
44232
44361
|
}
|
|
44233
|
-
return
|
|
44234
|
-
}
|
|
44235
|
-
function encodeInteger(buf, pos, state, segment, j) {
|
|
44236
|
-
const next = segment[j];
|
|
44237
|
-
let num = next - state[j];
|
|
44238
|
-
state[j] = next;
|
|
44239
|
-
num = num < 0 ? (-num << 1) | 1 : num << 1;
|
|
44240
|
-
do {
|
|
44241
|
-
let clamped = num & 0b011111;
|
|
44242
|
-
num >>>= 5;
|
|
44243
|
-
if (num > 0)
|
|
44244
|
-
clamped |= 0b100000;
|
|
44245
|
-
buf[pos++] = intToChar[clamped];
|
|
44246
|
-
} while (num > 0);
|
|
44247
|
-
return pos;
|
|
44362
|
+
return writer.flush();
|
|
44248
44363
|
}
|
|
44249
44364
|
|
|
44250
44365
|
class BitSet {
|
|
@@ -45002,8 +45117,10 @@ class MagicString {
|
|
|
45002
45117
|
update(start, end, content, options) {
|
|
45003
45118
|
if (typeof content !== 'string') throw new TypeError('replacement content must be a string');
|
|
45004
45119
|
|
|
45005
|
-
|
|
45006
|
-
|
|
45120
|
+
if (this.original.length !== 0) {
|
|
45121
|
+
while (start < 0) start += this.original.length;
|
|
45122
|
+
while (end < 0) end += this.original.length;
|
|
45123
|
+
}
|
|
45007
45124
|
|
|
45008
45125
|
if (end > this.original.length) throw new Error('end is out of bounds');
|
|
45009
45126
|
if (start === end)
|
|
@@ -45099,8 +45216,10 @@ class MagicString {
|
|
|
45099
45216
|
}
|
|
45100
45217
|
|
|
45101
45218
|
remove(start, end) {
|
|
45102
|
-
|
|
45103
|
-
|
|
45219
|
+
if (this.original.length !== 0) {
|
|
45220
|
+
while (start < 0) start += this.original.length;
|
|
45221
|
+
while (end < 0) end += this.original.length;
|
|
45222
|
+
}
|
|
45104
45223
|
|
|
45105
45224
|
if (start === end) return this;
|
|
45106
45225
|
|
|
@@ -45123,8 +45242,10 @@ class MagicString {
|
|
|
45123
45242
|
}
|
|
45124
45243
|
|
|
45125
45244
|
reset(start, end) {
|
|
45126
|
-
|
|
45127
|
-
|
|
45245
|
+
if (this.original.length !== 0) {
|
|
45246
|
+
while (start < 0) start += this.original.length;
|
|
45247
|
+
while (end < 0) end += this.original.length;
|
|
45248
|
+
}
|
|
45128
45249
|
|
|
45129
45250
|
if (start === end) return this;
|
|
45130
45251
|
|
|
@@ -45186,8 +45307,10 @@ class MagicString {
|
|
|
45186
45307
|
}
|
|
45187
45308
|
|
|
45188
45309
|
slice(start = 0, end = this.original.length) {
|
|
45189
|
-
|
|
45190
|
-
|
|
45310
|
+
if (this.original.length !== 0) {
|
|
45311
|
+
while (start < 0) start += this.original.length;
|
|
45312
|
+
while (end < 0) end += this.original.length;
|
|
45313
|
+
}
|
|
45191
45314
|
|
|
45192
45315
|
let result = '';
|
|
45193
45316
|
|
|
@@ -46922,7 +47045,7 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
46922
47045
|
return ["Symbol"];
|
|
46923
47046
|
case "TSIndexedAccessType": {
|
|
46924
47047
|
const types = resolveIndexType(ctx, node, scope);
|
|
46925
|
-
return flattenTypes(ctx, types, scope);
|
|
47048
|
+
return flattenTypes(ctx, types, scope, isKeyOf);
|
|
46926
47049
|
}
|
|
46927
47050
|
case "ClassDeclaration":
|
|
46928
47051
|
return ["Object"];
|
|
@@ -48664,7 +48787,7 @@ var __spreadValues = (a, b) => {
|
|
|
48664
48787
|
}
|
|
48665
48788
|
return a;
|
|
48666
48789
|
};
|
|
48667
|
-
const version = "3.5.0-
|
|
48790
|
+
const version = "3.5.0-beta.2";
|
|
48668
48791
|
const parseCache = parseCache$1;
|
|
48669
48792
|
const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
|
|
48670
48793
|
const walk = walk$2;
|