@vue/compiler-sfc 3.5.22 → 3.5.23
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 +64 -29
- package/dist/compiler-sfc.esm-browser.js +235 -163
- package/package.json +10 -10
package/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.5.
|
|
2
|
+
* @vue/compiler-sfc v3.5.23
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -19591,6 +19591,9 @@ function getImportedName(specifier) {
|
|
|
19591
19591
|
function getId(node) {
|
|
19592
19592
|
return node.type === "Identifier" ? node.name : node.type === "StringLiteral" ? node.value : null;
|
|
19593
19593
|
}
|
|
19594
|
+
function getStringLiteralKey(node) {
|
|
19595
|
+
return node.computed ? node.key.type === "TemplateLiteral" && !node.key.expressions.length ? node.key.quasis.map((q) => q.value.cooked).join("") : null : node.key.type === "Identifier" ? node.key.name : node.key.type === "StringLiteral" ? node.key.value : node.key.type === "NumericLiteral" ? String(node.key.value) : null;
|
|
19596
|
+
}
|
|
19594
19597
|
const identity = (str) => str;
|
|
19595
19598
|
const fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g;
|
|
19596
19599
|
const toLowerCase = (str) => str.toLowerCase();
|
|
@@ -20336,21 +20339,35 @@ const parseClass = (glob, position) => {
|
|
|
20336
20339
|
/**
|
|
20337
20340
|
* Un-escape a string that has been escaped with {@link escape}.
|
|
20338
20341
|
*
|
|
20339
|
-
* If the {@link windowsPathsNoEscape} option is used, then
|
|
20340
|
-
* escapes are removed, but not backslash escapes.
|
|
20341
|
-
*
|
|
20342
|
-
*
|
|
20342
|
+
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
|
|
20343
|
+
* square-bracket escapes are removed, but not backslash escapes.
|
|
20344
|
+
*
|
|
20345
|
+
* For example, it will turn the string `'[*]'` into `*`, but it will not
|
|
20346
|
+
* turn `'\\*'` into `'*'`, because `\` is a path separator in
|
|
20347
|
+
* `windowsPathsNoEscape` mode.
|
|
20343
20348
|
*
|
|
20344
|
-
* When `windowsPathsNoEscape` is not set, then both
|
|
20349
|
+
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
|
|
20345
20350
|
* backslash escapes are removed.
|
|
20346
20351
|
*
|
|
20347
20352
|
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
|
20348
20353
|
* or unescaped.
|
|
20354
|
+
*
|
|
20355
|
+
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
|
|
20356
|
+
* unescaped.
|
|
20349
20357
|
*/
|
|
20350
|
-
const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
|
|
20358
|
+
const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
|
|
20359
|
+
if (magicalBraces) {
|
|
20360
|
+
return windowsPathsNoEscape
|
|
20361
|
+
? s.replace(/\[([^\/\\])\]/g, '$1')
|
|
20362
|
+
: s
|
|
20363
|
+
.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
|
|
20364
|
+
.replace(/\\([^\/])/g, '$1');
|
|
20365
|
+
}
|
|
20351
20366
|
return windowsPathsNoEscape
|
|
20352
|
-
? s.replace(/\[([^\/\\])\]/g, '$1')
|
|
20353
|
-
: s
|
|
20367
|
+
? s.replace(/\[([^\/\\{}])\]/g, '$1')
|
|
20368
|
+
: s
|
|
20369
|
+
.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
|
|
20370
|
+
.replace(/\\([^\/{}])/g, '$1');
|
|
20354
20371
|
};
|
|
20355
20372
|
|
|
20356
20373
|
// parse a single path portion
|
|
@@ -20765,7 +20782,9 @@ class AST {
|
|
|
20765
20782
|
if (this.#root === this)
|
|
20766
20783
|
this.#fillNegs();
|
|
20767
20784
|
if (!this.type) {
|
|
20768
|
-
const noEmpty = this.isStart() &&
|
|
20785
|
+
const noEmpty = this.isStart() &&
|
|
20786
|
+
this.isEnd() &&
|
|
20787
|
+
!this.#parts.some(s => typeof s !== 'string');
|
|
20769
20788
|
const src = this.#parts
|
|
20770
20789
|
.map(p => {
|
|
20771
20790
|
const [re, _, hasMagic, uflag] = typeof p === 'string'
|
|
@@ -20921,10 +20940,7 @@ class AST {
|
|
|
20921
20940
|
}
|
|
20922
20941
|
}
|
|
20923
20942
|
if (c === '*') {
|
|
20924
|
-
|
|
20925
|
-
re += starNoEmpty;
|
|
20926
|
-
else
|
|
20927
|
-
re += star$1;
|
|
20943
|
+
re += noEmpty && glob === '*' ? starNoEmpty : star$1;
|
|
20928
20944
|
hasMagic = true;
|
|
20929
20945
|
continue;
|
|
20930
20946
|
}
|
|
@@ -20942,16 +20958,24 @@ class AST {
|
|
|
20942
20958
|
/**
|
|
20943
20959
|
* Escape all magic characters in a glob pattern.
|
|
20944
20960
|
*
|
|
20945
|
-
* If the {@link
|
|
20961
|
+
* If the {@link MinimatchOptions.windowsPathsNoEscape}
|
|
20946
20962
|
* option is used, then characters are escaped by wrapping in `[]`, because
|
|
20947
20963
|
* a magic character wrapped in a character class can only be satisfied by
|
|
20948
20964
|
* that exact character. In this mode, `\` is _not_ escaped, because it is
|
|
20949
20965
|
* not interpreted as a magic character, but instead as a path separator.
|
|
20966
|
+
*
|
|
20967
|
+
* If the {@link MinimatchOptions.magicalBraces} option is used,
|
|
20968
|
+
* then braces (`{` and `}`) will be escaped.
|
|
20950
20969
|
*/
|
|
20951
|
-
const escape = (s, { windowsPathsNoEscape = false, } = {}) => {
|
|
20970
|
+
const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
|
|
20952
20971
|
// don't need to escape +@! because we escape the parens
|
|
20953
20972
|
// that make those magic, and escaping ! as [!] isn't valid,
|
|
20954
20973
|
// because [!]] is a valid glob class meaning not ']'.
|
|
20974
|
+
if (magicalBraces) {
|
|
20975
|
+
return windowsPathsNoEscape
|
|
20976
|
+
? s.replace(/[?*()[\]{}]/g, '[$&]')
|
|
20977
|
+
: s.replace(/[?*()[\]\\{}]/g, '\\$&');
|
|
20978
|
+
}
|
|
20955
20979
|
return windowsPathsNoEscape
|
|
20956
20980
|
? s.replace(/[?*()[\]]/g, '[$&]')
|
|
20957
20981
|
: s.replace(/[?*()[\]\\]/g, '\\$&');
|
|
@@ -21585,7 +21609,7 @@ class Minimatch {
|
|
|
21585
21609
|
}
|
|
21586
21610
|
}
|
|
21587
21611
|
// resolve and reduce . and .. portions in the file as well.
|
|
21588
|
-
//
|
|
21612
|
+
// don't need to do the second phase, because it's only one string[]
|
|
21589
21613
|
const { optimizationLevel = 1 } = this.options;
|
|
21590
21614
|
if (optimizationLevel >= 2) {
|
|
21591
21615
|
file = this.levelTwoFileOptimize(file);
|
|
@@ -21838,14 +21862,25 @@ class Minimatch {
|
|
|
21838
21862
|
}
|
|
21839
21863
|
}
|
|
21840
21864
|
else if (next === undefined) {
|
|
21841
|
-
pp[i - 1] = prev + '(
|
|
21865
|
+
pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
|
|
21842
21866
|
}
|
|
21843
21867
|
else if (next !== GLOBSTAR) {
|
|
21844
21868
|
pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
|
|
21845
21869
|
pp[i + 1] = GLOBSTAR;
|
|
21846
21870
|
}
|
|
21847
21871
|
});
|
|
21848
|
-
|
|
21872
|
+
const filtered = pp.filter(p => p !== GLOBSTAR);
|
|
21873
|
+
// For partial matches, we need to make the pattern match
|
|
21874
|
+
// any prefix of the full path. We do this by generating
|
|
21875
|
+
// alternative patterns that match progressively longer prefixes.
|
|
21876
|
+
if (this.partial && filtered.length >= 1) {
|
|
21877
|
+
const prefixes = [];
|
|
21878
|
+
for (let i = 1; i <= filtered.length; i++) {
|
|
21879
|
+
prefixes.push(filtered.slice(0, i).join('/'));
|
|
21880
|
+
}
|
|
21881
|
+
return '(?:' + prefixes.join('|') + ')';
|
|
21882
|
+
}
|
|
21883
|
+
return filtered.join('/');
|
|
21849
21884
|
})
|
|
21850
21885
|
.join('|');
|
|
21851
21886
|
// need to wrap in parens if we had more than one thing with |,
|
|
@@ -21854,6 +21889,10 @@ class Minimatch {
|
|
|
21854
21889
|
// must match entire pattern
|
|
21855
21890
|
// ending in a * or ** will make it less strict.
|
|
21856
21891
|
re = '^' + open + re + close + '$';
|
|
21892
|
+
// In partial mode, '/' should always match as it's a valid prefix for any pattern
|
|
21893
|
+
if (this.partial) {
|
|
21894
|
+
re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
|
|
21895
|
+
}
|
|
21857
21896
|
// can match anything, as long as it's not this.
|
|
21858
21897
|
if (this.negate)
|
|
21859
21898
|
re = '^(?!' + re + ').+$';
|
|
@@ -22124,13 +22163,9 @@ function typeElementsToMap(ctx, elements, scope = ctxToScope(ctx), typeParameter
|
|
|
22124
22163
|
Object.assign(scope.types, typeParameters);
|
|
22125
22164
|
}
|
|
22126
22165
|
e._ownerScope = scope;
|
|
22127
|
-
const name =
|
|
22128
|
-
if (name
|
|
22166
|
+
const name = getStringLiteralKey(e);
|
|
22167
|
+
if (name !== null) {
|
|
22129
22168
|
res.props[name] = e;
|
|
22130
|
-
} else if (e.key.type === "TemplateLiteral") {
|
|
22131
|
-
for (const key of resolveTemplateKeys(ctx, e.key, scope)) {
|
|
22132
|
-
res.props[key] = e;
|
|
22133
|
-
}
|
|
22134
22169
|
} else {
|
|
22135
22170
|
ctx.error(
|
|
22136
22171
|
`Unsupported computed key in type referenced by a macro`,
|
|
@@ -22529,7 +22564,7 @@ function registerTS(_loadTS) {
|
|
|
22529
22564
|
} catch (err) {
|
|
22530
22565
|
if (typeof err.message === "string" && err.message.includes("Cannot find module")) {
|
|
22531
22566
|
throw new Error(
|
|
22532
|
-
'Failed to load TypeScript, which is required for resolving imported types. Please make sure "
|
|
22567
|
+
'Failed to load TypeScript, which is required for resolving imported types. Please make sure "TypeScript" is installed as a project dependency.'
|
|
22533
22568
|
);
|
|
22534
22569
|
} else {
|
|
22535
22570
|
throw new Error(
|
|
@@ -22599,7 +22634,7 @@ function importSourceToScope(ctx, node, scope, source) {
|
|
|
22599
22634
|
if (loadTS) ts = loadTS();
|
|
22600
22635
|
if (!ts) {
|
|
22601
22636
|
return ctx.error(
|
|
22602
|
-
`Failed to resolve import source ${JSON.stringify(source)}.
|
|
22637
|
+
`Failed to resolve import source ${JSON.stringify(source)}. TypeScript is required as a peer dep for vue in order to support resolving types from module imports.`,
|
|
22603
22638
|
node,
|
|
22604
22639
|
scope
|
|
22605
22640
|
);
|
|
@@ -23420,7 +23455,7 @@ function ctorToType(ctorType) {
|
|
|
23420
23455
|
}
|
|
23421
23456
|
function findStaticPropertyType(node, key) {
|
|
23422
23457
|
const prop = node.members.find(
|
|
23423
|
-
(m) => m.type === "TSPropertySignature" &&
|
|
23458
|
+
(m) => m.type === "TSPropertySignature" && getStringLiteralKey(m) === key && m.typeAnnotation
|
|
23424
23459
|
);
|
|
23425
23460
|
return prop && prop.typeAnnotation.typeAnnotation;
|
|
23426
23461
|
}
|
|
@@ -25048,7 +25083,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
25048
25083
|
return generator.toJSON();
|
|
25049
25084
|
}
|
|
25050
25085
|
|
|
25051
|
-
const version = "3.5.
|
|
25086
|
+
const version = "3.5.23";
|
|
25052
25087
|
const parseCache = parseCache$1;
|
|
25053
25088
|
const errorMessages = {
|
|
25054
25089
|
...CompilerDOM.errorMessages,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.5.
|
|
2
|
+
* @vue/compiler-sfc v3.5.23
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2880,7 +2880,7 @@ function requireLib () {
|
|
|
2880
2880
|
allowUndeclaredExports: false,
|
|
2881
2881
|
allowYieldOutsideFunction: false,
|
|
2882
2882
|
plugins: [],
|
|
2883
|
-
strictMode:
|
|
2883
|
+
strictMode: undefined,
|
|
2884
2884
|
ranges: false,
|
|
2885
2885
|
tokens: false,
|
|
2886
2886
|
createImportExpressions: false,
|
|
@@ -3068,7 +3068,6 @@ function requireLib () {
|
|
|
3068
3068
|
}
|
|
3069
3069
|
convertPrivateNameToPrivateIdentifier(node) {
|
|
3070
3070
|
const name = super.getPrivateNameSV(node);
|
|
3071
|
-
node = node;
|
|
3072
3071
|
delete node.id;
|
|
3073
3072
|
node.name = name;
|
|
3074
3073
|
return this.castNodeTo(node, "PrivateIdentifier");
|
|
@@ -3183,8 +3182,8 @@ function requireLib () {
|
|
|
3183
3182
|
node.kind = "init";
|
|
3184
3183
|
return this.finishNode(node, "Property");
|
|
3185
3184
|
}
|
|
3186
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
3187
|
-
return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
|
|
3185
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
3186
|
+
return type === "Property" ? "value" : super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding);
|
|
3188
3187
|
}
|
|
3189
3188
|
isAssignable(node, isBinding) {
|
|
3190
3189
|
if (node != null && this.isObjectProperty(node)) {
|
|
@@ -3901,13 +3900,13 @@ function requireLib () {
|
|
|
3901
3900
|
context.push(types.j_expr, types.j_oTag);
|
|
3902
3901
|
};
|
|
3903
3902
|
}
|
|
3904
|
-
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\
|
|
3905
|
-
let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\
|
|
3903
|
+
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088f\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7dc\ua7f1-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
|
3904
|
+
let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1add\u1ae0-\u1aeb\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";
|
|
3906
3905
|
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
3907
3906
|
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
3908
3907
|
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
3909
|
-
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25,
|
|
3910
|
-
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1,
|
|
3908
|
+
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
|
|
3909
|
+
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
3911
3910
|
function isInAstralSet(code, set) {
|
|
3912
3911
|
let pos = 0x10000;
|
|
3913
3912
|
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
@@ -4091,7 +4090,7 @@ function requireLib () {
|
|
|
4091
4090
|
if (bindingType & 8) {
|
|
4092
4091
|
return scope.names.has(name);
|
|
4093
4092
|
}
|
|
4094
|
-
const type = scope.names.get(name);
|
|
4093
|
+
const type = scope.names.get(name) || 0;
|
|
4095
4094
|
if (bindingType & 16) {
|
|
4096
4095
|
return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0;
|
|
4097
4096
|
}
|
|
@@ -4406,9 +4405,8 @@ function requireLib () {
|
|
|
4406
4405
|
return this.flowParseDeclareInterface(node);
|
|
4407
4406
|
} else if (this.match(82)) {
|
|
4408
4407
|
return this.flowParseDeclareExportDeclaration(node, insideModule);
|
|
4409
|
-
} else {
|
|
4410
|
-
this.unexpected();
|
|
4411
4408
|
}
|
|
4409
|
+
throw this.unexpected();
|
|
4412
4410
|
}
|
|
4413
4411
|
flowParseDeclareVariable(node) {
|
|
4414
4412
|
this.next();
|
|
@@ -4428,18 +4426,17 @@ function requireLib () {
|
|
|
4428
4426
|
const body = bodyNode.body = [];
|
|
4429
4427
|
this.expect(5);
|
|
4430
4428
|
while (!this.match(8)) {
|
|
4431
|
-
|
|
4429
|
+
const bodyNode = this.startNode();
|
|
4432
4430
|
if (this.match(83)) {
|
|
4433
4431
|
this.next();
|
|
4434
4432
|
if (!this.isContextual(130) && !this.match(87)) {
|
|
4435
4433
|
this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
|
|
4436
4434
|
}
|
|
4437
|
-
super.parseImport(bodyNode);
|
|
4435
|
+
body.push(super.parseImport(bodyNode));
|
|
4438
4436
|
} else {
|
|
4439
4437
|
this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule);
|
|
4440
|
-
|
|
4438
|
+
body.push(this.flowParseDeclare(bodyNode, true));
|
|
4441
4439
|
}
|
|
4442
|
-
body.push(bodyNode);
|
|
4443
4440
|
}
|
|
4444
4441
|
this.scope.exit();
|
|
4445
4442
|
this.expect(8);
|
|
@@ -4500,7 +4497,7 @@ function requireLib () {
|
|
|
4500
4497
|
}
|
|
4501
4498
|
}
|
|
4502
4499
|
}
|
|
4503
|
-
this.unexpected();
|
|
4500
|
+
throw this.unexpected();
|
|
4504
4501
|
}
|
|
4505
4502
|
flowParseDeclareModuleExports(node) {
|
|
4506
4503
|
this.next();
|
|
@@ -4708,7 +4705,7 @@ function requireLib () {
|
|
|
4708
4705
|
return this.finishNode(node, "TypeParameterInstantiation");
|
|
4709
4706
|
}
|
|
4710
4707
|
flowParseTypeParameterInstantiationCallOrNew() {
|
|
4711
|
-
if (this.reScan_lt() !== 47) return;
|
|
4708
|
+
if (this.reScan_lt() !== 47) return null;
|
|
4712
4709
|
const node = this.startNode();
|
|
4713
4710
|
const oldInType = this.state.inType;
|
|
4714
4711
|
node.params = [];
|
|
@@ -5204,8 +5201,7 @@ function requireLib () {
|
|
|
5204
5201
|
}
|
|
5205
5202
|
throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
5206
5203
|
}
|
|
5207
|
-
this.unexpected();
|
|
5208
|
-
return;
|
|
5204
|
+
throw this.unexpected();
|
|
5209
5205
|
case 135:
|
|
5210
5206
|
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
|
5211
5207
|
case 136:
|
|
@@ -5236,7 +5232,7 @@ function requireLib () {
|
|
|
5236
5232
|
return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());
|
|
5237
5233
|
}
|
|
5238
5234
|
}
|
|
5239
|
-
this.unexpected();
|
|
5235
|
+
throw this.unexpected();
|
|
5240
5236
|
}
|
|
5241
5237
|
flowParsePostfixType() {
|
|
5242
5238
|
const startLoc = this.state.startLoc;
|
|
@@ -5697,15 +5693,15 @@ function requireLib () {
|
|
|
5697
5693
|
}
|
|
5698
5694
|
return exprList;
|
|
5699
5695
|
}
|
|
5700
|
-
parseArrayLike(close,
|
|
5701
|
-
const node = super.parseArrayLike(close,
|
|
5702
|
-
if (
|
|
5696
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
5697
|
+
const node = super.parseArrayLike(close, isTuple, refExpressionErrors);
|
|
5698
|
+
if (refExpressionErrors != null && !this.state.maybeInArrowParameters) {
|
|
5703
5699
|
this.toReferencedList(node.elements);
|
|
5704
5700
|
}
|
|
5705
5701
|
return node;
|
|
5706
5702
|
}
|
|
5707
|
-
isValidLVal(type, isParenthesized, binding) {
|
|
5708
|
-
return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding);
|
|
5703
|
+
isValidLVal(type, disallowCallExpression, isParenthesized, binding) {
|
|
5704
|
+
return type === "TypeCastExpression" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding);
|
|
5709
5705
|
}
|
|
5710
5706
|
parseClassProperty(node) {
|
|
5711
5707
|
if (this.match(14)) {
|
|
@@ -7554,10 +7550,8 @@ function requireLib () {
|
|
|
7554
7550
|
setLeadingComments(commentWS.trailingNode, comments);
|
|
7555
7551
|
}
|
|
7556
7552
|
} else {
|
|
7557
|
-
const
|
|
7558
|
-
|
|
7559
|
-
start: commentStart
|
|
7560
|
-
} = commentWS;
|
|
7553
|
+
const node = commentWS.containingNode;
|
|
7554
|
+
const commentStart = commentWS.start;
|
|
7561
7555
|
if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) {
|
|
7562
7556
|
switch (node.type) {
|
|
7563
7557
|
case "ObjectExpression":
|
|
@@ -8378,7 +8372,7 @@ function requireLib () {
|
|
|
8378
8372
|
const commentWhitespace = {
|
|
8379
8373
|
start: this.sourceToOffsetPos(spaceStart),
|
|
8380
8374
|
end: this.sourceToOffsetPos(end),
|
|
8381
|
-
comments,
|
|
8375
|
+
comments: comments,
|
|
8382
8376
|
leadingNode: null,
|
|
8383
8377
|
trailingNode: null,
|
|
8384
8378
|
containingNode: null
|
|
@@ -9389,7 +9383,7 @@ function requireLib () {
|
|
|
9389
9383
|
};
|
|
9390
9384
|
}
|
|
9391
9385
|
return {
|
|
9392
|
-
node,
|
|
9386
|
+
node: node,
|
|
9393
9387
|
error: null,
|
|
9394
9388
|
thrown: false,
|
|
9395
9389
|
aborted: false,
|
|
@@ -9645,7 +9639,7 @@ function requireLib () {
|
|
|
9645
9639
|
if (isLHS) {
|
|
9646
9640
|
if (parenthesized.type === "Identifier") {
|
|
9647
9641
|
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node);
|
|
9648
|
-
} else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
|
|
9642
|
+
} else if (parenthesized.type !== "CallExpression" && parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
|
|
9649
9643
|
this.raise(Errors.InvalidParenthesizedAssignment, node);
|
|
9650
9644
|
}
|
|
9651
9645
|
} else {
|
|
@@ -9921,7 +9915,7 @@ function requireLib () {
|
|
|
9921
9915
|
node.right = this.parseMaybeAssignAllowIn();
|
|
9922
9916
|
return this.finishNode(node, "AssignmentPattern");
|
|
9923
9917
|
}
|
|
9924
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
9918
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
9925
9919
|
switch (type) {
|
|
9926
9920
|
case "AssignmentPattern":
|
|
9927
9921
|
return "left";
|
|
@@ -9937,13 +9931,17 @@ function requireLib () {
|
|
|
9937
9931
|
return "properties";
|
|
9938
9932
|
case "VoidPattern":
|
|
9939
9933
|
return true;
|
|
9934
|
+
case "CallExpression":
|
|
9935
|
+
if (!disallowCallExpression && !this.state.strict && this.optionFlags & 8192) {
|
|
9936
|
+
return true;
|
|
9937
|
+
}
|
|
9940
9938
|
}
|
|
9941
9939
|
return false;
|
|
9942
9940
|
}
|
|
9943
9941
|
isOptionalMemberExpression(expression) {
|
|
9944
9942
|
return expression.type === "OptionalMemberExpression";
|
|
9945
9943
|
}
|
|
9946
|
-
checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) {
|
|
9944
|
+
checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false, disallowCallExpression = false) {
|
|
9947
9945
|
var _expression$extra;
|
|
9948
9946
|
const type = expression.type;
|
|
9949
9947
|
if (this.isObjectMethod(expression)) return;
|
|
@@ -9978,7 +9976,9 @@ function requireLib () {
|
|
|
9978
9976
|
} else if (type === "VoidPattern" && ancestor.type === "CatchClause") {
|
|
9979
9977
|
this.raise(Errors.VoidPatternCatchClauseParam, expression);
|
|
9980
9978
|
}
|
|
9981
|
-
const
|
|
9979
|
+
const unwrappedExpression = unwrapParenthesizedExpression(expression);
|
|
9980
|
+
disallowCallExpression || (disallowCallExpression = unwrappedExpression.type === "CallExpression" && (unwrappedExpression.callee.type === "Import" || unwrappedExpression.callee.type === "Super"));
|
|
9981
|
+
const validity = this.isValidLVal(type, disallowCallExpression, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
|
|
9982
9982
|
if (validity === true) return;
|
|
9983
9983
|
if (validity === false) {
|
|
9984
9984
|
const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
|
|
@@ -10001,11 +10001,11 @@ function requireLib () {
|
|
|
10001
10001
|
if (Array.isArray(val)) {
|
|
10002
10002
|
for (const child of val) {
|
|
10003
10003
|
if (child) {
|
|
10004
|
-
this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
|
|
10004
|
+
this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, true);
|
|
10005
10005
|
}
|
|
10006
10006
|
}
|
|
10007
10007
|
} else if (val) {
|
|
10008
|
-
this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
|
|
10008
|
+
this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, disallowCallExpression);
|
|
10009
10009
|
}
|
|
10010
10010
|
}
|
|
10011
10011
|
checkIdentifier(at, bindingType, strictModeChanged = false) {
|
|
@@ -10053,6 +10053,7 @@ function requireLib () {
|
|
|
10053
10053
|
return true;
|
|
10054
10054
|
}
|
|
10055
10055
|
}
|
|
10056
|
+
const keywordAndTSRelationalOperator = /in(?:stanceof)?|as|satisfies/y;
|
|
10056
10057
|
function nonNull(x) {
|
|
10057
10058
|
if (x == null) {
|
|
10058
10059
|
throw new Error(`Unexpected ${x} value.`);
|
|
@@ -10940,7 +10941,7 @@ function requireLib () {
|
|
|
10940
10941
|
}
|
|
10941
10942
|
}
|
|
10942
10943
|
}
|
|
10943
|
-
this.unexpected();
|
|
10944
|
+
throw this.unexpected();
|
|
10944
10945
|
}
|
|
10945
10946
|
tsParseArrayTypeOrHigher() {
|
|
10946
10947
|
const {
|
|
@@ -11504,52 +11505,22 @@ function requireLib () {
|
|
|
11504
11505
|
}
|
|
11505
11506
|
default:
|
|
11506
11507
|
if (tokenIsIdentifier(startType)) {
|
|
11507
|
-
return this.tsParseDeclaration(node, this.state.
|
|
11508
|
+
return this.tsParseDeclaration(node, this.state.type, true, null);
|
|
11508
11509
|
}
|
|
11509
11510
|
}
|
|
11510
11511
|
});
|
|
11511
11512
|
}
|
|
11512
11513
|
tsTryParseExportDeclaration() {
|
|
11513
|
-
return this.tsParseDeclaration(this.startNode(), this.state.
|
|
11514
|
-
}
|
|
11515
|
-
tsParseExpressionStatement(node, expr, decorators) {
|
|
11516
|
-
switch (expr.name) {
|
|
11517
|
-
case "declare":
|
|
11518
|
-
{
|
|
11519
|
-
const declaration = this.tsTryParseDeclare(node);
|
|
11520
|
-
if (declaration) {
|
|
11521
|
-
declaration.declare = true;
|
|
11522
|
-
}
|
|
11523
|
-
return declaration;
|
|
11524
|
-
}
|
|
11525
|
-
case "global":
|
|
11526
|
-
if (this.match(5)) {
|
|
11527
|
-
this.scope.enter(1024);
|
|
11528
|
-
this.prodParam.enter(0);
|
|
11529
|
-
const mod = node;
|
|
11530
|
-
mod.kind = "global";
|
|
11531
|
-
{
|
|
11532
|
-
node.global = true;
|
|
11533
|
-
}
|
|
11534
|
-
mod.id = expr;
|
|
11535
|
-
mod.body = this.tsParseModuleBlock();
|
|
11536
|
-
this.scope.exit();
|
|
11537
|
-
this.prodParam.exit();
|
|
11538
|
-
return this.finishNode(mod, "TSModuleDeclaration");
|
|
11539
|
-
}
|
|
11540
|
-
break;
|
|
11541
|
-
default:
|
|
11542
|
-
return this.tsParseDeclaration(node, expr.name, false, decorators);
|
|
11543
|
-
}
|
|
11514
|
+
return this.tsParseDeclaration(this.startNode(), this.state.type, true, null);
|
|
11544
11515
|
}
|
|
11545
|
-
tsParseDeclaration(node,
|
|
11546
|
-
switch (
|
|
11547
|
-
case
|
|
11516
|
+
tsParseDeclaration(node, type, next, decorators) {
|
|
11517
|
+
switch (type) {
|
|
11518
|
+
case 124:
|
|
11548
11519
|
if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {
|
|
11549
11520
|
return this.tsParseAbstractDeclaration(node, decorators);
|
|
11550
11521
|
}
|
|
11551
11522
|
break;
|
|
11552
|
-
case
|
|
11523
|
+
case 127:
|
|
11553
11524
|
if (this.tsCheckLineTerminator(next)) {
|
|
11554
11525
|
if (this.match(134)) {
|
|
11555
11526
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
@@ -11559,13 +11530,13 @@ function requireLib () {
|
|
|
11559
11530
|
}
|
|
11560
11531
|
}
|
|
11561
11532
|
break;
|
|
11562
|
-
case
|
|
11533
|
+
case 128:
|
|
11563
11534
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
11564
11535
|
node.kind = "namespace";
|
|
11565
11536
|
return this.tsParseModuleOrNamespaceDeclaration(node);
|
|
11566
11537
|
}
|
|
11567
11538
|
break;
|
|
11568
|
-
case
|
|
11539
|
+
case 130:
|
|
11569
11540
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
11570
11541
|
return this.tsParseTypeAliasDeclaration(node);
|
|
11571
11542
|
}
|
|
@@ -11706,8 +11677,8 @@ function requireLib () {
|
|
|
11706
11677
|
this.tsCheckForInvalidTypeCasts(exprList);
|
|
11707
11678
|
return exprList;
|
|
11708
11679
|
}
|
|
11709
|
-
parseArrayLike(close,
|
|
11710
|
-
const node = super.parseArrayLike(close,
|
|
11680
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
11681
|
+
const node = super.parseArrayLike(close, isTuple, refExpressionErrors);
|
|
11711
11682
|
if (node.type === "ArrayExpression") {
|
|
11712
11683
|
this.tsCheckForInvalidTypeCasts(node.elements);
|
|
11713
11684
|
}
|
|
@@ -11952,19 +11923,85 @@ function requireLib () {
|
|
|
11952
11923
|
return declaration;
|
|
11953
11924
|
}
|
|
11954
11925
|
parseStatementContent(flags, decorators) {
|
|
11955
|
-
if (this.
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11926
|
+
if (!this.state.containsEsc) {
|
|
11927
|
+
switch (this.state.type) {
|
|
11928
|
+
case 75:
|
|
11929
|
+
{
|
|
11930
|
+
if (this.isLookaheadContextual("enum")) {
|
|
11931
|
+
const node = this.startNode();
|
|
11932
|
+
this.expect(75);
|
|
11933
|
+
return this.tsParseEnumDeclaration(node, {
|
|
11934
|
+
const: true
|
|
11935
|
+
});
|
|
11936
|
+
}
|
|
11937
|
+
break;
|
|
11938
|
+
}
|
|
11939
|
+
case 124:
|
|
11940
|
+
case 125:
|
|
11941
|
+
{
|
|
11942
|
+
if (this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()) {
|
|
11943
|
+
const token = this.state.type;
|
|
11944
|
+
const node = this.startNode();
|
|
11945
|
+
this.next();
|
|
11946
|
+
const declaration = token === 125 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators);
|
|
11947
|
+
if (declaration) {
|
|
11948
|
+
if (token === 125) {
|
|
11949
|
+
declaration.declare = true;
|
|
11950
|
+
}
|
|
11951
|
+
return declaration;
|
|
11952
|
+
} else {
|
|
11953
|
+
node.expression = this.createIdentifier(this.startNodeAt(node.loc.start), token === 125 ? "declare" : "abstract");
|
|
11954
|
+
this.semicolon(false);
|
|
11955
|
+
return this.finishNode(node, "ExpressionStatement");
|
|
11956
|
+
}
|
|
11957
|
+
}
|
|
11958
|
+
break;
|
|
11959
|
+
}
|
|
11960
|
+
case 126:
|
|
11961
|
+
return this.tsParseEnumDeclaration(this.startNode());
|
|
11962
|
+
case 112:
|
|
11963
|
+
{
|
|
11964
|
+
const nextCh = this.lookaheadCharCode();
|
|
11965
|
+
if (nextCh === 123) {
|
|
11966
|
+
const node = this.startNode();
|
|
11967
|
+
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
11968
|
+
}
|
|
11969
|
+
break;
|
|
11970
|
+
}
|
|
11971
|
+
case 129:
|
|
11972
|
+
{
|
|
11973
|
+
const result = this.tsParseInterfaceDeclaration(this.startNode());
|
|
11974
|
+
if (result) return result;
|
|
11975
|
+
break;
|
|
11976
|
+
}
|
|
11977
|
+
case 127:
|
|
11978
|
+
{
|
|
11979
|
+
if (this.nextTokenIsIdentifierOrStringLiteralOnSameLine()) {
|
|
11980
|
+
const node = this.startNode();
|
|
11981
|
+
this.next();
|
|
11982
|
+
return this.tsParseDeclaration(node, 127, false, decorators);
|
|
11983
|
+
}
|
|
11984
|
+
break;
|
|
11985
|
+
}
|
|
11986
|
+
case 128:
|
|
11987
|
+
{
|
|
11988
|
+
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
11989
|
+
const node = this.startNode();
|
|
11990
|
+
this.next();
|
|
11991
|
+
return this.tsParseDeclaration(node, 128, false, decorators);
|
|
11992
|
+
}
|
|
11993
|
+
break;
|
|
11994
|
+
}
|
|
11995
|
+
case 130:
|
|
11996
|
+
{
|
|
11997
|
+
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
11998
|
+
const node = this.startNode();
|
|
11999
|
+
this.next();
|
|
12000
|
+
return this.tsParseTypeAliasDeclaration(node);
|
|
12001
|
+
}
|
|
12002
|
+
break;
|
|
12003
|
+
}
|
|
12004
|
+
}
|
|
11968
12005
|
}
|
|
11969
12006
|
return super.parseStatementContent(flags, decorators);
|
|
11970
12007
|
}
|
|
@@ -12048,10 +12085,6 @@ function requireLib () {
|
|
|
12048
12085
|
this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
|
|
12049
12086
|
}
|
|
12050
12087
|
}
|
|
12051
|
-
parseExpressionStatement(node, expr, decorators) {
|
|
12052
|
-
const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined;
|
|
12053
|
-
return decl || super.parseExpressionStatement(node, expr, decorators);
|
|
12054
|
-
}
|
|
12055
12088
|
shouldParseExportDeclaration() {
|
|
12056
12089
|
if (this.tsIsDeclarationStart()) return true;
|
|
12057
12090
|
return super.shouldParseExportDeclaration();
|
|
@@ -12376,7 +12409,7 @@ function requireLib () {
|
|
|
12376
12409
|
super.checkToRestConversion(node, allowPattern);
|
|
12377
12410
|
}
|
|
12378
12411
|
}
|
|
12379
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
12412
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
12380
12413
|
switch (type) {
|
|
12381
12414
|
case "TSTypeCastExpression":
|
|
12382
12415
|
return true;
|
|
@@ -12389,7 +12422,7 @@ function requireLib () {
|
|
|
12389
12422
|
case "TSTypeAssertion":
|
|
12390
12423
|
return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true];
|
|
12391
12424
|
default:
|
|
12392
|
-
return super.isValidLVal(type, isUnparenthesizedInAssign, binding);
|
|
12425
|
+
return super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding);
|
|
12393
12426
|
}
|
|
12394
12427
|
}
|
|
12395
12428
|
parseBindingAtom() {
|
|
@@ -12551,10 +12584,11 @@ function requireLib () {
|
|
|
12551
12584
|
node.abstract = true;
|
|
12552
12585
|
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
|
|
12553
12586
|
return this.tsParseInterfaceDeclaration(node);
|
|
12587
|
+
} else {
|
|
12588
|
+
return null;
|
|
12554
12589
|
}
|
|
12555
|
-
} else {
|
|
12556
|
-
this.unexpected(null, 80);
|
|
12557
12590
|
}
|
|
12591
|
+
throw this.unexpected(null, 80);
|
|
12558
12592
|
}
|
|
12559
12593
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
12560
12594
|
const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
|
@@ -12770,6 +12804,32 @@ function requireLib () {
|
|
|
12770
12804
|
return;
|
|
12771
12805
|
}
|
|
12772
12806
|
}
|
|
12807
|
+
chStartsBindingIdentifierAndNotRelationalOperator(ch, pos) {
|
|
12808
|
+
if (isIdentifierStart(ch)) {
|
|
12809
|
+
keywordAndTSRelationalOperator.lastIndex = pos;
|
|
12810
|
+
if (keywordAndTSRelationalOperator.test(this.input)) {
|
|
12811
|
+
const endCh = this.codePointAtPos(keywordAndTSRelationalOperator.lastIndex);
|
|
12812
|
+
if (!isIdentifierChar(endCh) && endCh !== 92) {
|
|
12813
|
+
return false;
|
|
12814
|
+
}
|
|
12815
|
+
}
|
|
12816
|
+
return true;
|
|
12817
|
+
} else if (ch === 92) {
|
|
12818
|
+
return true;
|
|
12819
|
+
} else {
|
|
12820
|
+
return false;
|
|
12821
|
+
}
|
|
12822
|
+
}
|
|
12823
|
+
nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine() {
|
|
12824
|
+
const next = this.nextTokenInLineStart();
|
|
12825
|
+
const nextCh = this.codePointAtPos(next);
|
|
12826
|
+
return this.chStartsBindingIdentifierAndNotRelationalOperator(nextCh, next);
|
|
12827
|
+
}
|
|
12828
|
+
nextTokenIsIdentifierOrStringLiteralOnSameLine() {
|
|
12829
|
+
const next = this.nextTokenInLineStart();
|
|
12830
|
+
const nextCh = this.codePointAtPos(next);
|
|
12831
|
+
return this.chStartsBindingIdentifier(nextCh, next) || nextCh === 34 || nextCh === 39;
|
|
12832
|
+
}
|
|
12773
12833
|
};
|
|
12774
12834
|
function isPossiblyLiteralEnum(expression) {
|
|
12775
12835
|
if (expression.type !== "MemberExpression") return false;
|
|
@@ -12898,8 +12958,8 @@ function requireLib () {
|
|
|
12898
12958
|
parseBindingAtom() {
|
|
12899
12959
|
return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
|
|
12900
12960
|
}
|
|
12901
|
-
isValidLVal(type, isParenthesized, binding) {
|
|
12902
|
-
return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding);
|
|
12961
|
+
isValidLVal(type, disallowCallExpression, isParenthesized, binding) {
|
|
12962
|
+
return type === "Placeholder" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding);
|
|
12903
12963
|
}
|
|
12904
12964
|
toAssignable(node, isLHS) {
|
|
12905
12965
|
if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
|
|
@@ -13299,7 +13359,7 @@ function requireLib () {
|
|
|
13299
13359
|
}
|
|
13300
13360
|
this.next();
|
|
13301
13361
|
node.right = this.parseMaybeAssign();
|
|
13302
|
-
this.checkLVal(left, this.finishNode(node, "AssignmentExpression"));
|
|
13362
|
+
this.checkLVal(left, this.finishNode(node, "AssignmentExpression"), undefined, undefined, undefined, undefined, operator === "||=" || operator === "&&=" || operator === "??=");
|
|
13303
13363
|
return node;
|
|
13304
13364
|
} else if (ownExpressionErrors) {
|
|
13305
13365
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
@@ -13773,7 +13833,7 @@ function requireLib () {
|
|
|
13773
13833
|
}
|
|
13774
13834
|
case 0:
|
|
13775
13835
|
{
|
|
13776
|
-
return this.parseArrayLike(3,
|
|
13836
|
+
return this.parseArrayLike(3, false, refExpressionErrors);
|
|
13777
13837
|
}
|
|
13778
13838
|
case 5:
|
|
13779
13839
|
{
|
|
@@ -13830,25 +13890,22 @@ function requireLib () {
|
|
|
13830
13890
|
if (pipeProposal) {
|
|
13831
13891
|
return this.parseTopicReference(pipeProposal);
|
|
13832
13892
|
}
|
|
13833
|
-
this.unexpected();
|
|
13834
|
-
break;
|
|
13893
|
+
throw this.unexpected();
|
|
13835
13894
|
}
|
|
13836
13895
|
case 47:
|
|
13837
13896
|
{
|
|
13838
13897
|
const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
|
|
13839
13898
|
if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
|
|
13840
|
-
this.expectOnePlugin(["jsx", "flow", "typescript"]);
|
|
13841
|
-
} else {
|
|
13842
|
-
this.unexpected();
|
|
13899
|
+
throw this.expectOnePlugin(["jsx", "flow", "typescript"]);
|
|
13843
13900
|
}
|
|
13844
|
-
|
|
13901
|
+
throw this.unexpected();
|
|
13845
13902
|
}
|
|
13846
13903
|
default:
|
|
13847
13904
|
{
|
|
13848
13905
|
if (type === 137) {
|
|
13849
13906
|
return this.parseDecimalLiteral(this.state.value);
|
|
13850
13907
|
} else if (type === 2 || type === 1) {
|
|
13851
|
-
return this.parseArrayLike(this.state.type === 2 ? 4 : 3,
|
|
13908
|
+
return this.parseArrayLike(this.state.type === 2 ? 4 : 3, true);
|
|
13852
13909
|
} else if (type === 6 || type === 7) {
|
|
13853
13910
|
return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);
|
|
13854
13911
|
}
|
|
@@ -13885,7 +13942,7 @@ function requireLib () {
|
|
|
13885
13942
|
}
|
|
13886
13943
|
return id;
|
|
13887
13944
|
} else {
|
|
13888
|
-
this.unexpected();
|
|
13945
|
+
throw this.unexpected();
|
|
13889
13946
|
}
|
|
13890
13947
|
}
|
|
13891
13948
|
}
|
|
@@ -13898,9 +13955,8 @@ function requireLib () {
|
|
|
13898
13955
|
this.state.end--;
|
|
13899
13956
|
this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);
|
|
13900
13957
|
return this.parseTopicReference(pipeProposal);
|
|
13901
|
-
} else {
|
|
13902
|
-
this.unexpected();
|
|
13903
13958
|
}
|
|
13959
|
+
throw this.unexpected();
|
|
13904
13960
|
}
|
|
13905
13961
|
parseTopicReference(pipeProposal) {
|
|
13906
13962
|
const node = this.startNode();
|
|
@@ -13976,10 +14032,18 @@ function requireLib () {
|
|
|
13976
14032
|
parseSuper() {
|
|
13977
14033
|
const node = this.startNode();
|
|
13978
14034
|
this.next();
|
|
13979
|
-
if (this.match(10) && !this.scope.allowDirectSuper
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
14035
|
+
if (this.match(10) && !this.scope.allowDirectSuper) {
|
|
14036
|
+
{
|
|
14037
|
+
if (!(this.optionFlags & 16)) {
|
|
14038
|
+
this.raise(Errors.SuperNotAllowed, node);
|
|
14039
|
+
}
|
|
14040
|
+
}
|
|
14041
|
+
} else if (!this.scope.allowSuper) {
|
|
14042
|
+
{
|
|
14043
|
+
if (!(this.optionFlags & 16)) {
|
|
14044
|
+
this.raise(Errors.UnexpectedSuper, node);
|
|
14045
|
+
}
|
|
14046
|
+
}
|
|
13983
14047
|
}
|
|
13984
14048
|
if (!this.match(10) && !this.match(0) && !this.match(16)) {
|
|
13985
14049
|
this.raise(Errors.UnsupportedSuper, node);
|
|
@@ -14493,7 +14557,7 @@ function requireLib () {
|
|
|
14493
14557
|
this.scope.exit();
|
|
14494
14558
|
return finishedNode;
|
|
14495
14559
|
}
|
|
14496
|
-
parseArrayLike(close,
|
|
14560
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
14497
14561
|
if (isTuple) {
|
|
14498
14562
|
this.expectPlugin("recordAndTuple");
|
|
14499
14563
|
}
|
|
@@ -15119,9 +15183,7 @@ function requireLib () {
|
|
|
15119
15183
|
if (!this.isContextual(107)) {
|
|
15120
15184
|
return false;
|
|
15121
15185
|
}
|
|
15122
|
-
|
|
15123
|
-
const nextCh = this.codePointAtPos(next);
|
|
15124
|
-
return this.chStartsBindingIdentifier(nextCh, next);
|
|
15186
|
+
return this.nextTokenIsIdentifierOnSameLine();
|
|
15125
15187
|
}
|
|
15126
15188
|
isForUsing() {
|
|
15127
15189
|
if (!this.isContextual(107)) {
|
|
@@ -15140,6 +15202,11 @@ function requireLib () {
|
|
|
15140
15202
|
}
|
|
15141
15203
|
return false;
|
|
15142
15204
|
}
|
|
15205
|
+
nextTokenIsIdentifierOnSameLine() {
|
|
15206
|
+
const next = this.nextTokenInLineStart();
|
|
15207
|
+
const nextCh = this.codePointAtPos(next);
|
|
15208
|
+
return this.chStartsBindingIdentifier(nextCh, next);
|
|
15209
|
+
}
|
|
15143
15210
|
isAwaitUsing() {
|
|
15144
15211
|
if (!this.isContextual(96)) {
|
|
15145
15212
|
return false;
|
|
@@ -16282,7 +16349,7 @@ function requireLib () {
|
|
|
16282
16349
|
this.sawUnambiguousESM = true;
|
|
16283
16350
|
return this.finishNode(node2, "ExportDefaultDeclaration");
|
|
16284
16351
|
}
|
|
16285
|
-
this.unexpected(null, 5);
|
|
16352
|
+
throw this.unexpected(null, 5);
|
|
16286
16353
|
}
|
|
16287
16354
|
eatExportStar(node) {
|
|
16288
16355
|
return this.eat(55);
|
|
@@ -16874,54 +16941,54 @@ function requireLib () {
|
|
|
16874
16941
|
}
|
|
16875
16942
|
class Parser extends StatementParser {
|
|
16876
16943
|
constructor(options, input, pluginsMap) {
|
|
16877
|
-
|
|
16878
|
-
super(
|
|
16879
|
-
this.options =
|
|
16944
|
+
const normalizedOptions = getOptions(options);
|
|
16945
|
+
super(normalizedOptions, input);
|
|
16946
|
+
this.options = normalizedOptions;
|
|
16880
16947
|
this.initializeScopes();
|
|
16881
16948
|
this.plugins = pluginsMap;
|
|
16882
|
-
this.filename =
|
|
16883
|
-
this.startIndex =
|
|
16949
|
+
this.filename = normalizedOptions.sourceFilename;
|
|
16950
|
+
this.startIndex = normalizedOptions.startIndex;
|
|
16884
16951
|
let optionFlags = 0;
|
|
16885
|
-
if (
|
|
16952
|
+
if (normalizedOptions.allowAwaitOutsideFunction) {
|
|
16886
16953
|
optionFlags |= 1;
|
|
16887
16954
|
}
|
|
16888
|
-
if (
|
|
16955
|
+
if (normalizedOptions.allowReturnOutsideFunction) {
|
|
16889
16956
|
optionFlags |= 2;
|
|
16890
16957
|
}
|
|
16891
|
-
if (
|
|
16958
|
+
if (normalizedOptions.allowImportExportEverywhere) {
|
|
16892
16959
|
optionFlags |= 8;
|
|
16893
16960
|
}
|
|
16894
|
-
if (
|
|
16961
|
+
if (normalizedOptions.allowSuperOutsideMethod) {
|
|
16895
16962
|
optionFlags |= 16;
|
|
16896
16963
|
}
|
|
16897
|
-
if (
|
|
16964
|
+
if (normalizedOptions.allowUndeclaredExports) {
|
|
16898
16965
|
optionFlags |= 64;
|
|
16899
16966
|
}
|
|
16900
|
-
if (
|
|
16967
|
+
if (normalizedOptions.allowNewTargetOutsideFunction) {
|
|
16901
16968
|
optionFlags |= 4;
|
|
16902
16969
|
}
|
|
16903
|
-
if (
|
|
16970
|
+
if (normalizedOptions.allowYieldOutsideFunction) {
|
|
16904
16971
|
optionFlags |= 32;
|
|
16905
16972
|
}
|
|
16906
|
-
if (
|
|
16973
|
+
if (normalizedOptions.ranges) {
|
|
16907
16974
|
optionFlags |= 128;
|
|
16908
16975
|
}
|
|
16909
|
-
if (
|
|
16976
|
+
if (normalizedOptions.tokens) {
|
|
16910
16977
|
optionFlags |= 256;
|
|
16911
16978
|
}
|
|
16912
|
-
if (
|
|
16979
|
+
if (normalizedOptions.createImportExpressions) {
|
|
16913
16980
|
optionFlags |= 512;
|
|
16914
16981
|
}
|
|
16915
|
-
if (
|
|
16982
|
+
if (normalizedOptions.createParenthesizedExpressions) {
|
|
16916
16983
|
optionFlags |= 1024;
|
|
16917
16984
|
}
|
|
16918
|
-
if (
|
|
16985
|
+
if (normalizedOptions.errorRecovery) {
|
|
16919
16986
|
optionFlags |= 2048;
|
|
16920
16987
|
}
|
|
16921
|
-
if (
|
|
16988
|
+
if (normalizedOptions.attachComment) {
|
|
16922
16989
|
optionFlags |= 4096;
|
|
16923
16990
|
}
|
|
16924
|
-
if (
|
|
16991
|
+
if (normalizedOptions.annexB) {
|
|
16925
16992
|
optionFlags |= 8192;
|
|
16926
16993
|
}
|
|
16927
16994
|
this.optionFlags = optionFlags;
|
|
@@ -16935,10 +17002,10 @@ function requireLib () {
|
|
|
16935
17002
|
const program = this.startNode();
|
|
16936
17003
|
this.nextToken();
|
|
16937
17004
|
file.errors = null;
|
|
16938
|
-
this.parseTopLevel(file, program);
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
return
|
|
17005
|
+
const result = this.parseTopLevel(file, program);
|
|
17006
|
+
result.errors = this.state.errors;
|
|
17007
|
+
result.comments.length = this.state.commentsLen;
|
|
17008
|
+
return result;
|
|
16942
17009
|
}
|
|
16943
17010
|
}
|
|
16944
17011
|
function parse(input, options) {
|
|
@@ -23614,14 +23681,17 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
23614
23681
|
knownIds
|
|
23615
23682
|
);
|
|
23616
23683
|
const children = [];
|
|
23684
|
+
const isTSNode = TS_NODE_TYPES.includes(ast.type);
|
|
23617
23685
|
ids.sort((a, b) => a.start - b.start);
|
|
23618
23686
|
ids.forEach((id, i) => {
|
|
23619
23687
|
const start = id.start - 1;
|
|
23620
23688
|
const end = id.end - 1;
|
|
23621
23689
|
const last = ids[i - 1];
|
|
23622
|
-
|
|
23623
|
-
|
|
23624
|
-
|
|
23690
|
+
if (!(isTSNode && i === 0)) {
|
|
23691
|
+
const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
|
|
23692
|
+
if (leadingText.length || id.prefix) {
|
|
23693
|
+
children.push(leadingText + (id.prefix || ``));
|
|
23694
|
+
}
|
|
23625
23695
|
}
|
|
23626
23696
|
const source = rawExp.slice(start, end);
|
|
23627
23697
|
children.push(
|
|
@@ -23636,7 +23706,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
23636
23706
|
id.isConstant ? 3 : 0
|
|
23637
23707
|
)
|
|
23638
23708
|
);
|
|
23639
|
-
if (i === ids.length - 1 && end < rawExp.length) {
|
|
23709
|
+
if (i === ids.length - 1 && end < rawExp.length && !isTSNode) {
|
|
23640
23710
|
children.push(rawExp.slice(end));
|
|
23641
23711
|
}
|
|
23642
23712
|
});
|
|
@@ -25444,7 +25514,8 @@ const transformMemo = (node, context) => {
|
|
|
25444
25514
|
const transformVBindShorthand = (node, context) => {
|
|
25445
25515
|
if (node.type === 1) {
|
|
25446
25516
|
for (const prop of node.props) {
|
|
25447
|
-
if (prop.type === 7 && prop.name === "bind" && !prop.exp
|
|
25517
|
+
if (prop.type === 7 && prop.name === "bind" && (!prop.exp || // #13930 :foo in in-DOM templates will be parsed into :foo="" by browser
|
|
25518
|
+
false) && prop.arg) {
|
|
25448
25519
|
const arg = prop.arg;
|
|
25449
25520
|
if (arg.type !== 4 || !arg.isStatic) {
|
|
25450
25521
|
context.onError(
|
|
@@ -32152,7 +32223,7 @@ const ssrTransformElement = (node, context) => {
|
|
|
32152
32223
|
);
|
|
32153
32224
|
if (node.tag === "textarea") {
|
|
32154
32225
|
const existingText = node.children[0];
|
|
32155
|
-
if (!existingText || existingText.type !== 5) {
|
|
32226
|
+
if (!hasContentOverrideDirective(node) && (!existingText || existingText.type !== 5)) {
|
|
32156
32227
|
const tempId = `_temp${context.temps++}`;
|
|
32157
32228
|
propsExp.arguments = [
|
|
32158
32229
|
createAssignmentExpression(
|
|
@@ -32199,8 +32270,7 @@ const ssrTransformElement = (node, context) => {
|
|
|
32199
32270
|
];
|
|
32200
32271
|
}
|
|
32201
32272
|
} else if (directives.length && !node.children.length) {
|
|
32202
|
-
|
|
32203
|
-
if (!vText) {
|
|
32273
|
+
if (!hasContentOverrideDirective(node)) {
|
|
32204
32274
|
const tempId = `_temp${context.temps++}`;
|
|
32205
32275
|
propsExp.arguments = [
|
|
32206
32276
|
createAssignmentExpression(
|
|
@@ -32414,6 +32484,9 @@ function findVModel(node) {
|
|
|
32414
32484
|
(p) => p.type === 7 && p.name === "model" && p.exp
|
|
32415
32485
|
);
|
|
32416
32486
|
}
|
|
32487
|
+
function hasContentOverrideDirective(node) {
|
|
32488
|
+
return !!findDir(node, "text") || !!findDir(node, "html");
|
|
32489
|
+
}
|
|
32417
32490
|
function ssrProcessElement(node, context) {
|
|
32418
32491
|
const isVoidTag = context.options.isVoidTag || NO;
|
|
32419
32492
|
const elementsToAdd = node.ssrCodegenNode.elements;
|
|
@@ -45782,6 +45855,9 @@ function getImportedName(specifier) {
|
|
|
45782
45855
|
function getId(node) {
|
|
45783
45856
|
return node.type === "Identifier" ? node.name : node.type === "StringLiteral" ? node.value : null;
|
|
45784
45857
|
}
|
|
45858
|
+
function getStringLiteralKey(node) {
|
|
45859
|
+
return node.computed ? node.key.type === "TemplateLiteral" && !node.key.expressions.length ? node.key.quasis.map((q) => q.value.cooked).join("") : null : node.key.type === "Identifier" ? node.key.name : node.key.type === "StringLiteral" ? node.key.value : node.key.type === "NumericLiteral" ? String(node.key.value) : null;
|
|
45860
|
+
}
|
|
45785
45861
|
const normalize = (path.posix || path).normalize;
|
|
45786
45862
|
const windowsSlashRE = /\\/g;
|
|
45787
45863
|
function normalizePath(p) {
|
|
@@ -47701,13 +47777,9 @@ function typeElementsToMap(ctx, elements, scope = ctxToScope(ctx), typeParameter
|
|
|
47701
47777
|
Object.assign(scope.types, typeParameters);
|
|
47702
47778
|
}
|
|
47703
47779
|
e._ownerScope = scope;
|
|
47704
|
-
const name =
|
|
47705
|
-
if (name
|
|
47780
|
+
const name = getStringLiteralKey(e);
|
|
47781
|
+
if (name !== null) {
|
|
47706
47782
|
res.props[name] = e;
|
|
47707
|
-
} else if (e.key.type === "TemplateLiteral") {
|
|
47708
|
-
for (const key of resolveTemplateKeys(ctx, e.key, scope)) {
|
|
47709
|
-
res.props[key] = e;
|
|
47710
|
-
}
|
|
47711
47783
|
} else {
|
|
47712
47784
|
ctx.error(
|
|
47713
47785
|
`Unsupported computed key in type referenced by a macro`,
|
|
@@ -48105,7 +48177,7 @@ function registerTS(_loadTS) {
|
|
|
48105
48177
|
} catch (err) {
|
|
48106
48178
|
if (typeof err.message === "string" && err.message.includes("Cannot find module")) {
|
|
48107
48179
|
throw new Error(
|
|
48108
|
-
'Failed to load TypeScript, which is required for resolving imported types. Please make sure "
|
|
48180
|
+
'Failed to load TypeScript, which is required for resolving imported types. Please make sure "TypeScript" is installed as a project dependency.'
|
|
48109
48181
|
);
|
|
48110
48182
|
} else {
|
|
48111
48183
|
throw new Error(
|
|
@@ -48903,7 +48975,7 @@ function ctorToType(ctorType) {
|
|
|
48903
48975
|
}
|
|
48904
48976
|
function findStaticPropertyType(node, key) {
|
|
48905
48977
|
const prop = node.members.find(
|
|
48906
|
-
(m) => m.type === "TSPropertySignature" &&
|
|
48978
|
+
(m) => m.type === "TSPropertySignature" && getStringLiteralKey(m) === key && m.typeAnnotation
|
|
48907
48979
|
);
|
|
48908
48980
|
return prop && prop.typeAnnotation.typeAnnotation;
|
|
48909
48981
|
}
|
|
@@ -50561,7 +50633,7 @@ var __spreadValues = (a, b) => {
|
|
|
50561
50633
|
}
|
|
50562
50634
|
return a;
|
|
50563
50635
|
};
|
|
50564
|
-
const version = "3.5.
|
|
50636
|
+
const version = "3.5.23";
|
|
50565
50637
|
const parseCache = parseCache$1;
|
|
50566
50638
|
const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
|
|
50567
50639
|
const walk = walk$2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-sfc",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.23",
|
|
4
4
|
"description": "@vue/compiler-sfc",
|
|
5
5
|
"main": "dist/compiler-sfc.cjs.js",
|
|
6
6
|
"module": "dist/compiler-sfc.esm-browser.js",
|
|
@@ -42,26 +42,26 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-sfc#readme",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@babel/parser": "^7.28.
|
|
45
|
+
"@babel/parser": "^7.28.5",
|
|
46
46
|
"estree-walker": "^2.0.2",
|
|
47
|
-
"magic-string": "^0.30.
|
|
47
|
+
"magic-string": "^0.30.21",
|
|
48
48
|
"postcss": "^8.5.6",
|
|
49
49
|
"source-map-js": "^1.2.1",
|
|
50
|
-
"@vue/compiler-core": "3.5.
|
|
51
|
-
"@vue/compiler-
|
|
52
|
-
"@vue/
|
|
53
|
-
"@vue/
|
|
50
|
+
"@vue/compiler-core": "3.5.23",
|
|
51
|
+
"@vue/compiler-dom": "3.5.23",
|
|
52
|
+
"@vue/compiler-ssr": "3.5.23",
|
|
53
|
+
"@vue/shared": "3.5.23"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/types": "^7.28.
|
|
56
|
+
"@babel/types": "^7.28.5",
|
|
57
57
|
"@vue/consolidate": "^1.0.0",
|
|
58
58
|
"hash-sum": "^2.0.0",
|
|
59
59
|
"lru-cache": "10.1.0",
|
|
60
60
|
"merge-source-map": "^1.1.0",
|
|
61
|
-
"minimatch": "~10.
|
|
61
|
+
"minimatch": "~10.1.1",
|
|
62
62
|
"postcss-modules": "^6.0.1",
|
|
63
63
|
"postcss-selector-parser": "^7.1.0",
|
|
64
64
|
"pug": "^3.0.3",
|
|
65
|
-
"sass": "^1.93.
|
|
65
|
+
"sass": "^1.93.3"
|
|
66
66
|
}
|
|
67
67
|
}
|