typescript 5.2.0-dev.20230531 → 5.2.0-dev.20230602
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/lib/tsc.js +81 -35
- package/lib/tsserver.js +140 -42
- package/lib/tsserverlibrary.js +140 -42
- package/lib/typescript.js +140 -42
- package/lib/typingsInstaller.js +8 -3
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230602`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -5986,8 +5986,6 @@ var Diagnostics = {
|
|
|
5986
5986
|
Class_constructor_may_not_be_a_generator: diag(1368, 1 /* Error */, "Class_constructor_may_not_be_a_generator_1368", "Class constructor may not be a generator."),
|
|
5987
5987
|
Did_you_mean_0: diag(1369, 3 /* Message */, "Did_you_mean_0_1369", "Did you mean '{0}'?"),
|
|
5988
5988
|
This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, 1 /* Error */, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),
|
|
5989
|
-
Convert_to_type_only_import: diag(1373, 3 /* Message */, "Convert_to_type_only_import_1373", "Convert to type-only import"),
|
|
5990
|
-
Convert_all_imports_not_used_as_a_value_to_type_only_imports: diag(1374, 3 /* Message */, "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374", "Convert all imports not used as a value to type-only imports"),
|
|
5991
5989
|
await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
5992
5990
|
_0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
5993
5991
|
_0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
@@ -7193,6 +7191,8 @@ var Diagnostics = {
|
|
|
7193
7191
|
Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."),
|
|
7194
7192
|
Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."),
|
|
7195
7193
|
Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."),
|
|
7194
|
+
Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0: diag(6417, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417", "Searching all ancestor node_modules directories for preferred extensions: {0}."),
|
|
7195
|
+
Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
|
|
7196
7196
|
The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
|
|
7197
7197
|
The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
|
|
7198
7198
|
The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
|
|
@@ -7705,6 +7705,9 @@ var Diagnostics = {
|
|
|
7705
7705
|
Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
|
|
7706
7706
|
Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
|
|
7707
7707
|
Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
|
|
7708
|
+
Use_import_type: diag(95180, 3 /* Message */, "Use_import_type_95180", "Use 'import type'"),
|
|
7709
|
+
Use_type_0: diag(95181, 3 /* Message */, "Use_type_0_95181", "Use 'type {0}'"),
|
|
7710
|
+
Fix_all_with_type_only_imports: diag(95182, 3 /* Message */, "Fix_all_with_type_only_imports_95182", "Fix all with type-only imports"),
|
|
7708
7711
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
7709
7712
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7710
7713
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -38483,11 +38486,13 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
|
|
|
38483
38486
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
38484
38487
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
38485
38488
|
if (priorityExtensions) {
|
|
38489
|
+
traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0, formatExtensions(priorityExtensions));
|
|
38486
38490
|
const result = lookup(priorityExtensions);
|
|
38487
38491
|
if (result)
|
|
38488
38492
|
return result;
|
|
38489
38493
|
}
|
|
38490
38494
|
if (secondaryExtensions && !typesScopeOnly) {
|
|
38495
|
+
traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0, formatExtensions(secondaryExtensions));
|
|
38491
38496
|
return lookup(secondaryExtensions);
|
|
38492
38497
|
}
|
|
38493
38498
|
function lookup(extensions2) {
|
|
@@ -64714,6 +64719,8 @@ function createTypeChecker(host) {
|
|
|
64714
64719
|
}
|
|
64715
64720
|
function isConstantReference(node) {
|
|
64716
64721
|
switch (node.kind) {
|
|
64722
|
+
case 110 /* ThisKeyword */:
|
|
64723
|
+
return true;
|
|
64717
64724
|
case 80 /* Identifier */:
|
|
64718
64725
|
if (!isThisInTypeQuery(node)) {
|
|
64719
64726
|
const symbol = getResolvedSymbol(node);
|
|
@@ -87813,8 +87820,9 @@ function transformClassFields(context) {
|
|
|
87813
87820
|
let pendingStatements;
|
|
87814
87821
|
let lexicalEnvironment;
|
|
87815
87822
|
const lexicalEnvironmentMap = /* @__PURE__ */ new Map();
|
|
87823
|
+
const noSubstitution = /* @__PURE__ */ new Set();
|
|
87816
87824
|
let currentClassContainer;
|
|
87817
|
-
let
|
|
87825
|
+
let currentClassElement;
|
|
87818
87826
|
let shouldSubstituteThisWithClassThis = false;
|
|
87819
87827
|
let previousShouldSubstituteThisWithClassThis = false;
|
|
87820
87828
|
return chainBundle(context, transformSourceFile);
|
|
@@ -87906,13 +87914,18 @@ function transformClassFields(context) {
|
|
|
87906
87914
|
return visitForStatement(node);
|
|
87907
87915
|
case 261 /* FunctionDeclaration */:
|
|
87908
87916
|
case 217 /* FunctionExpression */:
|
|
87917
|
+
return setCurrentClassElementAnd(
|
|
87918
|
+
/*classElement*/
|
|
87919
|
+
void 0,
|
|
87920
|
+
fallbackVisitor,
|
|
87921
|
+
node
|
|
87922
|
+
);
|
|
87909
87923
|
case 175 /* Constructor */:
|
|
87910
87924
|
case 173 /* MethodDeclaration */:
|
|
87911
87925
|
case 176 /* GetAccessor */:
|
|
87912
87926
|
case 177 /* SetAccessor */: {
|
|
87913
|
-
return
|
|
87914
|
-
|
|
87915
|
-
void 0,
|
|
87927
|
+
return setCurrentClassElementAnd(
|
|
87928
|
+
node,
|
|
87916
87929
|
fallbackVisitor,
|
|
87917
87930
|
node
|
|
87918
87931
|
);
|
|
@@ -88001,25 +88014,31 @@ function transformClassFields(context) {
|
|
|
88001
88014
|
function classElementVisitor(node) {
|
|
88002
88015
|
switch (node.kind) {
|
|
88003
88016
|
case 175 /* Constructor */:
|
|
88004
|
-
return
|
|
88017
|
+
return setCurrentClassElementAnd(
|
|
88018
|
+
node,
|
|
88019
|
+
visitConstructorDeclaration,
|
|
88020
|
+
node
|
|
88021
|
+
);
|
|
88005
88022
|
case 176 /* GetAccessor */:
|
|
88006
88023
|
case 177 /* SetAccessor */:
|
|
88007
88024
|
case 173 /* MethodDeclaration */:
|
|
88008
|
-
return
|
|
88009
|
-
|
|
88010
|
-
void 0,
|
|
88025
|
+
return setCurrentClassElementAnd(
|
|
88026
|
+
node,
|
|
88011
88027
|
visitMethodOrAccessorDeclaration,
|
|
88012
88028
|
node
|
|
88013
88029
|
);
|
|
88014
88030
|
case 171 /* PropertyDeclaration */:
|
|
88015
|
-
return
|
|
88016
|
-
|
|
88017
|
-
void 0,
|
|
88031
|
+
return setCurrentClassElementAnd(
|
|
88032
|
+
node,
|
|
88018
88033
|
visitPropertyDeclaration,
|
|
88019
88034
|
node
|
|
88020
88035
|
);
|
|
88021
88036
|
case 174 /* ClassStaticBlockDeclaration */:
|
|
88022
|
-
return
|
|
88037
|
+
return setCurrentClassElementAnd(
|
|
88038
|
+
node,
|
|
88039
|
+
visitClassStaticBlockDeclaration,
|
|
88040
|
+
node
|
|
88041
|
+
);
|
|
88023
88042
|
case 166 /* ComputedPropertyName */:
|
|
88024
88043
|
return visitComputedPropertyName(node);
|
|
88025
88044
|
case 239 /* SemicolonClassElement */:
|
|
@@ -88213,12 +88232,15 @@ function transformClassFields(context) {
|
|
|
88213
88232
|
}
|
|
88214
88233
|
return void 0;
|
|
88215
88234
|
}
|
|
88216
|
-
function
|
|
88217
|
-
|
|
88218
|
-
|
|
88219
|
-
|
|
88220
|
-
|
|
88221
|
-
|
|
88235
|
+
function setCurrentClassElementAnd(classElement, visitor2, arg) {
|
|
88236
|
+
if (classElement !== currentClassElement) {
|
|
88237
|
+
const savedCurrentClassElement = currentClassElement;
|
|
88238
|
+
currentClassElement = classElement;
|
|
88239
|
+
const result = visitor2(arg);
|
|
88240
|
+
currentClassElement = savedCurrentClassElement;
|
|
88241
|
+
return result;
|
|
88242
|
+
}
|
|
88243
|
+
return visitor2(arg);
|
|
88222
88244
|
}
|
|
88223
88245
|
function getHoistedFunctionName(node) {
|
|
88224
88246
|
Debug.assert(isPrivateIdentifier(node.name));
|
|
@@ -88380,8 +88402,21 @@ function transformClassFields(context) {
|
|
|
88380
88402
|
}
|
|
88381
88403
|
return transformFieldInitializer(node);
|
|
88382
88404
|
}
|
|
88405
|
+
function shouldForceDynamicThis() {
|
|
88406
|
+
return !!currentClassElement && hasStaticModifier(currentClassElement) && isAccessor(currentClassElement) && isAutoAccessorPropertyDeclaration(getOriginalNode(currentClassElement));
|
|
88407
|
+
}
|
|
88408
|
+
function ensureDynamicThisIfNeeded(node) {
|
|
88409
|
+
if (shouldForceDynamicThis()) {
|
|
88410
|
+
const innerExpression = skipOuterExpressions(node);
|
|
88411
|
+
if (innerExpression.kind === 110 /* ThisKeyword */) {
|
|
88412
|
+
noSubstitution.add(innerExpression);
|
|
88413
|
+
}
|
|
88414
|
+
}
|
|
88415
|
+
}
|
|
88383
88416
|
function createPrivateIdentifierAccess(info, receiver) {
|
|
88384
|
-
|
|
88417
|
+
receiver = visitNode(receiver, visitor, isExpression);
|
|
88418
|
+
ensureDynamicThisIfNeeded(receiver);
|
|
88419
|
+
return createPrivateIdentifierAccessHelper(info, receiver);
|
|
88385
88420
|
}
|
|
88386
88421
|
function createPrivateIdentifierAccessHelper(info, receiver) {
|
|
88387
88422
|
setCommentRange(receiver, moveRangePos(receiver, -1));
|
|
@@ -88426,7 +88461,7 @@ function transformClassFields(context) {
|
|
|
88426
88461
|
);
|
|
88427
88462
|
}
|
|
88428
88463
|
}
|
|
88429
|
-
if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) &&
|
|
88464
|
+
if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isIdentifier(node.name) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) {
|
|
88430
88465
|
const { classConstructor, superClassReference, facts } = lexicalEnvironment.data;
|
|
88431
88466
|
if (facts & 1 /* ClassWasDecorated */) {
|
|
88432
88467
|
return visitInvalidSuperProperty(node);
|
|
@@ -88445,7 +88480,7 @@ function transformClassFields(context) {
|
|
|
88445
88480
|
return visitEachChild(node, visitor, context);
|
|
88446
88481
|
}
|
|
88447
88482
|
function visitElementAccessExpression(node) {
|
|
88448
|
-
if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) &&
|
|
88483
|
+
if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) {
|
|
88449
88484
|
const { classConstructor, superClassReference, facts } = lexicalEnvironment.data;
|
|
88450
88485
|
if (facts & 1 /* ClassWasDecorated */) {
|
|
88451
88486
|
return visitInvalidSuperProperty(node);
|
|
@@ -88470,6 +88505,7 @@ function transformClassFields(context) {
|
|
|
88470
88505
|
let info;
|
|
88471
88506
|
if (info = accessPrivateIdentifier2(operand.name)) {
|
|
88472
88507
|
const receiver = visitNode(operand.expression, visitor, isExpression);
|
|
88508
|
+
ensureDynamicThisIfNeeded(receiver);
|
|
88473
88509
|
const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver);
|
|
88474
88510
|
let expression = createPrivateIdentifierAccess(info, readExpression);
|
|
88475
88511
|
const temp = isPrefixUnaryExpression(node) || discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration);
|
|
@@ -88488,7 +88524,7 @@ function transformClassFields(context) {
|
|
|
88488
88524
|
}
|
|
88489
88525
|
return expression;
|
|
88490
88526
|
}
|
|
88491
|
-
} else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) &&
|
|
88527
|
+
} else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(operand) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) {
|
|
88492
88528
|
const { classConstructor, superClassReference, facts } = lexicalEnvironment.data;
|
|
88493
88529
|
if (facts & 1 /* ClassWasDecorated */) {
|
|
88494
88530
|
const expression = visitInvalidSuperProperty(operand);
|
|
@@ -88545,6 +88581,9 @@ function transformClassFields(context) {
|
|
|
88545
88581
|
}
|
|
88546
88582
|
function createCopiableReceiverExpr(receiver) {
|
|
88547
88583
|
const clone2 = nodeIsSynthesized(receiver) ? receiver : factory2.cloneNode(receiver);
|
|
88584
|
+
if (receiver.kind === 110 /* ThisKeyword */ && noSubstitution.has(receiver)) {
|
|
88585
|
+
noSubstitution.add(clone2);
|
|
88586
|
+
}
|
|
88548
88587
|
if (isSimpleInlineableExpression(receiver)) {
|
|
88549
88588
|
return { readExpression: clone2, initializeExpression: void 0 };
|
|
88550
88589
|
}
|
|
@@ -88575,7 +88614,7 @@ function transformClassFields(context) {
|
|
|
88575
88614
|
[visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)]
|
|
88576
88615
|
);
|
|
88577
88616
|
}
|
|
88578
|
-
if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) &&
|
|
88617
|
+
if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.expression) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.classConstructor)) {
|
|
88579
88618
|
const invocation = factory2.createFunctionCallCall(
|
|
88580
88619
|
visitNode(node.expression, visitor, isExpression),
|
|
88581
88620
|
lexicalEnvironment.data.classConstructor,
|
|
@@ -88604,7 +88643,7 @@ function transformClassFields(context) {
|
|
|
88604
88643
|
visitNode(node.template, visitor, isTemplateLiteral)
|
|
88605
88644
|
);
|
|
88606
88645
|
}
|
|
88607
|
-
if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) &&
|
|
88646
|
+
if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.tag) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.classConstructor)) {
|
|
88608
88647
|
const invocation = factory2.createFunctionBindCall(
|
|
88609
88648
|
visitNode(node.tag, visitor, isExpression),
|
|
88610
88649
|
lexicalEnvironment.data.classConstructor,
|
|
@@ -88628,7 +88667,7 @@ function transformClassFields(context) {
|
|
|
88628
88667
|
}
|
|
88629
88668
|
if (shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
88630
88669
|
startLexicalEnvironment();
|
|
88631
|
-
let statements =
|
|
88670
|
+
let statements = setCurrentClassElementAnd(
|
|
88632
88671
|
node,
|
|
88633
88672
|
(statements2) => visitNodes2(statements2, visitor, isStatement),
|
|
88634
88673
|
node.body.statements
|
|
@@ -88690,7 +88729,7 @@ function transformClassFields(context) {
|
|
|
88690
88729
|
node
|
|
88691
88730
|
);
|
|
88692
88731
|
}
|
|
88693
|
-
} else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) &&
|
|
88732
|
+
} else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.left) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) {
|
|
88694
88733
|
const { classConstructor, superClassReference, facts } = lexicalEnvironment.data;
|
|
88695
88734
|
if (facts & 1 /* ClassWasDecorated */) {
|
|
88696
88735
|
return factory2.updateBinaryExpression(
|
|
@@ -88785,6 +88824,7 @@ function transformClassFields(context) {
|
|
|
88785
88824
|
function createPrivateIdentifierAssignment(info, receiver, right, operator) {
|
|
88786
88825
|
receiver = visitNode(receiver, visitor, isExpression);
|
|
88787
88826
|
right = visitNode(right, visitor, isExpression);
|
|
88827
|
+
ensureDynamicThisIfNeeded(receiver);
|
|
88788
88828
|
if (isCompoundAssignment(operator)) {
|
|
88789
88829
|
const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver);
|
|
88790
88830
|
receiver = initializeExpression || readExpression;
|
|
@@ -89427,7 +89467,7 @@ function transformClassFields(context) {
|
|
|
89427
89467
|
}
|
|
89428
89468
|
function transformProperty(property, receiver) {
|
|
89429
89469
|
var _a;
|
|
89430
|
-
const
|
|
89470
|
+
const savedCurrentClassElement = currentClassElement;
|
|
89431
89471
|
const transformed = transformPropertyWorker(property, receiver);
|
|
89432
89472
|
if (transformed && hasStaticModifier(property) && ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.facts)) {
|
|
89433
89473
|
setOriginalNode(transformed, property);
|
|
@@ -89435,7 +89475,7 @@ function transformClassFields(context) {
|
|
|
89435
89475
|
setSourceMapRange(transformed, getSourceMapRange(property.name));
|
|
89436
89476
|
lexicalEnvironmentMap.set(getOriginalNode(property), lexicalEnvironment);
|
|
89437
89477
|
}
|
|
89438
|
-
|
|
89478
|
+
currentClassElement = savedCurrentClassElement;
|
|
89439
89479
|
return transformed;
|
|
89440
89480
|
}
|
|
89441
89481
|
function transformPropertyWorker(property, receiver) {
|
|
@@ -89452,7 +89492,7 @@ function transformClassFields(context) {
|
|
|
89452
89492
|
}
|
|
89453
89493
|
const propertyName = hasAccessorModifier(property) ? factory2.getGeneratedPrivateNameForNode(property.name) : isComputedPropertyName(property.name) && !isSimpleInlineableExpression(property.name.expression) ? factory2.updateComputedPropertyName(property.name, factory2.getGeneratedNameForNode(property.name)) : property.name;
|
|
89454
89494
|
if (hasStaticModifier(property)) {
|
|
89455
|
-
|
|
89495
|
+
currentClassElement = property;
|
|
89456
89496
|
}
|
|
89457
89497
|
const initializerVisitor = referencedName ? (child) => namedEvaluationVisitor(child, referencedName) : visitor;
|
|
89458
89498
|
if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property)) {
|
|
@@ -89777,7 +89817,7 @@ function transformClassFields(context) {
|
|
|
89777
89817
|
}
|
|
89778
89818
|
if (isPrivateIdentifierPropertyAccessExpression(node)) {
|
|
89779
89819
|
return wrapPrivateIdentifierForDestructuringTarget(node);
|
|
89780
|
-
} else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) &&
|
|
89820
|
+
} else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) {
|
|
89781
89821
|
const { classConstructor, superClassReference, facts } = lexicalEnvironment.data;
|
|
89782
89822
|
if (facts & 1 /* ClassWasDecorated */) {
|
|
89783
89823
|
return visitInvalidSuperProperty(node);
|
|
@@ -89957,7 +89997,7 @@ function transformClassFields(context) {
|
|
|
89957
89997
|
return node;
|
|
89958
89998
|
}
|
|
89959
89999
|
function substituteThisExpression(node) {
|
|
89960
|
-
if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) {
|
|
90000
|
+
if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !noSubstitution.has(node)) {
|
|
89961
90001
|
const { facts, classConstructor, classThis } = lexicalEnvironment.data;
|
|
89962
90002
|
if (facts & 1 /* ClassWasDecorated */ && legacyDecorators) {
|
|
89963
90003
|
return factory2.createParenthesizedExpression(factory2.createVoidZero());
|
|
@@ -90026,6 +90066,12 @@ function isReservedPrivateName(node) {
|
|
|
90026
90066
|
function isPrivateIdentifierInExpression(node) {
|
|
90027
90067
|
return isPrivateIdentifier(node.left) && node.operatorToken.kind === 103 /* InKeyword */;
|
|
90028
90068
|
}
|
|
90069
|
+
function isStaticPropertyDeclaration2(node) {
|
|
90070
|
+
return isPropertyDeclaration(node) && hasStaticModifier(node);
|
|
90071
|
+
}
|
|
90072
|
+
function isStaticPropertyDeclarationOrClassStaticBlock(node) {
|
|
90073
|
+
return isClassStaticBlockDeclaration(node) || isStaticPropertyDeclaration2(node);
|
|
90074
|
+
}
|
|
90029
90075
|
|
|
90030
90076
|
// src/compiler/transformers/typeSerializer.ts
|
|
90031
90077
|
function createRuntimeTypeSerializer(context) {
|
|
@@ -95360,7 +95406,7 @@ function transformJsx(context) {
|
|
|
95360
95406
|
continue;
|
|
95361
95407
|
}
|
|
95362
95408
|
finishObjectLiteralIfNeeded();
|
|
95363
|
-
expressions.push(attr.expression);
|
|
95409
|
+
expressions.push(Debug.checkDefined(visitNode(attr.expression, visitor, isExpression)));
|
|
95364
95410
|
continue;
|
|
95365
95411
|
}
|
|
95366
95412
|
properties.push(transformJsxAttributeToObjectLiteralElement(attr));
|