babel-plugin-react-compiler 19.0.0-beta-0dec889-20241115 → 19.0.0-beta-df7b47d-20241124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +606 -329
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -7933,7 +7933,8 @@ function requireTokenMap$1() {
|
|
7933
7933
|
}
|
7934
7934
|
const indexes = [];
|
7935
7935
|
for (const child of children) {
|
7936
|
-
if (
|
7936
|
+
if (child == null) continue;
|
7937
|
+
if (child.start == null || child.end == null) continue;
|
7937
7938
|
const childTok = this._findTokensOfNode(child, low, last);
|
7938
7939
|
const high = childTok.first;
|
7939
7940
|
for (let k = low; k < high; k++) indexes.push(k);
|
@@ -13831,7 +13832,7 @@ function requireLib$k() {
|
|
13831
13832
|
: picocolors.isColorSupported;
|
13832
13833
|
}
|
13833
13834
|
const compose = (f, g) => v => f(g(v));
|
13834
|
-
function
|
13835
|
+
function buildDefs(colors) {
|
13835
13836
|
return {
|
13836
13837
|
keyword: colors.cyan,
|
13837
13838
|
capitalized: colors.yellow,
|
@@ -13848,8 +13849,8 @@ function requireLib$k() {
|
|
13848
13849
|
reset: colors.reset,
|
13849
13850
|
};
|
13850
13851
|
}
|
13851
|
-
const defsOn =
|
13852
|
-
const defsOff =
|
13852
|
+
const defsOn = buildDefs(picocolors.createColors(true));
|
13853
|
+
const defsOff = buildDefs(picocolors.createColors(false));
|
13853
13854
|
function getDefs(enabled) {
|
13854
13855
|
return enabled ? defsOn : defsOff;
|
13855
13856
|
}
|
@@ -15857,6 +15858,7 @@ function requireLib$j() {
|
|
15857
15858
|
_type: createKeywordLike('type', {startsExpr: startsExpr}),
|
15858
15859
|
_opaque: createKeywordLike('opaque', {startsExpr: startsExpr}),
|
15859
15860
|
name: createToken('name', {startsExpr: startsExpr}),
|
15861
|
+
placeholder: createToken('%%', {startsExpr: true}),
|
15860
15862
|
string: createToken('string', {startsExpr: startsExpr}),
|
15861
15863
|
num: createToken('num', {startsExpr: startsExpr}),
|
15862
15864
|
bigint: createToken('bigint', {startsExpr: startsExpr}),
|
@@ -15868,19 +15870,18 @@ function requireLib$j() {
|
|
15868
15870
|
jsxText: createToken('jsxText', {beforeExpr: true}),
|
15869
15871
|
jsxTagStart: createToken('jsxTagStart', {startsExpr: true}),
|
15870
15872
|
jsxTagEnd: createToken('jsxTagEnd'),
|
15871
|
-
placeholder: createToken('%%', {startsExpr: true}),
|
15872
15873
|
};
|
15873
15874
|
function tokenIsIdentifier(token) {
|
15874
|
-
return token >= 93 && token <=
|
15875
|
+
return token >= 93 && token <= 133;
|
15875
15876
|
}
|
15876
15877
|
function tokenKeywordOrIdentifierIsKeyword(token) {
|
15877
15878
|
return token <= 92;
|
15878
15879
|
}
|
15879
15880
|
function tokenIsKeywordOrIdentifier(token) {
|
15880
|
-
return token >= 58 && token <=
|
15881
|
+
return token >= 58 && token <= 133;
|
15881
15882
|
}
|
15882
15883
|
function tokenIsLiteralPropertyName(token) {
|
15883
|
-
return token >= 58 && token <=
|
15884
|
+
return token >= 58 && token <= 137;
|
15884
15885
|
}
|
15885
15886
|
function tokenComesBeforeExpression(token) {
|
15886
15887
|
return tokenBeforeExprs[token];
|
@@ -15947,7 +15948,7 @@ function requireLib$j() {
|
|
15947
15948
|
context.push(types.template);
|
15948
15949
|
}
|
15949
15950
|
};
|
15950
|
-
tokenTypes[
|
15951
|
+
tokenTypes[143].updateContext = context => {
|
15951
15952
|
context.push(types.j_expr, types.j_oTag);
|
15952
15953
|
};
|
15953
15954
|
}
|
@@ -16636,7 +16637,7 @@ function requireLib$j() {
|
|
16636
16637
|
this.commentsLen = 0;
|
16637
16638
|
this.commentStack = [];
|
16638
16639
|
this.pos = 0;
|
16639
|
-
this.type =
|
16640
|
+
this.type = 140;
|
16640
16641
|
this.value = null;
|
16641
16642
|
this.start = 0;
|
16642
16643
|
this.end = 0;
|
@@ -16761,8 +16762,11 @@ function requireLib$j() {
|
|
16761
16762
|
else this.flags &= -4097;
|
16762
16763
|
}
|
16763
16764
|
curPosition() {
|
16764
|
-
|
16765
|
-
|
16765
|
+
return new Position(
|
16766
|
+
this.curLine,
|
16767
|
+
this.pos - this.lineStart,
|
16768
|
+
this.pos + this.startIndex
|
16769
|
+
);
|
16766
16770
|
}
|
16767
16771
|
clone() {
|
16768
16772
|
const state = new State();
|
@@ -17134,10 +17138,11 @@ function requireLib$j() {
|
|
17134
17138
|
const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);
|
17135
17139
|
class Token {
|
17136
17140
|
constructor(state) {
|
17141
|
+
const startIndex = state.startIndex || 0;
|
17137
17142
|
this.type = state.type;
|
17138
17143
|
this.value = state.value;
|
17139
|
-
this.start = state.start;
|
17140
|
-
this.end = state.end;
|
17144
|
+
this.start = startIndex + state.start;
|
17145
|
+
this.end = startIndex + state.end;
|
17141
17146
|
this.loc = new SourceLocation(state.startLoc, state.endLoc);
|
17142
17147
|
}
|
17143
17148
|
}
|
@@ -17311,7 +17316,7 @@ function requireLib$j() {
|
|
17311
17316
|
this.state.start = this.state.pos;
|
17312
17317
|
if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
|
17313
17318
|
if (this.state.pos >= this.length) {
|
17314
|
-
this.finishToken(
|
17319
|
+
this.finishToken(140);
|
17315
17320
|
return;
|
17316
17321
|
}
|
17317
17322
|
this.getTokenFromCode(this.codePointAtPos(this.state.pos));
|
@@ -17334,8 +17339,8 @@ function requireLib$j() {
|
|
17334
17339
|
const comment = {
|
17335
17340
|
type: 'CommentBlock',
|
17336
17341
|
value: this.input.slice(start + 2, end),
|
17337
|
-
start: start,
|
17338
|
-
end: end + commentEnd.length,
|
17342
|
+
start: this.sourceToOffsetPos(start),
|
17343
|
+
end: this.sourceToOffsetPos(end + commentEnd.length),
|
17339
17344
|
loc: new SourceLocation(startLoc, this.state.curPosition()),
|
17340
17345
|
};
|
17341
17346
|
if (this.options.tokens) this.pushToken(comment);
|
@@ -17357,8 +17362,8 @@ function requireLib$j() {
|
|
17357
17362
|
const comment = {
|
17358
17363
|
type: 'CommentLine',
|
17359
17364
|
value: value,
|
17360
|
-
start: start,
|
17361
|
-
end: end,
|
17365
|
+
start: this.sourceToOffsetPos(start),
|
17366
|
+
end: this.sourceToOffsetPos(end),
|
17362
17367
|
loc: new SourceLocation(startLoc, this.state.curPosition()),
|
17363
17368
|
};
|
17364
17369
|
if (this.options.tokens) this.pushToken(comment);
|
@@ -17503,10 +17508,10 @@ function requireLib$j() {
|
|
17503
17508
|
}
|
17504
17509
|
} else if (isIdentifierStart(next)) {
|
17505
17510
|
++this.state.pos;
|
17506
|
-
this.finishToken(
|
17511
|
+
this.finishToken(139, this.readWord1(next));
|
17507
17512
|
} else if (next === 92) {
|
17508
17513
|
++this.state.pos;
|
17509
|
-
this.finishToken(
|
17514
|
+
this.finishToken(139, this.readWord1());
|
17510
17515
|
} else {
|
17511
17516
|
this.finishOp(27, 1);
|
17512
17517
|
}
|
@@ -17954,7 +17959,7 @@ function requireLib$j() {
|
|
17954
17959
|
mods += char;
|
17955
17960
|
}
|
17956
17961
|
this.state.pos = pos;
|
17957
|
-
this.finishToken(
|
17962
|
+
this.finishToken(138, {pattern: content, flags: mods});
|
17958
17963
|
}
|
17959
17964
|
readInt(radix, len, forceLen = false, allowNumSeparator = true) {
|
17960
17965
|
const {n: n, pos: pos} = readInt(
|
@@ -17999,10 +18004,10 @@ function requireLib$j() {
|
|
17999
18004
|
const str = this.input
|
18000
18005
|
.slice(start, this.state.pos)
|
18001
18006
|
.replace(/[_n]/g, '');
|
18002
|
-
this.finishToken(
|
18007
|
+
this.finishToken(136, str);
|
18003
18008
|
return;
|
18004
18009
|
}
|
18005
|
-
this.finishToken(
|
18010
|
+
this.finishToken(135, val);
|
18006
18011
|
}
|
18007
18012
|
readNumber(startsWithDot) {
|
18008
18013
|
const start = this.state.pos;
|
@@ -18069,15 +18074,15 @@ function requireLib$j() {
|
|
18069
18074
|
}
|
18070
18075
|
const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, '');
|
18071
18076
|
if (isBigInt) {
|
18072
|
-
this.finishToken(
|
18077
|
+
this.finishToken(136, str);
|
18073
18078
|
return;
|
18074
18079
|
}
|
18075
18080
|
if (isDecimal) {
|
18076
|
-
this.finishToken(
|
18081
|
+
this.finishToken(137, str);
|
18077
18082
|
return;
|
18078
18083
|
}
|
18079
18084
|
const val = isOctal ? parseInt(str, 8) : parseFloat(str);
|
18080
|
-
this.finishToken(
|
18085
|
+
this.finishToken(135, val);
|
18081
18086
|
}
|
18082
18087
|
readCodePoint(throwOnInvalid) {
|
18083
18088
|
const {code: code, pos: pos} = readCodePoint(
|
@@ -18108,7 +18113,7 @@ function requireLib$j() {
|
|
18108
18113
|
this.state.pos = pos + 1;
|
18109
18114
|
this.state.lineStart = lineStart;
|
18110
18115
|
this.state.curLine = curLine;
|
18111
|
-
this.finishToken(
|
18116
|
+
this.finishToken(134, str);
|
18112
18117
|
}
|
18113
18118
|
readTemplateContinuation() {
|
18114
18119
|
if (!this.match(8)) {
|
@@ -18140,7 +18145,7 @@ function requireLib$j() {
|
|
18140
18145
|
this.state.firstInvalidTemplateEscapePos = new Position(
|
18141
18146
|
firstInvalidLoc.curLine,
|
18142
18147
|
firstInvalidLoc.pos - firstInvalidLoc.lineStart,
|
18143
|
-
firstInvalidLoc.pos
|
18148
|
+
this.sourceToOffsetPos(firstInvalidLoc.pos)
|
18144
18149
|
);
|
18145
18150
|
}
|
18146
18151
|
if (this.input.codePointAt(pos) === 96) {
|
@@ -18524,7 +18529,7 @@ function requireLib$j() {
|
|
18524
18529
|
}
|
18525
18530
|
}
|
18526
18531
|
canInsertSemicolon() {
|
18527
|
-
return this.match(
|
18532
|
+
return this.match(140) || this.match(8) || this.hasPrecedingLineBreak();
|
18528
18533
|
}
|
18529
18534
|
hasPrecedingLineBreak() {
|
18530
18535
|
return hasNewLine(
|
@@ -18997,7 +19002,7 @@ function requireLib$j() {
|
|
18997
19002
|
);
|
18998
19003
|
}
|
18999
19004
|
finishToken(type, val) {
|
19000
|
-
if (type !==
|
19005
|
+
if (type !== 134 && type !== 13 && type !== 28) {
|
19001
19006
|
if (this.flowPragma === undefined) {
|
19002
19007
|
this.flowPragma = null;
|
19003
19008
|
}
|
@@ -19133,7 +19138,7 @@ function requireLib$j() {
|
|
19133
19138
|
}
|
19134
19139
|
flowParseDeclareModule(node) {
|
19135
19140
|
this.scope.enter(0);
|
19136
|
-
if (this.match(
|
19141
|
+
if (this.match(134)) {
|
19137
19142
|
node.id = super.parseExprAtom();
|
19138
19143
|
} else {
|
19139
19144
|
node.id = this.parseIdentifier();
|
@@ -19401,7 +19406,7 @@ function requireLib$j() {
|
|
19401
19406
|
const node = this.startNode();
|
19402
19407
|
node.params = [];
|
19403
19408
|
this.state.inType = true;
|
19404
|
-
if (this.match(47) || this.match(
|
19409
|
+
if (this.match(47) || this.match(143)) {
|
19405
19410
|
this.next();
|
19406
19411
|
} else {
|
19407
19412
|
this.unexpected();
|
@@ -19475,7 +19480,7 @@ function requireLib$j() {
|
|
19475
19480
|
return this.finishNode(node, 'InterfaceTypeAnnotation');
|
19476
19481
|
}
|
19477
19482
|
flowParseObjectPropertyKey() {
|
19478
|
-
return this.match(
|
19483
|
+
return this.match(135) || this.match(134)
|
19479
19484
|
? super.parseExprAtom()
|
19480
19485
|
: this.parseIdentifier(true);
|
19481
19486
|
}
|
@@ -19987,7 +19992,7 @@ function requireLib$j() {
|
|
19987
19992
|
node.typeParameters = null;
|
19988
19993
|
return this.finishNode(node, 'FunctionTypeAnnotation');
|
19989
19994
|
}
|
19990
|
-
case
|
19995
|
+
case 134:
|
19991
19996
|
return this.parseLiteral(
|
19992
19997
|
this.state.value,
|
19993
19998
|
'StringLiteralTypeAnnotation'
|
@@ -20000,14 +20005,14 @@ function requireLib$j() {
|
|
20000
20005
|
case 53:
|
20001
20006
|
if (this.state.value === '-') {
|
20002
20007
|
this.next();
|
20003
|
-
if (this.match(
|
20008
|
+
if (this.match(135)) {
|
20004
20009
|
return this.parseLiteralAtNode(
|
20005
20010
|
-this.state.value,
|
20006
20011
|
'NumberLiteralTypeAnnotation',
|
20007
20012
|
node
|
20008
20013
|
);
|
20009
20014
|
}
|
20010
|
-
if (this.match(
|
20015
|
+
if (this.match(136)) {
|
20011
20016
|
return this.parseLiteralAtNode(
|
20012
20017
|
-this.state.value,
|
20013
20018
|
'BigIntLiteralTypeAnnotation',
|
@@ -20021,12 +20026,12 @@ function requireLib$j() {
|
|
20021
20026
|
}
|
20022
20027
|
this.unexpected();
|
20023
20028
|
return;
|
20024
|
-
case
|
20029
|
+
case 135:
|
20025
20030
|
return this.parseLiteral(
|
20026
20031
|
this.state.value,
|
20027
20032
|
'NumberLiteralTypeAnnotation'
|
20028
20033
|
);
|
20029
|
-
case
|
20034
|
+
case 136:
|
20030
20035
|
return this.parseLiteral(
|
20031
20036
|
this.state.value,
|
20032
20037
|
'BigIntLiteralTypeAnnotation'
|
@@ -20907,7 +20912,7 @@ function requireLib$j() {
|
|
20907
20912
|
var _jsx;
|
20908
20913
|
let state = null;
|
20909
20914
|
let jsx;
|
20910
|
-
if (this.hasPlugin('jsx') && (this.match(
|
20915
|
+
if (this.hasPlugin('jsx') && (this.match(143) || this.match(47))) {
|
20911
20916
|
state = this.state.clone();
|
20912
20917
|
jsx = this.tryParse(
|
20913
20918
|
() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),
|
@@ -21263,14 +21268,14 @@ function requireLib$j() {
|
|
21263
21268
|
const startLoc = this.state.startLoc;
|
21264
21269
|
const endOfInit = () => this.match(12) || this.match(8);
|
21265
21270
|
switch (this.state.type) {
|
21266
|
-
case
|
21271
|
+
case 135: {
|
21267
21272
|
const literal = this.parseNumericLiteral(this.state.value);
|
21268
21273
|
if (endOfInit()) {
|
21269
21274
|
return {type: 'number', loc: literal.loc.start, value: literal};
|
21270
21275
|
}
|
21271
21276
|
return {type: 'invalid', loc: startLoc};
|
21272
21277
|
}
|
21273
|
-
case
|
21278
|
+
case 134: {
|
21274
21279
|
const literal = this.parseStringLiteral(this.state.value);
|
21275
21280
|
if (endOfInit()) {
|
21276
21281
|
return {type: 'string', loc: literal.loc.start, value: literal};
|
@@ -21883,14 +21888,14 @@ function requireLib$j() {
|
|
21883
21888
|
if (this.state.pos === this.state.start) {
|
21884
21889
|
if (ch === 60 && this.state.canStartJSXElement) {
|
21885
21890
|
++this.state.pos;
|
21886
|
-
this.finishToken(
|
21891
|
+
this.finishToken(143);
|
21887
21892
|
} else {
|
21888
21893
|
super.getTokenFromCode(ch);
|
21889
21894
|
}
|
21890
21895
|
return;
|
21891
21896
|
}
|
21892
21897
|
out += this.input.slice(chunkStart, this.state.pos);
|
21893
|
-
this.finishToken(
|
21898
|
+
this.finishToken(142, out);
|
21894
21899
|
return;
|
21895
21900
|
case 38:
|
21896
21901
|
out += this.input.slice(chunkStart, this.state.pos);
|
@@ -21946,7 +21951,7 @@ function requireLib$j() {
|
|
21946
21951
|
}
|
21947
21952
|
}
|
21948
21953
|
out += this.input.slice(chunkStart, this.state.pos++);
|
21949
|
-
this.finishToken(
|
21954
|
+
this.finishToken(134, out);
|
21950
21955
|
}
|
21951
21956
|
jsxReadEntity() {
|
21952
21957
|
const startPos = ++this.state.pos;
|
@@ -21993,11 +21998,11 @@ function requireLib$j() {
|
|
21993
21998
|
do {
|
21994
21999
|
ch = this.input.charCodeAt(++this.state.pos);
|
21995
22000
|
} while (isIdentifierChar(ch) || ch === 45);
|
21996
|
-
this.finishToken(
|
22001
|
+
this.finishToken(141, this.input.slice(start, this.state.pos));
|
21997
22002
|
}
|
21998
22003
|
jsxParseIdentifier() {
|
21999
22004
|
const node = this.startNode();
|
22000
|
-
if (this.match(
|
22005
|
+
if (this.match(141)) {
|
22001
22006
|
node.name = this.state.value;
|
22002
22007
|
} else if (tokenIsKeyword(this.state.type)) {
|
22003
22008
|
node.name = tokenLabelName(this.state.type);
|
@@ -22042,8 +22047,8 @@ function requireLib$j() {
|
|
22042
22047
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
22043
22048
|
}
|
22044
22049
|
return node;
|
22045
|
-
case
|
22046
|
-
case
|
22050
|
+
case 143:
|
22051
|
+
case 134:
|
22047
22052
|
return this.parseExprAtom();
|
22048
22053
|
default:
|
22049
22054
|
throw this.raise(
|
@@ -22098,7 +22103,7 @@ function requireLib$j() {
|
|
22098
22103
|
}
|
22099
22104
|
jsxParseOpeningElementAt(startLoc) {
|
22100
22105
|
const node = this.startNodeAt(startLoc);
|
22101
|
-
if (this.eat(
|
22106
|
+
if (this.eat(144)) {
|
22102
22107
|
return this.finishNode(node, 'JSXOpeningFragment');
|
22103
22108
|
}
|
22104
22109
|
node.name = this.jsxParseElementName();
|
@@ -22106,21 +22111,21 @@ function requireLib$j() {
|
|
22106
22111
|
}
|
22107
22112
|
jsxParseOpeningElementAfterName(node) {
|
22108
22113
|
const attributes = [];
|
22109
|
-
while (!this.match(56) && !this.match(
|
22114
|
+
while (!this.match(56) && !this.match(144)) {
|
22110
22115
|
attributes.push(this.jsxParseAttribute());
|
22111
22116
|
}
|
22112
22117
|
node.attributes = attributes;
|
22113
22118
|
node.selfClosing = this.eat(56);
|
22114
|
-
this.expect(
|
22119
|
+
this.expect(144);
|
22115
22120
|
return this.finishNode(node, 'JSXOpeningElement');
|
22116
22121
|
}
|
22117
22122
|
jsxParseClosingElementAt(startLoc) {
|
22118
22123
|
const node = this.startNodeAt(startLoc);
|
22119
|
-
if (this.eat(
|
22124
|
+
if (this.eat(144)) {
|
22120
22125
|
return this.finishNode(node, 'JSXClosingFragment');
|
22121
22126
|
}
|
22122
22127
|
node.name = this.jsxParseElementName();
|
22123
|
-
this.expect(
|
22128
|
+
this.expect(144);
|
22124
22129
|
return this.finishNode(node, 'JSXClosingElement');
|
22125
22130
|
}
|
22126
22131
|
jsxParseElementAt(startLoc) {
|
@@ -22131,7 +22136,7 @@ function requireLib$j() {
|
|
22131
22136
|
if (!openingElement.selfClosing) {
|
22132
22137
|
contents: for (;;) {
|
22133
22138
|
switch (this.state.type) {
|
22134
|
-
case
|
22139
|
+
case 143:
|
22135
22140
|
startLoc = this.state.startLoc;
|
22136
22141
|
this.next();
|
22137
22142
|
if (this.eat(56)) {
|
@@ -22140,7 +22145,7 @@ function requireLib$j() {
|
|
22140
22145
|
}
|
22141
22146
|
children.push(this.jsxParseElementAt(startLoc));
|
22142
22147
|
break;
|
22143
|
-
case
|
22148
|
+
case 142:
|
22144
22149
|
children.push(this.parseLiteral(this.state.value, 'JSXText'));
|
22145
22150
|
break;
|
22146
22151
|
case 5: {
|
@@ -22215,13 +22220,13 @@ function requireLib$j() {
|
|
22215
22220
|
context[context.length - 1] = newContext;
|
22216
22221
|
}
|
22217
22222
|
parseExprAtom(refExpressionErrors) {
|
22218
|
-
if (this.match(
|
22223
|
+
if (this.match(143)) {
|
22219
22224
|
return this.jsxParseElement();
|
22220
22225
|
} else if (
|
22221
22226
|
this.match(47) &&
|
22222
22227
|
this.input.charCodeAt(this.state.pos) !== 33
|
22223
22228
|
) {
|
22224
|
-
this.replaceToken(
|
22229
|
+
this.replaceToken(143);
|
22225
22230
|
return this.jsxParseElement();
|
22226
22231
|
} else {
|
22227
22232
|
return super.parseExprAtom(refExpressionErrors);
|
@@ -22244,7 +22249,7 @@ function requireLib$j() {
|
|
22244
22249
|
}
|
22245
22250
|
if (code === 62) {
|
22246
22251
|
++this.state.pos;
|
22247
|
-
this.finishToken(
|
22252
|
+
this.finishToken(144);
|
22248
22253
|
return;
|
22249
22254
|
}
|
22250
22255
|
if ((code === 34 || code === 39) && context === types.j_oTag) {
|
@@ -22258,19 +22263,19 @@ function requireLib$j() {
|
|
22258
22263
|
this.input.charCodeAt(this.state.pos + 1) !== 33
|
22259
22264
|
) {
|
22260
22265
|
++this.state.pos;
|
22261
|
-
this.finishToken(
|
22266
|
+
this.finishToken(143);
|
22262
22267
|
return;
|
22263
22268
|
}
|
22264
22269
|
super.getTokenFromCode(code);
|
22265
22270
|
}
|
22266
22271
|
updateContext(prevType) {
|
22267
22272
|
const {context: context, type: type} = this.state;
|
22268
|
-
if (type === 56 && prevType ===
|
22273
|
+
if (type === 56 && prevType === 143) {
|
22269
22274
|
context.splice(-2, 2, types.j_cTag);
|
22270
22275
|
this.state.canStartJSXElement = false;
|
22271
|
-
} else if (type === 142) {
|
22272
|
-
context.push(types.j_oTag);
|
22273
22276
|
} else if (type === 143) {
|
22277
|
+
context.push(types.j_oTag);
|
22278
|
+
} else if (type === 144) {
|
22274
22279
|
const out = context[context.length - 1];
|
22275
22280
|
if (
|
22276
22281
|
(out === types.j_oTag && prevType === 56) ||
|
@@ -22666,7 +22671,7 @@ function requireLib$j() {
|
|
22666
22671
|
return this.parseBindingRestProperty(this.startNode());
|
22667
22672
|
}
|
22668
22673
|
const prop = this.startNode();
|
22669
|
-
if (type ===
|
22674
|
+
if (type === 139) {
|
22670
22675
|
this.expectPlugin('destructuringPrivate', startLoc);
|
22671
22676
|
this.classScope.usePrivateName(this.state.value, startLoc);
|
22672
22677
|
prop.key = this.parsePrivateName();
|
@@ -23084,7 +23089,7 @@ function requireLib$j() {
|
|
23084
23089
|
this.match(5) ||
|
23085
23090
|
this.match(55) ||
|
23086
23091
|
this.match(21) ||
|
23087
|
-
this.match(
|
23092
|
+
this.match(139) ||
|
23088
23093
|
this.isLiteralPropertyName()
|
23089
23094
|
);
|
23090
23095
|
}
|
@@ -23293,7 +23298,7 @@ function requireLib$j() {
|
|
23293
23298
|
const node = this.startNode();
|
23294
23299
|
this.expect(83);
|
23295
23300
|
this.expect(10);
|
23296
|
-
if (!this.match(
|
23301
|
+
if (!this.match(134)) {
|
23297
23302
|
this.raise(
|
23298
23303
|
TSErrors.UnsupportedImportTypeArgument,
|
23299
23304
|
this.state.startLoc
|
@@ -23374,7 +23379,7 @@ function requireLib$j() {
|
|
23374
23379
|
}
|
23375
23380
|
tsParseTypeParameters(parseModifiers) {
|
23376
23381
|
const node = this.startNode();
|
23377
|
-
if (this.match(47) || this.match(
|
23382
|
+
if (this.match(47) || this.match(143)) {
|
23378
23383
|
this.next();
|
23379
23384
|
} else {
|
23380
23385
|
this.unexpected();
|
@@ -23772,9 +23777,9 @@ function requireLib$j() {
|
|
23772
23777
|
tsParseLiteralTypeNode() {
|
23773
23778
|
const node = this.startNode();
|
23774
23779
|
switch (this.state.type) {
|
23775
|
-
case 134:
|
23776
23780
|
case 135:
|
23777
|
-
case
|
23781
|
+
case 136:
|
23782
|
+
case 134:
|
23778
23783
|
case 85:
|
23779
23784
|
case 86:
|
23780
23785
|
node.literal = super.parseExprAtom();
|
@@ -23803,9 +23808,9 @@ function requireLib$j() {
|
|
23803
23808
|
}
|
23804
23809
|
tsParseNonArrayType() {
|
23805
23810
|
switch (this.state.type) {
|
23806
|
-
case 133:
|
23807
23811
|
case 134:
|
23808
23812
|
case 135:
|
23813
|
+
case 136:
|
23809
23814
|
case 85:
|
23810
23815
|
case 86:
|
23811
23816
|
return this.tsParseLiteralTypeNode();
|
@@ -23813,7 +23818,7 @@ function requireLib$j() {
|
|
23813
23818
|
if (this.state.value === '-') {
|
23814
23819
|
const node = this.startNode();
|
23815
23820
|
const nextToken = this.lookahead();
|
23816
|
-
if (nextToken.type !==
|
23821
|
+
if (nextToken.type !== 135 && nextToken.type !== 136) {
|
23817
23822
|
this.unexpected();
|
23818
23823
|
}
|
23819
23824
|
node.literal = this.parseMaybeUnary();
|
@@ -24278,7 +24283,7 @@ function requireLib$j() {
|
|
24278
24283
|
}
|
24279
24284
|
tsParseEnumMember() {
|
24280
24285
|
const node = this.startNode();
|
24281
|
-
node.id = this.match(
|
24286
|
+
node.id = this.match(134)
|
24282
24287
|
? super.parseStringLiteral(this.state.value)
|
24283
24288
|
: this.parseIdentifier(true);
|
24284
24289
|
if (this.eat(29)) {
|
@@ -24331,7 +24336,7 @@ function requireLib$j() {
|
|
24331
24336
|
node.kind = 'global';
|
24332
24337
|
node.global = true;
|
24333
24338
|
node.id = this.parseIdentifier();
|
24334
|
-
} else if (this.match(
|
24339
|
+
} else if (this.match(134)) {
|
24335
24340
|
node.kind = 'module';
|
24336
24341
|
node.id = super.parseStringLiteral(this.state.value);
|
24337
24342
|
} else {
|
@@ -24376,7 +24381,7 @@ function requireLib$j() {
|
|
24376
24381
|
const node = this.startNode();
|
24377
24382
|
this.expectContextual(119);
|
24378
24383
|
this.expect(10);
|
24379
|
-
if (!this.match(
|
24384
|
+
if (!this.match(134)) {
|
24380
24385
|
this.unexpected();
|
24381
24386
|
}
|
24382
24387
|
node.expression = super.parseExprAtom();
|
@@ -24506,7 +24511,7 @@ function requireLib$j() {
|
|
24506
24511
|
break;
|
24507
24512
|
case 'module':
|
24508
24513
|
if (this.tsCheckLineTerminator(next)) {
|
24509
|
-
if (this.match(
|
24514
|
+
if (this.match(134)) {
|
24510
24515
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
24511
24516
|
} else if (tokenIsIdentifier(this.state.type)) {
|
24512
24517
|
node.kind = 'module';
|
@@ -24880,7 +24885,7 @@ function requireLib$j() {
|
|
24880
24885
|
}
|
24881
24886
|
}
|
24882
24887
|
parseImport(node) {
|
24883
|
-
if (this.match(
|
24888
|
+
if (this.match(134)) {
|
24884
24889
|
node.importKind = 'value';
|
24885
24890
|
return super.parseImport(node);
|
24886
24891
|
}
|
@@ -25368,7 +25373,7 @@ function requireLib$j() {
|
|
25368
25373
|
let state;
|
25369
25374
|
let jsx;
|
25370
25375
|
let typeCast;
|
25371
|
-
if (this.hasPlugin('jsx') && (this.match(
|
25376
|
+
if (this.hasPlugin('jsx') && (this.match(143) || this.match(47))) {
|
25372
25377
|
state = this.state.clone();
|
25373
25378
|
jsx = this.tryParse(
|
25374
25379
|
() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),
|
@@ -25986,13 +25991,13 @@ function requireLib$j() {
|
|
25986
25991
|
var placeholders = superClass =>
|
25987
25992
|
class PlaceholdersParserMixin extends superClass {
|
25988
25993
|
parsePlaceholder(expectedNode) {
|
25989
|
-
if (this.match(
|
25994
|
+
if (this.match(133)) {
|
25990
25995
|
const node = this.startNode();
|
25991
25996
|
this.next();
|
25992
25997
|
this.assertNoSpace();
|
25993
25998
|
node.name = super.parseIdentifier(true);
|
25994
25999
|
this.assertNoSpace();
|
25995
|
-
this.expect(
|
26000
|
+
this.expect(133);
|
25996
26001
|
return this.finishPlaceholder(node, expectedNode);
|
25997
26002
|
}
|
25998
26003
|
}
|
@@ -26006,7 +26011,7 @@ function requireLib$j() {
|
|
26006
26011
|
}
|
26007
26012
|
getTokenFromCode(code) {
|
26008
26013
|
if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
|
26009
|
-
this.finishOp(
|
26014
|
+
this.finishOp(133, 2);
|
26010
26015
|
} else {
|
26011
26016
|
super.getTokenFromCode(code);
|
26012
26017
|
}
|
@@ -26052,7 +26057,7 @@ function requireLib$j() {
|
|
26052
26057
|
return true;
|
26053
26058
|
}
|
26054
26059
|
const nextToken = this.lookahead();
|
26055
|
-
if (nextToken.type ===
|
26060
|
+
if (nextToken.type === 133) {
|
26056
26061
|
return true;
|
26057
26062
|
}
|
26058
26063
|
return false;
|
@@ -26103,7 +26108,7 @@ function requireLib$j() {
|
|
26103
26108
|
const oldStrict = this.state.strict;
|
26104
26109
|
const placeholder = this.parsePlaceholder('Identifier');
|
26105
26110
|
if (placeholder) {
|
26106
|
-
if (this.match(81) || this.match(
|
26111
|
+
if (this.match(81) || this.match(133) || this.match(5)) {
|
26107
26112
|
node.id = placeholder;
|
26108
26113
|
} else if (optionalId || !isStatement) {
|
26109
26114
|
node.id = null;
|
@@ -26151,7 +26156,7 @@ function requireLib$j() {
|
|
26151
26156
|
if (this.isUnparsedContextual(next, 'from')) {
|
26152
26157
|
if (
|
26153
26158
|
this.input.startsWith(
|
26154
|
-
tokenLabelName(
|
26159
|
+
tokenLabelName(133),
|
26155
26160
|
this.nextTokenStartSince(next + 4)
|
26156
26161
|
)
|
26157
26162
|
) {
|
@@ -26491,7 +26496,7 @@ function requireLib$j() {
|
|
26491
26496
|
this.enterInitialScopes();
|
26492
26497
|
this.nextToken();
|
26493
26498
|
const expr = this.parseExpression();
|
26494
|
-
if (!this.match(
|
26499
|
+
if (!this.match(140)) {
|
26495
26500
|
this.unexpected();
|
26496
26501
|
}
|
26497
26502
|
this.finalizeRemainingComments();
|
@@ -26630,7 +26635,7 @@ function requireLib$j() {
|
|
26630
26635
|
return expr;
|
26631
26636
|
}
|
26632
26637
|
parseMaybeUnaryOrPrivate(refExpressionErrors) {
|
26633
|
-
return this.match(
|
26638
|
+
return this.match(139)
|
26634
26639
|
? this.parsePrivateName()
|
26635
26640
|
: this.parseMaybeUnary(refExpressionErrors);
|
26636
26641
|
}
|
@@ -26906,7 +26911,7 @@ function requireLib$j() {
|
|
26906
26911
|
if (computed) {
|
26907
26912
|
node.property = this.parseExpression();
|
26908
26913
|
this.expect(3);
|
26909
|
-
} else if (this.match(
|
26914
|
+
} else if (this.match(139)) {
|
26910
26915
|
if (base.type === 'Super') {
|
26911
26916
|
this.raise(Errors.SuperPrivateField, startLoc);
|
26912
26917
|
}
|
@@ -27114,11 +27119,11 @@ function requireLib$j() {
|
|
27114
27119
|
this.readRegexp();
|
27115
27120
|
return this.parseRegExpLiteral(this.state.value);
|
27116
27121
|
}
|
27117
|
-
case 134:
|
27118
|
-
return this.parseNumericLiteral(this.state.value);
|
27119
27122
|
case 135:
|
27123
|
+
return this.parseNumericLiteral(this.state.value);
|
27124
|
+
case 136:
|
27120
27125
|
return this.parseBigIntLiteral(this.state.value);
|
27121
|
-
case
|
27126
|
+
case 134:
|
27122
27127
|
return this.parseStringLiteral(this.state.value);
|
27123
27128
|
case 84:
|
27124
27129
|
return this.parseNullLiteral();
|
@@ -27177,7 +27182,7 @@ function requireLib$j() {
|
|
27177
27182
|
throw this.raise(Errors.UnsupportedBind, callee);
|
27178
27183
|
}
|
27179
27184
|
}
|
27180
|
-
case
|
27185
|
+
case 139: {
|
27181
27186
|
this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
|
27182
27187
|
identifierName: this.state.value,
|
27183
27188
|
});
|
@@ -27216,7 +27221,7 @@ function requireLib$j() {
|
|
27216
27221
|
break;
|
27217
27222
|
}
|
27218
27223
|
default:
|
27219
|
-
if (type ===
|
27224
|
+
if (type === 137) {
|
27220
27225
|
return this.parseDecimalLiteral(this.state.value);
|
27221
27226
|
}
|
27222
27227
|
if (tokenIsIdentifier(type)) {
|
@@ -27956,16 +27961,16 @@ function requireLib$j() {
|
|
27956
27961
|
key = this.parseIdentifier(true);
|
27957
27962
|
} else {
|
27958
27963
|
switch (type) {
|
27959
|
-
case
|
27964
|
+
case 135:
|
27960
27965
|
key = this.parseNumericLiteral(value);
|
27961
27966
|
break;
|
27962
|
-
case
|
27967
|
+
case 134:
|
27963
27968
|
key = this.parseStringLiteral(value);
|
27964
27969
|
break;
|
27965
|
-
case
|
27970
|
+
case 136:
|
27966
27971
|
key = this.parseBigIntLiteral(value);
|
27967
27972
|
break;
|
27968
|
-
case
|
27973
|
+
case 139: {
|
27969
27974
|
const privateKeyLoc = this.state.startLoc;
|
27970
27975
|
if (refExpressionErrors != null) {
|
27971
27976
|
if (refExpressionErrors.privateKeyLoc === null) {
|
@@ -27978,7 +27983,7 @@ function requireLib$j() {
|
|
27978
27983
|
break;
|
27979
27984
|
}
|
27980
27985
|
default:
|
27981
|
-
if (type ===
|
27986
|
+
if (type === 137) {
|
27982
27987
|
key = this.parseDecimalLiteral(value);
|
27983
27988
|
break;
|
27984
27989
|
}
|
@@ -27986,7 +27991,7 @@ function requireLib$j() {
|
|
27986
27991
|
}
|
27987
27992
|
}
|
27988
27993
|
prop.key = key;
|
27989
|
-
if (type !==
|
27994
|
+
if (type !== 139) {
|
27990
27995
|
prop.computed = false;
|
27991
27996
|
}
|
27992
27997
|
}
|
@@ -28293,7 +28298,7 @@ function requireLib$j() {
|
|
28293
28298
|
type === 0 ||
|
28294
28299
|
tokenIsTemplate(type) ||
|
28295
28300
|
(type === 102 && !this.state.containsEsc) ||
|
28296
|
-
type ===
|
28301
|
+
type === 138 ||
|
28297
28302
|
type === 56 ||
|
28298
28303
|
(this.hasPlugin('v8intrinsic') && type === 54)
|
28299
28304
|
);
|
@@ -28311,7 +28316,7 @@ function requireLib$j() {
|
|
28311
28316
|
delegating = this.eat(55);
|
28312
28317
|
switch (this.state.type) {
|
28313
28318
|
case 13:
|
28314
|
-
case
|
28319
|
+
case 140:
|
28315
28320
|
case 8:
|
28316
28321
|
case 11:
|
28317
28322
|
case 3:
|
@@ -28497,13 +28502,13 @@ function requireLib$j() {
|
|
28497
28502
|
switchLabel = {kind: 2};
|
28498
28503
|
const loneSurrogate = /[\uD800-\uDFFF]/u;
|
28499
28504
|
const keywordRelationalOperator = /in(?:stanceof)?/y;
|
28500
|
-
function babel7CompatTokens(tokens, input) {
|
28505
|
+
function babel7CompatTokens(tokens, input, startIndex) {
|
28501
28506
|
for (let i = 0; i < tokens.length; i++) {
|
28502
28507
|
const token = tokens[i];
|
28503
28508
|
const {type: type} = token;
|
28504
28509
|
if (typeof type === 'number') {
|
28505
28510
|
{
|
28506
|
-
if (type ===
|
28511
|
+
if (type === 139) {
|
28507
28512
|
const {loc: loc, start: start, value: value, end: end} = token;
|
28508
28513
|
const hashEndPos = start + 1;
|
28509
28514
|
const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);
|
@@ -28538,7 +28543,7 @@ function requireLib$j() {
|
|
28538
28543
|
1
|
28539
28544
|
);
|
28540
28545
|
let startToken;
|
28541
|
-
if (input.charCodeAt(start) === 96) {
|
28546
|
+
if (input.charCodeAt(start - startIndex) === 96) {
|
28542
28547
|
startToken = new Token({
|
28543
28548
|
type: getExportedToken(22),
|
28544
28549
|
value: '`',
|
@@ -28620,11 +28625,15 @@ function requireLib$j() {
|
|
28620
28625
|
file.program = this.parseProgram(program);
|
28621
28626
|
file.comments = this.comments;
|
28622
28627
|
if (this.options.tokens) {
|
28623
|
-
file.tokens = babel7CompatTokens(
|
28628
|
+
file.tokens = babel7CompatTokens(
|
28629
|
+
this.tokens,
|
28630
|
+
this.input,
|
28631
|
+
this.startIndex
|
28632
|
+
);
|
28624
28633
|
}
|
28625
28634
|
return this.finishNode(file, 'File');
|
28626
28635
|
}
|
28627
|
-
parseProgram(program, end =
|
28636
|
+
parseProgram(program, end = 140, sourceType = this.options.sourceType) {
|
28628
28637
|
program.sourceType = sourceType;
|
28629
28638
|
program.interpreter = this.parseInterpreterDirective();
|
28630
28639
|
this.parseBlockBody(program, true, true, end);
|
@@ -28644,7 +28653,7 @@ function requireLib$j() {
|
|
28644
28653
|
this.addExtra(program, 'topLevelAwait', this.state.hasTopLevelAwait);
|
28645
28654
|
}
|
28646
28655
|
let finishedProgram;
|
28647
|
-
if (end ===
|
28656
|
+
if (end === 140) {
|
28648
28657
|
finishedProgram = this.finishNode(program, 'Program');
|
28649
28658
|
} else {
|
28650
28659
|
finishedProgram = this.finishNodeAt(
|
@@ -29039,7 +29048,7 @@ function requireLib$j() {
|
|
29039
29048
|
while (this.eat(16)) {
|
29040
29049
|
const node = this.startNodeAt(startLoc);
|
29041
29050
|
node.object = expr;
|
29042
|
-
if (this.match(
|
29051
|
+
if (this.match(139)) {
|
29043
29052
|
this.classScope.usePrivateName(
|
29044
29053
|
this.state.value,
|
29045
29054
|
this.state.startLoc
|
@@ -29761,7 +29770,7 @@ function requireLib$j() {
|
|
29761
29770
|
this.parsePropertyNamePrefixOperator(member);
|
29762
29771
|
if (this.eat(55)) {
|
29763
29772
|
method.kind = 'method';
|
29764
|
-
const isPrivateName = this.match(
|
29773
|
+
const isPrivateName = this.match(139);
|
29765
29774
|
this.parseClassElementName(method);
|
29766
29775
|
if (isPrivateName) {
|
29767
29776
|
this.pushClassPrivateMethod(classBody, privateMethod, true, false);
|
@@ -29831,7 +29840,7 @@ function requireLib$j() {
|
|
29831
29840
|
this.unexpected(maybeQuestionTokenStartLoc);
|
29832
29841
|
}
|
29833
29842
|
method.kind = 'method';
|
29834
|
-
const isPrivate = this.match(
|
29843
|
+
const isPrivate = this.match(139);
|
29835
29844
|
this.parseClassElementName(method);
|
29836
29845
|
this.parsePostMemberNameModifiers(publicMember);
|
29837
29846
|
if (isPrivate) {
|
@@ -29860,7 +29869,7 @@ function requireLib$j() {
|
|
29860
29869
|
) {
|
29861
29870
|
this.resetPreviousNodeTrailingComments(key);
|
29862
29871
|
method.kind = maybeContextualKw;
|
29863
|
-
const isPrivate = this.match(
|
29872
|
+
const isPrivate = this.match(139);
|
29864
29873
|
this.parseClassElementName(publicMethod);
|
29865
29874
|
if (isPrivate) {
|
29866
29875
|
this.pushClassPrivateMethod(classBody, privateMethod, false, false);
|
@@ -29881,7 +29890,7 @@ function requireLib$j() {
|
|
29881
29890
|
} else if (maybeContextualKw === 'accessor' && !this.isLineTerminator()) {
|
29882
29891
|
this.expectPlugin('decoratorAutoAccessors');
|
29883
29892
|
this.resetPreviousNodeTrailingComments(key);
|
29884
|
-
const isPrivate = this.match(
|
29893
|
+
const isPrivate = this.match(139);
|
29885
29894
|
this.parseClassElementName(publicProp);
|
29886
29895
|
this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
|
29887
29896
|
} else if (this.isLineTerminator()) {
|
@@ -29897,13 +29906,13 @@ function requireLib$j() {
|
|
29897
29906
|
parseClassElementName(member) {
|
29898
29907
|
const {type: type, value: value} = this.state;
|
29899
29908
|
if (
|
29900
|
-
(type === 132 || type ===
|
29909
|
+
(type === 132 || type === 134) &&
|
29901
29910
|
member.static &&
|
29902
29911
|
value === 'prototype'
|
29903
29912
|
) {
|
29904
29913
|
this.raise(Errors.StaticPrototype, this.state.startLoc);
|
29905
29914
|
}
|
29906
|
-
if (type ===
|
29915
|
+
if (type === 139) {
|
29907
29916
|
if (value === 'constructor') {
|
29908
29917
|
this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
|
29909
29918
|
}
|
@@ -30417,7 +30426,7 @@ function requireLib$j() {
|
|
30417
30426
|
if (this.eat(8)) break;
|
30418
30427
|
}
|
30419
30428
|
const isMaybeTypeOnly = this.isContextual(130);
|
30420
|
-
const isString = this.match(
|
30429
|
+
const isString = this.match(134);
|
30421
30430
|
const node = this.startNode();
|
30422
30431
|
node.local = this.parseModuleExportName();
|
30423
30432
|
nodes.push(
|
@@ -30442,7 +30451,7 @@ function requireLib$j() {
|
|
30442
30451
|
return this.finishNode(node, 'ExportSpecifier');
|
30443
30452
|
}
|
30444
30453
|
parseModuleExportName() {
|
30445
|
-
if (this.match(
|
30454
|
+
if (this.match(134)) {
|
30446
30455
|
const result = this.parseStringLiteral(this.state.value);
|
30447
30456
|
const surrogate = loneSurrogate.exec(result.value);
|
30448
30457
|
if (surrogate) {
|
@@ -30592,7 +30601,7 @@ function requireLib$j() {
|
|
30592
30601
|
: type !== 12;
|
30593
30602
|
}
|
30594
30603
|
parseImport(node) {
|
30595
|
-
if (this.match(
|
30604
|
+
if (this.match(134)) {
|
30596
30605
|
return this.parseImportSourceAndAttributes(node);
|
30597
30606
|
}
|
30598
30607
|
return this.parseImportSpecifiersAndAfter(
|
@@ -30625,7 +30634,7 @@ function requireLib$j() {
|
|
30625
30634
|
return this.finishNode(node, 'ImportDeclaration');
|
30626
30635
|
}
|
30627
30636
|
parseImportSource() {
|
30628
|
-
if (!this.match(
|
30637
|
+
if (!this.match(134)) this.unexpected();
|
30629
30638
|
return this.parseExprAtom();
|
30630
30639
|
}
|
30631
30640
|
parseImportSpecifierLocal(node, specifier, type) {
|
@@ -30654,13 +30663,13 @@ function requireLib$j() {
|
|
30654
30663
|
);
|
30655
30664
|
}
|
30656
30665
|
attrNames.add(keyName);
|
30657
|
-
if (this.match(
|
30666
|
+
if (this.match(134)) {
|
30658
30667
|
node.key = this.parseStringLiteral(keyName);
|
30659
30668
|
} else {
|
30660
30669
|
node.key = this.parseIdentifier(true);
|
30661
30670
|
}
|
30662
30671
|
this.expect(14);
|
30663
|
-
if (!this.match(
|
30672
|
+
if (!this.match(134)) {
|
30664
30673
|
throw this.raise(
|
30665
30674
|
Errors.ModuleAttributeInvalidValue,
|
30666
30675
|
this.state.startLoc
|
@@ -30688,7 +30697,7 @@ function requireLib$j() {
|
|
30688
30697
|
}
|
30689
30698
|
attributes.add(node.key.name);
|
30690
30699
|
this.expect(14);
|
30691
|
-
if (!this.match(
|
30700
|
+
if (!this.match(134)) {
|
30692
30701
|
throw this.raise(
|
30693
30702
|
Errors.ModuleAttributeInvalidValue,
|
30694
30703
|
this.state.startLoc
|
@@ -30787,7 +30796,7 @@ function requireLib$j() {
|
|
30787
30796
|
if (this.eat(8)) break;
|
30788
30797
|
}
|
30789
30798
|
const specifier = this.startNode();
|
30790
|
-
const importedIsString = this.match(
|
30799
|
+
const importedIsString = this.match(134);
|
30791
30800
|
const isMaybeTypeOnly = this.isContextual(130);
|
30792
30801
|
specifier.imported = this.parseModuleExportName();
|
30793
30802
|
const importSpecifier = this.parseImportSpecifier(
|
@@ -59213,7 +59222,8 @@ function requireTokenMap() {
|
|
59213
59222
|
}
|
59214
59223
|
const indexes = [];
|
59215
59224
|
for (const child of children) {
|
59216
|
-
if (
|
59225
|
+
if (child == null) continue;
|
59226
|
+
if (child.start == null || child.end == null) continue;
|
59217
59227
|
const childTok = this._findTokensOfNode(child, low, last);
|
59218
59228
|
const high = childTok.first;
|
59219
59229
|
for (let k = low; k < high; k++) indexes.push(k);
|
@@ -134732,130 +134742,138 @@ var _default$2 = plugin$2;
|
|
134732
134742
|
Immutable.default = _default$2;
|
134733
134743
|
var ReactElement = {};
|
134734
134744
|
var reactIs = {exports: {}};
|
134735
|
-
var
|
134736
|
-
var
|
134737
|
-
function
|
134738
|
-
if (
|
134739
|
-
|
134740
|
-
var
|
134741
|
-
|
134742
|
-
|
134743
|
-
|
134744
|
-
|
134745
|
-
|
134746
|
-
|
134747
|
-
|
134748
|
-
|
134749
|
-
|
134750
|
-
|
134751
|
-
|
134752
|
-
|
134753
|
-
|
134754
|
-
|
134755
|
-
|
134756
|
-
|
134757
|
-
|
134758
|
-
|
134759
|
-
|
134760
|
-
|
134761
|
-
|
134762
|
-
|
134763
|
-
|
134764
|
-
|
134765
|
-
|
134745
|
+
var reactIs_production_min = {};
|
134746
|
+
var hasRequiredReactIs_production_min;
|
134747
|
+
function requireReactIs_production_min() {
|
134748
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
134749
|
+
hasRequiredReactIs_production_min = 1;
|
134750
|
+
var b = 'function' === typeof Symbol && Symbol.for,
|
134751
|
+
c = b ? Symbol.for('react.element') : 60103,
|
134752
|
+
d = b ? Symbol.for('react.portal') : 60106,
|
134753
|
+
e = b ? Symbol.for('react.fragment') : 60107,
|
134754
|
+
f = b ? Symbol.for('react.strict_mode') : 60108,
|
134755
|
+
g = b ? Symbol.for('react.profiler') : 60114,
|
134756
|
+
h = b ? Symbol.for('react.provider') : 60109,
|
134757
|
+
k = b ? Symbol.for('react.context') : 60110,
|
134758
|
+
l = b ? Symbol.for('react.async_mode') : 60111,
|
134759
|
+
m = b ? Symbol.for('react.concurrent_mode') : 60111,
|
134760
|
+
n = b ? Symbol.for('react.forward_ref') : 60112,
|
134761
|
+
p = b ? Symbol.for('react.suspense') : 60113,
|
134762
|
+
q = b ? Symbol.for('react.suspense_list') : 60120,
|
134763
|
+
r = b ? Symbol.for('react.memo') : 60115,
|
134764
|
+
t = b ? Symbol.for('react.lazy') : 60116,
|
134765
|
+
v = b ? Symbol.for('react.block') : 60121,
|
134766
|
+
w = b ? Symbol.for('react.fundamental') : 60117,
|
134767
|
+
x = b ? Symbol.for('react.responder') : 60118,
|
134768
|
+
y = b ? Symbol.for('react.scope') : 60119;
|
134769
|
+
function z(a) {
|
134770
|
+
if ('object' === typeof a && null !== a) {
|
134771
|
+
var u = a.$$typeof;
|
134772
|
+
switch (u) {
|
134773
|
+
case c:
|
134774
|
+
switch (((a = a.type), a)) {
|
134775
|
+
case l:
|
134776
|
+
case m:
|
134777
|
+
case e:
|
134778
|
+
case g:
|
134779
|
+
case f:
|
134780
|
+
case p:
|
134781
|
+
return a;
|
134766
134782
|
default:
|
134767
|
-
switch (((
|
134768
|
-
case
|
134769
|
-
case
|
134770
|
-
case
|
134771
|
-
case
|
134772
|
-
|
134773
|
-
|
134774
|
-
return object;
|
134783
|
+
switch (((a = a && a.$$typeof), a)) {
|
134784
|
+
case k:
|
134785
|
+
case n:
|
134786
|
+
case t:
|
134787
|
+
case r:
|
134788
|
+
case h:
|
134789
|
+
return a;
|
134775
134790
|
default:
|
134776
|
-
return
|
134791
|
+
return u;
|
134777
134792
|
}
|
134778
134793
|
}
|
134779
|
-
case
|
134780
|
-
return
|
134781
|
-
}
|
134782
|
-
}
|
134783
|
-
}
|
134784
|
-
|
134785
|
-
|
134786
|
-
|
134787
|
-
|
134788
|
-
|
134789
|
-
|
134790
|
-
|
134791
|
-
|
134792
|
-
|
134793
|
-
|
134794
|
-
|
134795
|
-
|
134796
|
-
|
134797
|
-
|
134794
|
+
case d:
|
134795
|
+
return u;
|
134796
|
+
}
|
134797
|
+
}
|
134798
|
+
}
|
134799
|
+
function A(a) {
|
134800
|
+
return z(a) === m;
|
134801
|
+
}
|
134802
|
+
reactIs_production_min.AsyncMode = l;
|
134803
|
+
reactIs_production_min.ConcurrentMode = m;
|
134804
|
+
reactIs_production_min.ContextConsumer = k;
|
134805
|
+
reactIs_production_min.ContextProvider = h;
|
134806
|
+
reactIs_production_min.Element = c;
|
134807
|
+
reactIs_production_min.ForwardRef = n;
|
134808
|
+
reactIs_production_min.Fragment = e;
|
134809
|
+
reactIs_production_min.Lazy = t;
|
134810
|
+
reactIs_production_min.Memo = r;
|
134811
|
+
reactIs_production_min.Portal = d;
|
134812
|
+
reactIs_production_min.Profiler = g;
|
134813
|
+
reactIs_production_min.StrictMode = f;
|
134814
|
+
reactIs_production_min.Suspense = p;
|
134815
|
+
reactIs_production_min.isAsyncMode = function (a) {
|
134816
|
+
return A(a) || z(a) === l;
|
134798
134817
|
};
|
134799
|
-
|
134800
|
-
|
134818
|
+
reactIs_production_min.isConcurrentMode = A;
|
134819
|
+
reactIs_production_min.isContextConsumer = function (a) {
|
134820
|
+
return z(a) === k;
|
134801
134821
|
};
|
134802
|
-
|
134803
|
-
return (
|
134804
|
-
'object' === typeof object &&
|
134805
|
-
null !== object &&
|
134806
|
-
object.$$typeof === REACT_ELEMENT_TYPE
|
134807
|
-
);
|
134822
|
+
reactIs_production_min.isContextProvider = function (a) {
|
134823
|
+
return z(a) === h;
|
134808
134824
|
};
|
134809
|
-
|
134810
|
-
return
|
134825
|
+
reactIs_production_min.isElement = function (a) {
|
134826
|
+
return 'object' === typeof a && null !== a && a.$$typeof === c;
|
134811
134827
|
};
|
134812
|
-
|
134813
|
-
return
|
134828
|
+
reactIs_production_min.isForwardRef = function (a) {
|
134829
|
+
return z(a) === n;
|
134814
134830
|
};
|
134815
|
-
|
134816
|
-
return
|
134831
|
+
reactIs_production_min.isFragment = function (a) {
|
134832
|
+
return z(a) === e;
|
134817
134833
|
};
|
134818
|
-
|
134819
|
-
return
|
134834
|
+
reactIs_production_min.isLazy = function (a) {
|
134835
|
+
return z(a) === t;
|
134820
134836
|
};
|
134821
|
-
|
134822
|
-
return
|
134837
|
+
reactIs_production_min.isMemo = function (a) {
|
134838
|
+
return z(a) === r;
|
134823
134839
|
};
|
134824
|
-
|
134825
|
-
return
|
134840
|
+
reactIs_production_min.isPortal = function (a) {
|
134841
|
+
return z(a) === d;
|
134826
134842
|
};
|
134827
|
-
|
134828
|
-
return
|
134843
|
+
reactIs_production_min.isProfiler = function (a) {
|
134844
|
+
return z(a) === g;
|
134829
134845
|
};
|
134830
|
-
|
134831
|
-
return
|
134846
|
+
reactIs_production_min.isStrictMode = function (a) {
|
134847
|
+
return z(a) === f;
|
134832
134848
|
};
|
134833
|
-
|
134834
|
-
return
|
134849
|
+
reactIs_production_min.isSuspense = function (a) {
|
134850
|
+
return z(a) === p;
|
134835
134851
|
};
|
134836
|
-
|
134837
|
-
return
|
134838
|
-
'
|
134839
|
-
|
134840
|
-
|
134841
|
-
|
134842
|
-
|
134843
|
-
|
134844
|
-
|
134845
|
-
|
134846
|
-
|
134847
|
-
|
134848
|
-
|
134849
|
-
|
134850
|
-
|
134851
|
-
|
134852
|
-
|
134853
|
-
|
134854
|
-
|
134855
|
-
|
134852
|
+
reactIs_production_min.isValidElementType = function (a) {
|
134853
|
+
return (
|
134854
|
+
'string' === typeof a ||
|
134855
|
+
'function' === typeof a ||
|
134856
|
+
a === e ||
|
134857
|
+
a === m ||
|
134858
|
+
a === g ||
|
134859
|
+
a === f ||
|
134860
|
+
a === p ||
|
134861
|
+
a === q ||
|
134862
|
+
('object' === typeof a &&
|
134863
|
+
null !== a &&
|
134864
|
+
(a.$$typeof === t ||
|
134865
|
+
a.$$typeof === r ||
|
134866
|
+
a.$$typeof === h ||
|
134867
|
+
a.$$typeof === k ||
|
134868
|
+
a.$$typeof === n ||
|
134869
|
+
a.$$typeof === w ||
|
134870
|
+
a.$$typeof === x ||
|
134871
|
+
a.$$typeof === y ||
|
134872
|
+
a.$$typeof === v))
|
134873
|
+
);
|
134856
134874
|
};
|
134857
|
-
|
134858
|
-
return
|
134875
|
+
reactIs_production_min.typeOf = z;
|
134876
|
+
return reactIs_production_min;
|
134859
134877
|
}
|
134860
134878
|
var reactIs_development = {};
|
134861
134879
|
var hasRequiredReactIs_development;
|
@@ -134864,59 +134882,69 @@ function requireReactIs_development() {
|
|
134864
134882
|
hasRequiredReactIs_development = 1;
|
134865
134883
|
if (process.env.NODE_ENV !== 'production') {
|
134866
134884
|
(function () {
|
134867
|
-
var
|
134868
|
-
var
|
134869
|
-
var
|
134870
|
-
var
|
134871
|
-
|
134872
|
-
|
134873
|
-
var
|
134874
|
-
|
134875
|
-
|
134876
|
-
var REACT_PROFILER_TYPE =
|
134877
|
-
|
134878
|
-
|
134879
|
-
var
|
134880
|
-
|
134881
|
-
|
134882
|
-
var
|
134883
|
-
var
|
134884
|
-
|
134885
|
-
|
134886
|
-
var
|
134885
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
134886
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 60103;
|
134887
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 60106;
|
134888
|
+
var REACT_FRAGMENT_TYPE = hasSymbol
|
134889
|
+
? Symbol.for('react.fragment')
|
134890
|
+
: 60107;
|
134891
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol
|
134892
|
+
? Symbol.for('react.strict_mode')
|
134893
|
+
: 60108;
|
134894
|
+
var REACT_PROFILER_TYPE = hasSymbol
|
134895
|
+
? Symbol.for('react.profiler')
|
134896
|
+
: 60114;
|
134897
|
+
var REACT_PROVIDER_TYPE = hasSymbol
|
134898
|
+
? Symbol.for('react.provider')
|
134899
|
+
: 60109;
|
134900
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 60110;
|
134901
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol
|
134902
|
+
? Symbol.for('react.async_mode')
|
134903
|
+
: 60111;
|
134904
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol
|
134905
|
+
? Symbol.for('react.concurrent_mode')
|
134906
|
+
: 60111;
|
134907
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol
|
134908
|
+
? Symbol.for('react.forward_ref')
|
134909
|
+
: 60112;
|
134910
|
+
var REACT_SUSPENSE_TYPE = hasSymbol
|
134911
|
+
? Symbol.for('react.suspense')
|
134912
|
+
: 60113;
|
134913
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol
|
134914
|
+
? Symbol.for('react.suspense_list')
|
134915
|
+
: 60120;
|
134916
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 60115;
|
134917
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 60116;
|
134918
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 60121;
|
134919
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol
|
134920
|
+
? Symbol.for('react.fundamental')
|
134921
|
+
: 60117;
|
134922
|
+
var REACT_RESPONDER_TYPE = hasSymbol
|
134923
|
+
? Symbol.for('react.responder')
|
134924
|
+
: 60118;
|
134925
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 60119;
|
134887
134926
|
function isValidElementType(type) {
|
134888
|
-
|
134889
|
-
|
134890
|
-
|
134891
|
-
if (
|
134927
|
+
return (
|
134928
|
+
typeof type === 'string' ||
|
134929
|
+
typeof type === 'function' ||
|
134892
134930
|
type === REACT_FRAGMENT_TYPE ||
|
134931
|
+
type === REACT_CONCURRENT_MODE_TYPE ||
|
134893
134932
|
type === REACT_PROFILER_TYPE ||
|
134894
|
-
enableDebugTracing ||
|
134895
134933
|
type === REACT_STRICT_MODE_TYPE ||
|
134896
134934
|
type === REACT_SUSPENSE_TYPE ||
|
134897
134935
|
type === REACT_SUSPENSE_LIST_TYPE ||
|
134898
|
-
|
134899
|
-
|
134900
|
-
|
134901
|
-
|
134902
|
-
|
134903
|
-
|
134904
|
-
|
134905
|
-
|
134906
|
-
|
134907
|
-
|
134908
|
-
|
134909
|
-
|
134910
|
-
!enableRenderableContext ||
|
134911
|
-
type.$$typeof === REACT_CONSUMER_TYPE ||
|
134912
|
-
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
134913
|
-
type.$$typeof === REACT_CLIENT_REFERENCE ||
|
134914
|
-
type.getModuleId !== undefined
|
134915
|
-
) {
|
134916
|
-
return true;
|
134917
|
-
}
|
134918
|
-
}
|
134919
|
-
return false;
|
134936
|
+
(typeof type === 'object' &&
|
134937
|
+
type !== null &&
|
134938
|
+
(type.$$typeof === REACT_LAZY_TYPE ||
|
134939
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
134940
|
+
type.$$typeof === REACT_PROVIDER_TYPE ||
|
134941
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
134942
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
134943
|
+
type.$$typeof === REACT_FUNDAMENTAL_TYPE ||
|
134944
|
+
type.$$typeof === REACT_RESPONDER_TYPE ||
|
134945
|
+
type.$$typeof === REACT_SCOPE_TYPE ||
|
134946
|
+
type.$$typeof === REACT_BLOCK_TYPE))
|
134947
|
+
);
|
134920
134948
|
}
|
134921
134949
|
function typeOf(object) {
|
134922
134950
|
if (typeof object === 'object' && object !== null) {
|
@@ -134925,11 +134953,12 @@ function requireReactIs_development() {
|
|
134925
134953
|
case REACT_ELEMENT_TYPE:
|
134926
134954
|
var type = object.type;
|
134927
134955
|
switch (type) {
|
134956
|
+
case REACT_ASYNC_MODE_TYPE:
|
134957
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
134928
134958
|
case REACT_FRAGMENT_TYPE:
|
134929
134959
|
case REACT_PROFILER_TYPE:
|
134930
134960
|
case REACT_STRICT_MODE_TYPE:
|
134931
134961
|
case REACT_SUSPENSE_TYPE:
|
134932
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
134933
134962
|
return type;
|
134934
134963
|
default:
|
134935
134964
|
var $$typeofType = type && type.$$typeof;
|
@@ -134938,11 +134967,8 @@ function requireReactIs_development() {
|
|
134938
134967
|
case REACT_FORWARD_REF_TYPE:
|
134939
134968
|
case REACT_LAZY_TYPE:
|
134940
134969
|
case REACT_MEMO_TYPE:
|
134941
|
-
return $$typeofType;
|
134942
|
-
case REACT_CONSUMER_TYPE: {
|
134943
|
-
return $$typeofType;
|
134944
|
-
}
|
134945
134970
|
case REACT_PROVIDER_TYPE:
|
134971
|
+
return $$typeofType;
|
134946
134972
|
default:
|
134947
134973
|
return $$typeof;
|
134948
134974
|
}
|
@@ -134953,8 +134979,10 @@ function requireReactIs_development() {
|
|
134953
134979
|
}
|
134954
134980
|
return undefined;
|
134955
134981
|
}
|
134956
|
-
var
|
134957
|
-
var
|
134982
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
134983
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
134984
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
134985
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
134958
134986
|
var Element = REACT_ELEMENT_TYPE;
|
134959
134987
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
134960
134988
|
var Fragment = REACT_FRAGMENT_TYPE;
|
@@ -134964,16 +134992,30 @@ function requireReactIs_development() {
|
|
134964
134992
|
var Profiler = REACT_PROFILER_TYPE;
|
134965
134993
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
134966
134994
|
var Suspense = REACT_SUSPENSE_TYPE;
|
134967
|
-
var
|
134968
|
-
function
|
134995
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
134996
|
+
function isAsyncMode(object) {
|
134969
134997
|
{
|
134970
|
-
|
134998
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
134999
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
135000
|
+
console['warn'](
|
135001
|
+
'The ReactIs.isAsyncMode() alias has been deprecated, ' +
|
135002
|
+
'and will be removed in React 17+. Update your code to use ' +
|
135003
|
+
'ReactIs.isConcurrentMode() instead. It has the exact same API.'
|
135004
|
+
);
|
135005
|
+
}
|
134971
135006
|
}
|
135007
|
+
return (
|
135008
|
+
isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE
|
135009
|
+
);
|
135010
|
+
}
|
135011
|
+
function isConcurrentMode(object) {
|
135012
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
135013
|
+
}
|
135014
|
+
function isContextConsumer(object) {
|
135015
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
134972
135016
|
}
|
134973
135017
|
function isContextProvider(object) {
|
134974
|
-
|
134975
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
134976
|
-
}
|
135018
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
134977
135019
|
}
|
134978
135020
|
function isElement(object) {
|
134979
135021
|
return (
|
@@ -135006,9 +135048,8 @@ function requireReactIs_development() {
|
|
135006
135048
|
function isSuspense(object) {
|
135007
135049
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
135008
135050
|
}
|
135009
|
-
|
135010
|
-
|
135011
|
-
}
|
135051
|
+
reactIs_development.AsyncMode = AsyncMode;
|
135052
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
135012
135053
|
reactIs_development.ContextConsumer = ContextConsumer;
|
135013
135054
|
reactIs_development.ContextProvider = ContextProvider;
|
135014
135055
|
reactIs_development.Element = Element;
|
@@ -135020,7 +135061,8 @@ function requireReactIs_development() {
|
|
135020
135061
|
reactIs_development.Profiler = Profiler;
|
135021
135062
|
reactIs_development.StrictMode = StrictMode;
|
135022
135063
|
reactIs_development.Suspense = Suspense;
|
135023
|
-
reactIs_development.
|
135064
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
135065
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
135024
135066
|
reactIs_development.isContextConsumer = isContextConsumer;
|
135025
135067
|
reactIs_development.isContextProvider = isContextProvider;
|
135026
135068
|
reactIs_development.isElement = isElement;
|
@@ -135032,7 +135074,6 @@ function requireReactIs_development() {
|
|
135032
135074
|
reactIs_development.isProfiler = isProfiler;
|
135033
135075
|
reactIs_development.isStrictMode = isStrictMode;
|
135034
135076
|
reactIs_development.isSuspense = isSuspense;
|
135035
|
-
reactIs_development.isSuspenseList = isSuspenseList;
|
135036
135077
|
reactIs_development.isValidElementType = isValidElementType;
|
135037
135078
|
reactIs_development.typeOf = typeOf;
|
135038
135079
|
})();
|
@@ -135040,7 +135081,7 @@ function requireReactIs_development() {
|
|
135040
135081
|
return reactIs_development;
|
135041
135082
|
}
|
135042
135083
|
if (process.env.NODE_ENV === 'production') {
|
135043
|
-
reactIs.exports =
|
135084
|
+
reactIs.exports = requireReactIs_production_min();
|
135044
135085
|
} else {
|
135045
135086
|
reactIs.exports = requireReactIs_development();
|
135046
135087
|
}
|
@@ -136673,6 +136714,17 @@ const EnvironmentConfigSchema = z.object({
|
|
136673
136714
|
enableForest: z.boolean().default(false),
|
136674
136715
|
enableUseTypeAnnotations: z.boolean().default(false),
|
136675
136716
|
enableFunctionDependencyRewrite: z.boolean().default(true),
|
136717
|
+
enableOptionalDependencies: z.boolean().default(true),
|
136718
|
+
inferEffectDependencies: z
|
136719
|
+
.nullable(
|
136720
|
+
z.array(
|
136721
|
+
z.object({
|
136722
|
+
function: ExternalFunctionSchema,
|
136723
|
+
numRequiredArgs: z.number(),
|
136724
|
+
})
|
136725
|
+
)
|
136726
|
+
)
|
136727
|
+
.default(null),
|
136676
136728
|
inlineJsxTransform: ReactElementSymbolSchema.nullable().default(null),
|
136677
136729
|
validateHooksUsage: z.boolean().default(true),
|
136678
136730
|
validateRefAccessDuringRender: z.boolean().default(true),
|
@@ -136736,6 +136788,19 @@ const testComplexConfigDefaults = {
|
|
136736
136788
|
source: 'react-compiler-runtime',
|
136737
136789
|
importSpecifierName: 'useContext_withSelector',
|
136738
136790
|
},
|
136791
|
+
inferEffectDependencies: [
|
136792
|
+
{
|
136793
|
+
function: {source: 'react', importSpecifierName: 'useEffect'},
|
136794
|
+
numRequiredArgs: 1,
|
136795
|
+
},
|
136796
|
+
{
|
136797
|
+
function: {
|
136798
|
+
source: 'shared-runtime',
|
136799
|
+
importSpecifierName: 'useSpecialEffect',
|
136800
|
+
},
|
136801
|
+
numRequiredArgs: 2,
|
136802
|
+
},
|
136803
|
+
],
|
136739
136804
|
};
|
136740
136805
|
function parseConfigPragmaForTests(pragma) {
|
136741
136806
|
const maybeConfig = {};
|
@@ -140974,25 +141039,25 @@ function rewriteInstruction(instr, state) {
|
|
140974
141039
|
if (instr.value.kind === 'Destructure') {
|
140975
141040
|
switch (instr.value.lvalue.pattern.kind) {
|
140976
141041
|
case 'ArrayPattern': {
|
140977
|
-
let
|
140978
|
-
const
|
140979
|
-
for (let i =
|
140980
|
-
const item =
|
141042
|
+
let lastEntryIndex = 0;
|
141043
|
+
const items = instr.value.lvalue.pattern.items;
|
141044
|
+
for (let i = 0; i < items.length; i++) {
|
141045
|
+
const item = items[i];
|
140981
141046
|
if (item.kind === 'Identifier') {
|
140982
|
-
if (state.isIdOrNameUsed(item.identifier)) {
|
140983
|
-
|
140984
|
-
|
141047
|
+
if (!state.isIdOrNameUsed(item.identifier)) {
|
141048
|
+
items[i] = {kind: 'Hole'};
|
141049
|
+
} else {
|
141050
|
+
lastEntryIndex = i;
|
140985
141051
|
}
|
140986
141052
|
} else if (item.kind === 'Spread') {
|
140987
|
-
if (state.isIdOrNameUsed(item.place.identifier)) {
|
140988
|
-
|
140989
|
-
|
141053
|
+
if (!state.isIdOrNameUsed(item.place.identifier)) {
|
141054
|
+
items[i] = {kind: 'Hole'};
|
141055
|
+
} else {
|
141056
|
+
lastEntryIndex = i;
|
140990
141057
|
}
|
140991
141058
|
}
|
140992
141059
|
}
|
140993
|
-
|
140994
|
-
instr.value.lvalue.pattern.items = nextItems;
|
140995
|
-
}
|
141060
|
+
items.length = lastEntryIndex + 1;
|
140996
141061
|
break;
|
140997
141062
|
}
|
140998
141063
|
case 'ObjectPattern': {
|
@@ -141656,28 +141721,41 @@ function createPropsProperties(
|
|
141656
141721
|
propAttributes.forEach(prop => {
|
141657
141722
|
switch (prop.kind) {
|
141658
141723
|
case 'JsxAttribute': {
|
141659
|
-
|
141660
|
-
|
141661
|
-
|
141662
|
-
|
141663
|
-
|
141664
|
-
|
141665
|
-
|
141666
|
-
|
141667
|
-
|
141668
|
-
|
141669
|
-
|
141670
|
-
|
141671
|
-
|
141672
|
-
|
141673
|
-
|
141674
|
-
|
141675
|
-
|
141676
|
-
|
141677
|
-
|
141678
|
-
|
141679
|
-
|
141680
|
-
|
141724
|
+
switch (prop.name) {
|
141725
|
+
case 'key': {
|
141726
|
+
keyProperty = {
|
141727
|
+
kind: 'ObjectProperty',
|
141728
|
+
key: {name: 'key', kind: 'string'},
|
141729
|
+
type: 'property',
|
141730
|
+
place: Object.assign({}, prop.place),
|
141731
|
+
};
|
141732
|
+
break;
|
141733
|
+
}
|
141734
|
+
case 'ref': {
|
141735
|
+
refProperty = {
|
141736
|
+
kind: 'ObjectProperty',
|
141737
|
+
key: {name: 'ref', kind: 'string'},
|
141738
|
+
type: 'property',
|
141739
|
+
place: Object.assign({}, prop.place),
|
141740
|
+
};
|
141741
|
+
const refPropProperty = {
|
141742
|
+
kind: 'ObjectProperty',
|
141743
|
+
key: {name: 'ref', kind: 'string'},
|
141744
|
+
type: 'property',
|
141745
|
+
place: Object.assign({}, prop.place),
|
141746
|
+
};
|
141747
|
+
props.push(refPropProperty);
|
141748
|
+
break;
|
141749
|
+
}
|
141750
|
+
default: {
|
141751
|
+
const attributeProperty = {
|
141752
|
+
kind: 'ObjectProperty',
|
141753
|
+
key: {name: prop.name, kind: 'string'},
|
141754
|
+
type: 'property',
|
141755
|
+
place: Object.assign({}, prop.place),
|
141756
|
+
};
|
141757
|
+
props.push(attributeProperty);
|
141758
|
+
}
|
141681
141759
|
}
|
141682
141760
|
break;
|
141683
141761
|
}
|
@@ -151429,6 +151507,199 @@ function declareTemporary(env, block, result) {
|
|
151429
151507
|
},
|
151430
151508
|
});
|
151431
151509
|
}
|
151510
|
+
function inferEffectDependencies(fn) {
|
151511
|
+
let hasRewrite = false;
|
151512
|
+
const fnExpressions = new Map();
|
151513
|
+
const autodepFnConfigs = new Map();
|
151514
|
+
for (const effectTarget of fn.env.config.inferEffectDependencies) {
|
151515
|
+
const moduleTargets = getOrInsertWith(
|
151516
|
+
autodepFnConfigs,
|
151517
|
+
effectTarget.function.source,
|
151518
|
+
() => new Map()
|
151519
|
+
);
|
151520
|
+
moduleTargets.set(
|
151521
|
+
effectTarget.function.importSpecifierName,
|
151522
|
+
effectTarget.numRequiredArgs
|
151523
|
+
);
|
151524
|
+
}
|
151525
|
+
const autodepFnLoads = new Map();
|
151526
|
+
const scopeInfos = new Map();
|
151527
|
+
const reactiveIds = inferReactiveIdentifiers(fn);
|
151528
|
+
for (const [, block] of fn.body.blocks) {
|
151529
|
+
if (
|
151530
|
+
block.terminal.kind === 'scope' ||
|
151531
|
+
block.terminal.kind === 'pruned-scope'
|
151532
|
+
) {
|
151533
|
+
const scopeBlock = fn.body.blocks.get(block.terminal.block);
|
151534
|
+
scopeInfos.set(block.terminal.scope.id, {
|
151535
|
+
pruned: block.terminal.kind === 'pruned-scope',
|
151536
|
+
deps: block.terminal.scope.dependencies,
|
151537
|
+
hasSingleInstr:
|
151538
|
+
scopeBlock.instructions.length === 1 &&
|
151539
|
+
scopeBlock.terminal.kind === 'goto' &&
|
151540
|
+
scopeBlock.terminal.block === block.terminal.fallthrough,
|
151541
|
+
});
|
151542
|
+
}
|
151543
|
+
const rewriteInstrs = new Map();
|
151544
|
+
for (const instr of block.instructions) {
|
151545
|
+
const {value: value, lvalue: lvalue} = instr;
|
151546
|
+
if (value.kind === 'FunctionExpression') {
|
151547
|
+
fnExpressions.set(lvalue.identifier.id, instr);
|
151548
|
+
} else if (
|
151549
|
+
value.kind === 'LoadGlobal' &&
|
151550
|
+
value.binding.kind === 'ImportSpecifier'
|
151551
|
+
) {
|
151552
|
+
const moduleTargets = autodepFnConfigs.get(value.binding.module);
|
151553
|
+
if (moduleTargets != null) {
|
151554
|
+
const numRequiredArgs = moduleTargets.get(value.binding.imported);
|
151555
|
+
if (numRequiredArgs != null) {
|
151556
|
+
autodepFnLoads.set(lvalue.identifier.id, numRequiredArgs);
|
151557
|
+
}
|
151558
|
+
}
|
151559
|
+
} else if (
|
151560
|
+
value.kind === 'CallExpression' &&
|
151561
|
+
autodepFnLoads.get(value.callee.identifier.id) === value.args.length &&
|
151562
|
+
value.args[0].kind === 'Identifier'
|
151563
|
+
) {
|
151564
|
+
const fnExpr = fnExpressions.get(value.args[0].identifier.id);
|
151565
|
+
if (fnExpr != null) {
|
151566
|
+
const scopeInfo =
|
151567
|
+
fnExpr.lvalue.identifier.scope != null
|
151568
|
+
? scopeInfos.get(fnExpr.lvalue.identifier.scope.id)
|
151569
|
+
: null;
|
151570
|
+
CompilerError.invariant(scopeInfo != null, {
|
151571
|
+
reason: 'Expected function expression scope to exist',
|
151572
|
+
loc: value.loc,
|
151573
|
+
});
|
151574
|
+
if (scopeInfo.pruned || !scopeInfo.hasSingleInstr) {
|
151575
|
+
CompilerError.throwTodo({
|
151576
|
+
reason:
|
151577
|
+
'[InferEffectDependencies] Expected effect function to have non-pruned scope and its scope to have exactly one instruction',
|
151578
|
+
loc: fnExpr.loc,
|
151579
|
+
});
|
151580
|
+
}
|
151581
|
+
const effectDeps = [];
|
151582
|
+
const newInstructions = [];
|
151583
|
+
for (const dep of scopeInfo.deps) {
|
151584
|
+
const {place: place, instructions: instructions} =
|
151585
|
+
writeDependencyToInstructions(
|
151586
|
+
dep,
|
151587
|
+
reactiveIds.has(dep.identifier.id),
|
151588
|
+
fn.env,
|
151589
|
+
fnExpr.loc
|
151590
|
+
);
|
151591
|
+
newInstructions.push(...instructions);
|
151592
|
+
effectDeps.push(place);
|
151593
|
+
}
|
151594
|
+
const deps = {
|
151595
|
+
kind: 'ArrayExpression',
|
151596
|
+
elements: effectDeps,
|
151597
|
+
loc: GeneratedSource,
|
151598
|
+
};
|
151599
|
+
const depsPlace = createTemporaryPlace(fn.env, GeneratedSource);
|
151600
|
+
depsPlace.effect = exports.Effect.Read;
|
151601
|
+
newInstructions.push({
|
151602
|
+
id: makeInstructionId(0),
|
151603
|
+
loc: GeneratedSource,
|
151604
|
+
lvalue: Object.assign(Object.assign({}, depsPlace), {
|
151605
|
+
effect: exports.Effect.Mutate,
|
151606
|
+
}),
|
151607
|
+
value: deps,
|
151608
|
+
});
|
151609
|
+
value.args.push(
|
151610
|
+
Object.assign(Object.assign({}, depsPlace), {
|
151611
|
+
effect: exports.Effect.Freeze,
|
151612
|
+
})
|
151613
|
+
);
|
151614
|
+
rewriteInstrs.set(instr.id, newInstructions);
|
151615
|
+
}
|
151616
|
+
}
|
151617
|
+
}
|
151618
|
+
if (rewriteInstrs.size > 0) {
|
151619
|
+
hasRewrite = true;
|
151620
|
+
const newInstrs = [];
|
151621
|
+
for (const instr of block.instructions) {
|
151622
|
+
const newInstr = rewriteInstrs.get(instr.id);
|
151623
|
+
if (newInstr != null) {
|
151624
|
+
newInstrs.push(...newInstr, instr);
|
151625
|
+
} else {
|
151626
|
+
newInstrs.push(instr);
|
151627
|
+
}
|
151628
|
+
}
|
151629
|
+
block.instructions = newInstrs;
|
151630
|
+
}
|
151631
|
+
}
|
151632
|
+
if (hasRewrite) {
|
151633
|
+
markInstructionIds(fn.body);
|
151634
|
+
fixScopeAndIdentifierRanges(fn.body);
|
151635
|
+
}
|
151636
|
+
}
|
151637
|
+
function writeDependencyToInstructions(dep, reactive, env, loc) {
|
151638
|
+
const instructions = [];
|
151639
|
+
let currValue = createTemporaryPlace(env, GeneratedSource);
|
151640
|
+
currValue.reactive = reactive;
|
151641
|
+
instructions.push({
|
151642
|
+
id: makeInstructionId(0),
|
151643
|
+
loc: GeneratedSource,
|
151644
|
+
lvalue: Object.assign(Object.assign({}, currValue), {
|
151645
|
+
effect: exports.Effect.Mutate,
|
151646
|
+
}),
|
151647
|
+
value: {
|
151648
|
+
kind: 'LoadLocal',
|
151649
|
+
place: {
|
151650
|
+
kind: 'Identifier',
|
151651
|
+
identifier: dep.identifier,
|
151652
|
+
effect: exports.Effect.Capture,
|
151653
|
+
reactive: reactive,
|
151654
|
+
loc: loc,
|
151655
|
+
},
|
151656
|
+
loc: loc,
|
151657
|
+
},
|
151658
|
+
});
|
151659
|
+
for (const path of dep.path) {
|
151660
|
+
if (path.optional) {
|
151661
|
+
break;
|
151662
|
+
}
|
151663
|
+
const nextValue = createTemporaryPlace(env, GeneratedSource);
|
151664
|
+
nextValue.reactive = reactive;
|
151665
|
+
instructions.push({
|
151666
|
+
id: makeInstructionId(0),
|
151667
|
+
loc: GeneratedSource,
|
151668
|
+
lvalue: Object.assign(Object.assign({}, nextValue), {
|
151669
|
+
effect: exports.Effect.Mutate,
|
151670
|
+
}),
|
151671
|
+
value: {
|
151672
|
+
kind: 'PropertyLoad',
|
151673
|
+
object: Object.assign(Object.assign({}, currValue), {
|
151674
|
+
effect: exports.Effect.Capture,
|
151675
|
+
}),
|
151676
|
+
property: path.property,
|
151677
|
+
loc: loc,
|
151678
|
+
},
|
151679
|
+
});
|
151680
|
+
currValue = nextValue;
|
151681
|
+
}
|
151682
|
+
currValue.effect = exports.Effect.Freeze;
|
151683
|
+
return {place: currValue, instructions: instructions};
|
151684
|
+
}
|
151685
|
+
function inferReactiveIdentifiers(fn) {
|
151686
|
+
const reactiveIds = new Set();
|
151687
|
+
for (const [, block] of fn.body.blocks) {
|
151688
|
+
for (const instr of block.instructions) {
|
151689
|
+
for (const place of eachInstructionOperand(instr)) {
|
151690
|
+
if (place.reactive) {
|
151691
|
+
reactiveIds.add(place.identifier.id);
|
151692
|
+
}
|
151693
|
+
}
|
151694
|
+
}
|
151695
|
+
for (const place of eachTerminalOperand(block.terminal)) {
|
151696
|
+
if (place.reactive) {
|
151697
|
+
reactiveIds.add(place.identifier.id);
|
151698
|
+
}
|
151699
|
+
}
|
151700
|
+
}
|
151701
|
+
return reactiveIds;
|
151702
|
+
}
|
151432
151703
|
function instructionReordering(fn) {
|
151433
151704
|
var _a;
|
151434
151705
|
const shared = new Map();
|
@@ -157102,6 +157373,9 @@ function* runWithEnvironment(func, env) {
|
|
157102
157373
|
assertTerminalPredsExist(hir);
|
157103
157374
|
propagateScopeDependenciesHIR(hir);
|
157104
157375
|
yield log({kind: 'hir', name: 'PropagateScopeDependenciesHIR', value: hir});
|
157376
|
+
if (env.config.inferEffectDependencies) {
|
157377
|
+
inferEffectDependencies(hir);
|
157378
|
+
}
|
157105
157379
|
if (env.config.inlineJsxTransform) {
|
157106
157380
|
inlineJsxTransform(hir, env.config.inlineJsxTransform);
|
157107
157381
|
yield log({kind: 'hir', name: 'inlineJsxTransform', value: hir});
|
@@ -158346,10 +158620,13 @@ function runBabelPluginReactCompiler(
|
|
158346
158620
|
}
|
158347
158621
|
exports.CompilerError = CompilerError;
|
158348
158622
|
exports.CompilerErrorDetail = CompilerErrorDetail;
|
158623
|
+
exports.OPT_IN_DIRECTIVES = OPT_IN_DIRECTIVES;
|
158349
158624
|
exports.OPT_OUT_DIRECTIVES = OPT_OUT_DIRECTIVES;
|
158350
158625
|
exports.compile = compileFn;
|
158351
158626
|
exports.compileProgram = compileProgram;
|
158352
158627
|
exports.default = BabelPluginReactCompiler;
|
158628
|
+
exports.findDirectiveDisablingMemoization = findDirectiveDisablingMemoization;
|
158629
|
+
exports.findDirectiveEnablingMemoization = findDirectiveEnablingMemoization;
|
158353
158630
|
exports.parseConfigPragmaForTests = parseConfigPragmaForTests;
|
158354
158631
|
exports.parsePluginOptions = parsePluginOptions;
|
158355
158632
|
exports.printHIR = printHIR;
|