@artel/artc 0.6.25268 → 0.6.25269
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/build/Cli.js +3 -3
- package/build/api/Api.js +2 -2
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +1 -1
- package/build/{chunk-ZWWFRARE.js → chunk-A24SR6QN.js} +2 -2
- package/build/{chunk-SXWZFJ3Z.js → chunk-A5H2QLXZ.js} +978 -1072
- package/build/{chunk-65DE73QR.js → chunk-REZSITUH.js} +1 -1
- package/build/types/emitter/EmitterContext.d.ts +2 -2
- package/build/types/emitter/ErrorBoundary.d.ts +3 -3
- package/build/types/emitter/IrFactory.d.ts +38 -25
- package/build/types/emitter/ir/Nodes.d.ts +67 -50
- package/package.json +1 -1
|
@@ -78,10 +78,10 @@ var PackageDialect = /* @__PURE__ */ ((PackageDialect45) => {
|
|
|
78
78
|
})(PackageDialect || {});
|
|
79
79
|
|
|
80
80
|
// source/common/PackageLocale.ts
|
|
81
|
-
var PackageLocale = /* @__PURE__ */ ((
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return
|
|
81
|
+
var PackageLocale = /* @__PURE__ */ ((PackageLocale52) => {
|
|
82
|
+
PackageLocale52[PackageLocale52["En"] = 0] = "En";
|
|
83
|
+
PackageLocale52[PackageLocale52["Ru"] = 1] = "Ru";
|
|
84
|
+
return PackageLocale52;
|
|
85
85
|
})(PackageLocale || {});
|
|
86
86
|
var locales = [
|
|
87
87
|
{ locale: 0 /* En */, code: "en", names: ["english", "\u0430\u043D\u0433\u043B\u0438\u0439\u0441\u043A\u0438\u0439"] },
|
|
@@ -702,7 +702,7 @@ var UniqueWithComparatorQuery = class extends Query {
|
|
|
702
702
|
};
|
|
703
703
|
|
|
704
704
|
// source/common/Constants.ts
|
|
705
|
-
var ArtelVersion = true ? "0.6.
|
|
705
|
+
var ArtelVersion = true ? "0.6.25269" : "";
|
|
706
706
|
var ArtelSourceFileExtensions = [".\u0430\u0440\u0442", ".\u0430\u0440\u0442\u0435\u043B\u044C", ".art", ".artel"];
|
|
707
707
|
var ArtelSourceFileExtensionSet = new Set(ArtelSourceFileExtensions);
|
|
708
708
|
var ArtelSourceAndConfigurationFileExtensionSet = new Set(ArtelSourceFileExtensionSet).add(".json");
|
|
@@ -823,11 +823,11 @@ var performanceMeasurementStageNames = {
|
|
|
823
823
|
};
|
|
824
824
|
|
|
825
825
|
// source/common/AccessKind.ts
|
|
826
|
-
var AccessKind = /* @__PURE__ */ ((
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
return
|
|
826
|
+
var AccessKind = /* @__PURE__ */ ((AccessKind3) => {
|
|
827
|
+
AccessKind3[AccessKind3["Get"] = 0] = "Get";
|
|
828
|
+
AccessKind3[AccessKind3["Set"] = 1] = "Set";
|
|
829
|
+
AccessKind3[AccessKind3["GetSet"] = 2] = "GetSet";
|
|
830
|
+
return AccessKind3;
|
|
831
831
|
})(AccessKind || {});
|
|
832
832
|
|
|
833
833
|
// source/common/ArrayUtils.ts
|
|
@@ -11545,13 +11545,13 @@ var DeclarationContainer;
|
|
|
11545
11545
|
}
|
|
11546
11546
|
}
|
|
11547
11547
|
DeclarationContainer2.TypeExtension = TypeExtension;
|
|
11548
|
-
class
|
|
11548
|
+
class Package2 {
|
|
11549
11549
|
constructor(entity) {
|
|
11550
11550
|
this.entity = entity;
|
|
11551
11551
|
this.kind = "package";
|
|
11552
11552
|
}
|
|
11553
11553
|
}
|
|
11554
|
-
DeclarationContainer2.Package =
|
|
11554
|
+
DeclarationContainer2.Package = Package2;
|
|
11555
11555
|
})(DeclarationContainer || (DeclarationContainer = {}));
|
|
11556
11556
|
var FunctionDeclarationDisplayParts = class {
|
|
11557
11557
|
constructor(asyncKeywordWithWhitespace, functionKeyword, whitespaceAfterFunctionKeyword, container, name, typeParametersStart, typeParameters, typeParameterSeparator, typeParametersEnd, parametersStart, parameters, parameterSeparator, parametersEnd, returnTypeAnnotationColon, returnType) {
|
|
@@ -25362,10 +25362,10 @@ var SourcePackageMembersCreator = class {
|
|
|
25362
25362
|
|
|
25363
25363
|
// source/ts-interop/TsPackageMembersCreator.ts
|
|
25364
25364
|
var TsPackageMembersCreator = class {
|
|
25365
|
-
constructor(tsctx, symbols,
|
|
25365
|
+
constructor(tsctx, symbols, packageEntity2, sourcePackageToMergeWith, forceMembersAreHiddenInPackage = false) {
|
|
25366
25366
|
this.tsctx = tsctx;
|
|
25367
25367
|
this.symbols = symbols;
|
|
25368
|
-
this.packageEntity =
|
|
25368
|
+
this.packageEntity = packageEntity2;
|
|
25369
25369
|
this.sourcePackageToMergeWith = sourcePackageToMergeWith;
|
|
25370
25370
|
this.forceMembersAreHiddenInPackage = forceMembersAreHiddenInPackage;
|
|
25371
25371
|
this.typeEntityBySymbol = /* @__PURE__ */ new Map();
|
|
@@ -25752,10 +25752,10 @@ var TsPackageMembersCreationResult = class {
|
|
|
25752
25752
|
|
|
25753
25753
|
// source/ts-interop/TsPackageContents.ts
|
|
25754
25754
|
var TsPackageContents = class {
|
|
25755
|
-
constructor(tsctx, symbols,
|
|
25755
|
+
constructor(tsctx, symbols, packageEntity2, sourcePackageToMergeWith) {
|
|
25756
25756
|
this.tsctx = tsctx;
|
|
25757
25757
|
this.symbols = symbols;
|
|
25758
|
-
this.packageEntity =
|
|
25758
|
+
this.packageEntity = packageEntity2;
|
|
25759
25759
|
this.sourcePackageToMergeWith = sourcePackageToMergeWith;
|
|
25760
25760
|
this.kind = "module";
|
|
25761
25761
|
this.membersCreationResult = new Cached();
|
|
@@ -30679,8 +30679,8 @@ var TranslatedName = class {
|
|
|
30679
30679
|
}
|
|
30680
30680
|
};
|
|
30681
30681
|
var ReferencedPackagesCollector = class {
|
|
30682
|
-
constructor(
|
|
30683
|
-
this.packageEntity =
|
|
30682
|
+
constructor(packageEntity2) {
|
|
30683
|
+
this.packageEntity = packageEntity2;
|
|
30684
30684
|
this.referencedPackages = /* @__PURE__ */ new Set();
|
|
30685
30685
|
}
|
|
30686
30686
|
collect() {
|
|
@@ -35536,8 +35536,8 @@ var OwnAndBaseConstructorCallsChecker = class {
|
|
|
35536
35536
|
baseConstructorWithoutParameters = searchResult.constructor;
|
|
35537
35537
|
baseTypeHasAccessibleConstructors = searchResult.hasAccessibleConstructors;
|
|
35538
35538
|
}
|
|
35539
|
-
for (const
|
|
35540
|
-
const block =
|
|
35539
|
+
for (const constructorDeclaration2 of this.constructorDeclarations) {
|
|
35540
|
+
const block = constructorDeclaration2.block;
|
|
35541
35541
|
if (block === void 0) {
|
|
35542
35542
|
continue;
|
|
35543
35543
|
}
|
|
@@ -35549,7 +35549,7 @@ var OwnAndBaseConstructorCallsChecker = class {
|
|
|
35549
35549
|
isFirstStatementOwnOrBaseConstructorCall = true;
|
|
35550
35550
|
const meaning = this.analyzer.resolveObjectExpression(callee).meaning;
|
|
35551
35551
|
if (meaning.kind === "own-constructor-access" && meaning.singleConstructor !== void 0) {
|
|
35552
|
-
const entity = this.analyzer.entity.ofConstructorDeclaration(
|
|
35552
|
+
const entity = this.analyzer.entity.ofConstructorDeclaration(constructorDeclaration2);
|
|
35553
35553
|
this.addOwnConstructorCallOrReportCycleDiagnostic(
|
|
35554
35554
|
entity,
|
|
35555
35555
|
meaning.singleConstructor.getEntity(),
|
|
@@ -35562,19 +35562,19 @@ var OwnAndBaseConstructorCallsChecker = class {
|
|
|
35562
35562
|
isFirstStatementOwnOrBaseConstructorCall = true;
|
|
35563
35563
|
const meaning = this.analyzer.resolveBaseExpression(callee).meaning;
|
|
35564
35564
|
if (meaning.kind === "base-constructor-access" && meaning.singleConstructor !== void 0) {
|
|
35565
|
-
const entity = this.analyzer.entity.ofConstructorDeclaration(
|
|
35565
|
+
const entity = this.analyzer.entity.ofConstructorDeclaration(constructorDeclaration2);
|
|
35566
35566
|
baseConstructorCalls.set(entity, meaning.singleConstructor);
|
|
35567
35567
|
}
|
|
35568
35568
|
}
|
|
35569
35569
|
}
|
|
35570
35570
|
if (!isFirstStatementOwnOrBaseConstructorCall) {
|
|
35571
35571
|
if (baseConstructorWithoutParameters !== void 0) {
|
|
35572
|
-
const entity = this.analyzer.entity.ofConstructorDeclaration(
|
|
35572
|
+
const entity = this.analyzer.entity.ofConstructorDeclaration(constructorDeclaration2);
|
|
35573
35573
|
baseConstructorCalls.set(entity, baseConstructorWithoutParameters);
|
|
35574
35574
|
} else if (baseTypeHasAccessibleConstructors) {
|
|
35575
35575
|
diagnostics.push(this.analyzer.createNodeDiagnostic(
|
|
35576
35576
|
359 /* TheFirstStatementOfConstructorBlockMustBeEitherBaseOrOwnConstructorCall */,
|
|
35577
|
-
|
|
35577
|
+
constructorDeclaration2.creationKeyword
|
|
35578
35578
|
));
|
|
35579
35579
|
}
|
|
35580
35580
|
}
|
|
@@ -36818,14 +36818,14 @@ var PackageAndStaticVariablesInitializationValidator = class {
|
|
|
36818
36818
|
this.diagnostics = diagnostics;
|
|
36819
36819
|
}
|
|
36820
36820
|
validate() {
|
|
36821
|
-
const
|
|
36822
|
-
const variables = this.getVariablesThatNeedToBeInitializedInConstructor(
|
|
36821
|
+
const packageEntity2 = this.analyzer.entity.ofPackage(this.package_);
|
|
36822
|
+
const variables = this.getVariablesThatNeedToBeInitializedInConstructor(packageEntity2);
|
|
36823
36823
|
if (variables.length === 0) {
|
|
36824
36824
|
return;
|
|
36825
36825
|
}
|
|
36826
36826
|
const constructorDeclarations = this.package_.sourceFiles.flatMap((f) => Query.from(flattenPackageMemberDeclarationList(f.getSyntaxNode().declarationList)).filter((d) => d.kind === 23 /* PackageConstructorDeclaration */).toArray());
|
|
36827
|
-
for (const
|
|
36828
|
-
this.excludeVariablesInitializedInConstructor(
|
|
36827
|
+
for (const constructorDeclaration2 of constructorDeclarations) {
|
|
36828
|
+
this.excludeVariablesInitializedInConstructor(constructorDeclaration2, variables);
|
|
36829
36829
|
if (variables.length === 0) {
|
|
36830
36830
|
break;
|
|
36831
36831
|
}
|
|
@@ -36834,9 +36834,9 @@ var PackageAndStaticVariablesInitializationValidator = class {
|
|
|
36834
36834
|
this.reportNotInitialedVariableDiagnostic(variable);
|
|
36835
36835
|
}
|
|
36836
36836
|
}
|
|
36837
|
-
getVariablesThatNeedToBeInitializedInConstructor(
|
|
36837
|
+
getVariablesThatNeedToBeInitializedInConstructor(packageEntity2) {
|
|
36838
36838
|
const result = new Array();
|
|
36839
|
-
for (const member of
|
|
36839
|
+
for (const member of packageEntity2.getMembers().getNamedMembers()) {
|
|
36840
36840
|
if (member.kind === 0 /* Variable */ && !isComputedVariableEntity(member) && !this.analyzer.isNullAssignableToType(member.getType())) {
|
|
36841
36841
|
const definition = member.getDefinition();
|
|
36842
36842
|
if (definition.kind === 0 /* Source */) {
|
|
@@ -37533,11 +37533,11 @@ var Resolver10 = class {
|
|
|
37533
37533
|
}
|
|
37534
37534
|
}
|
|
37535
37535
|
if (resolvedQualifier === void 0) {
|
|
37536
|
-
const
|
|
37537
|
-
if (
|
|
37536
|
+
const packageEntity2 = qualifier.kind === "package-alias" ? qualifier.packageAlias.getPackage() : qualifier.packageTreeNode.package;
|
|
37537
|
+
if (packageEntity2 === void 0) {
|
|
37538
37538
|
diagnostic = this.analyzer.createNodeDiagnostic(289 /* TagNotFound */, nodeForDiagnostic);
|
|
37539
37539
|
} else {
|
|
37540
|
-
const lookup = new PackageMemberLookup(
|
|
37540
|
+
const lookup = new PackageMemberLookup(packageEntity2);
|
|
37541
37541
|
const declarations = lookup.getNamedMembersByName(name, this.semanticContext.getHidingMatcher());
|
|
37542
37542
|
if (declarations.length === 0) {
|
|
37543
37543
|
diagnostic = this.analyzer.createNodeDiagnostic(289 /* TagNotFound */, nodeForDiagnostic);
|
|
@@ -37736,9 +37736,9 @@ var DisplayableEntity = class {
|
|
|
37736
37736
|
}
|
|
37737
37737
|
};
|
|
37738
37738
|
var DisplayableAccessedFunction = class {
|
|
37739
|
-
constructor(analyzer,
|
|
37739
|
+
constructor(analyzer, accessedFunction2, locale, dialect, contextualSourceFile) {
|
|
37740
37740
|
this.analyzer = analyzer;
|
|
37741
|
-
this.accessedFunction =
|
|
37741
|
+
this.accessedFunction = accessedFunction2;
|
|
37742
37742
|
this.locale = locale;
|
|
37743
37743
|
this.dialect = dialect;
|
|
37744
37744
|
this.contextualSourceFile = contextualSourceFile;
|
|
@@ -37800,10 +37800,10 @@ var DiagnosticArgumentFactory = class {
|
|
|
37800
37800
|
createDisplayableEntity(entity) {
|
|
37801
37801
|
return new DisplayableEntity(this.analyzer, entity, this.locale, this.dialect, this.contextualSourceFile);
|
|
37802
37802
|
}
|
|
37803
|
-
createDisplayableAccessedFunction(
|
|
37803
|
+
createDisplayableAccessedFunction(accessedFunction2) {
|
|
37804
37804
|
return new DisplayableAccessedFunction(
|
|
37805
37805
|
this.analyzer,
|
|
37806
|
-
|
|
37806
|
+
accessedFunction2,
|
|
37807
37807
|
this.locale,
|
|
37808
37808
|
this.dialect,
|
|
37809
37809
|
this.contextualSourceFile
|
|
@@ -38782,7 +38782,7 @@ var SubprogramInfo;
|
|
|
38782
38782
|
}
|
|
38783
38783
|
}
|
|
38784
38784
|
SubprogramInfo6.PackageEntryPoint = PackageEntryPoint;
|
|
38785
|
-
class
|
|
38785
|
+
class FunctionLiteral3 {
|
|
38786
38786
|
constructor(analyzer, node) {
|
|
38787
38787
|
this.kind = "function-literal";
|
|
38788
38788
|
this.analyzer = analyzer;
|
|
@@ -38812,7 +38812,7 @@ var SubprogramInfo;
|
|
|
38812
38812
|
}
|
|
38813
38813
|
}
|
|
38814
38814
|
}
|
|
38815
|
-
SubprogramInfo6.FunctionLiteral =
|
|
38815
|
+
SubprogramInfo6.FunctionLiteral = FunctionLiteral3;
|
|
38816
38816
|
class TextTranslationFunction {
|
|
38817
38817
|
constructor(analyzer, node) {
|
|
38818
38818
|
this.kind = "text-translation-function";
|
|
@@ -39874,11 +39874,11 @@ var SourceFileSemanticContext = class extends SemanticContextBase {
|
|
|
39874
39874
|
}
|
|
39875
39875
|
getDiagnosticArgumentFactory() {
|
|
39876
39876
|
return this.diagnosticArgumentFactory.getOrInsertWith(() => {
|
|
39877
|
-
const
|
|
39877
|
+
const packageEntity2 = this.getPackage();
|
|
39878
39878
|
return new DiagnosticArgumentFactory(
|
|
39879
39879
|
this.analyzer,
|
|
39880
|
-
|
|
39881
|
-
|
|
39880
|
+
packageEntity2.getLocale(),
|
|
39881
|
+
packageEntity2.getDialect(),
|
|
39882
39882
|
this.sourceFile
|
|
39883
39883
|
);
|
|
39884
39884
|
});
|
|
@@ -41926,11 +41926,11 @@ var Analyzer13 = class {
|
|
|
41926
41926
|
const type = this.type.ofFunctionBlockLiteral(node);
|
|
41927
41927
|
result = this.parametersOfFunctionBlockLiterals.get(node);
|
|
41928
41928
|
if (result === void 0) {
|
|
41929
|
-
const
|
|
41929
|
+
const packageEntity2 = TreeQuery.getPackageEntity(node, this);
|
|
41930
41930
|
result = type.getParameters().map((p) => new IntrinsicParameterEntity(
|
|
41931
41931
|
p.getEntity().getName(),
|
|
41932
41932
|
p.getType(),
|
|
41933
|
-
|
|
41933
|
+
packageEntity2,
|
|
41934
41934
|
p.isOptional(),
|
|
41935
41935
|
p.isVariadic(),
|
|
41936
41936
|
new ImplicitFunctionBlockParameterSpecialVariableEntityInfo(p, node)
|
|
@@ -42023,11 +42023,11 @@ var Analyzer13 = class {
|
|
|
42023
42023
|
let result = this.linkedMultiPlatformPackagesByPlatform.get(entity);
|
|
42024
42024
|
if (result === void 0) {
|
|
42025
42025
|
const packageByPlatform = /* @__PURE__ */ new Map();
|
|
42026
|
-
for (const
|
|
42027
|
-
const implementedPackage =
|
|
42026
|
+
for (const packageEntity2 of this.getOriginalPackageEntities()) {
|
|
42027
|
+
const implementedPackage = packageEntity2.getImplementedInterfacePackage();
|
|
42028
42028
|
if (implementedPackage === entity) {
|
|
42029
|
-
for (const platform of
|
|
42030
|
-
const linkedPackage = new LinkedMultiPlatformPackage(this, entity,
|
|
42029
|
+
for (const platform of packageEntity2.getSupportedPlatforms()) {
|
|
42030
|
+
const linkedPackage = new LinkedMultiPlatformPackage(this, entity, packageEntity2, platform);
|
|
42031
42031
|
packageByPlatform.set(platform, linkedPackage);
|
|
42032
42032
|
}
|
|
42033
42033
|
}
|
|
@@ -42832,15 +42832,15 @@ var Analyzer13 = class {
|
|
|
42832
42832
|
return this.getNodeDiagnosticLocation(definition.value.nodes[0].name);
|
|
42833
42833
|
} else if (definition.value.nodes.length > 1) {
|
|
42834
42834
|
if (definition.value.nodes.every((n) => n.kind === 151 /* ParameterDeclaration */)) {
|
|
42835
|
-
let
|
|
42835
|
+
let parameterDeclaration2;
|
|
42836
42836
|
const setterParameterDeclaration = definition.value.nodes.find((n) => n.parent.parent.parent.kind === 46 /* IndexedElementSetterDeclaration */);
|
|
42837
42837
|
if (chooseSetter) {
|
|
42838
|
-
|
|
42838
|
+
parameterDeclaration2 = setterParameterDeclaration;
|
|
42839
42839
|
} else {
|
|
42840
42840
|
const getterParameterDeclaration = definition.value.nodes.find((n) => n.parent.parent.parent.kind === 45 /* IndexedElementGetterDeclaration */);
|
|
42841
|
-
|
|
42841
|
+
parameterDeclaration2 = getterParameterDeclaration ?? setterParameterDeclaration;
|
|
42842
42842
|
}
|
|
42843
|
-
return
|
|
42843
|
+
return parameterDeclaration2 !== void 0 ? this.getNodeDiagnosticLocation(parameterDeclaration2.name) : void 0;
|
|
42844
42844
|
} else {
|
|
42845
42845
|
return this.getNodeDiagnosticLocation(definition.value.nodes[0].name);
|
|
42846
42846
|
}
|
|
@@ -43194,13 +43194,13 @@ var WellKnownDeclarationsLoader = class {
|
|
|
43194
43194
|
javaScriptDecorator: this.findPackageType(interopPackage, new Name("\u0414\u0435\u043A\u043E\u0440\u0430\u0442\u043E\u0440\u0414\u0436\u0430\u0432\u0430\u0421\u043A\u0440\u0438\u043F\u0442"), 0, 1 /* Structured */)
|
|
43195
43195
|
};
|
|
43196
43196
|
}
|
|
43197
|
-
findPackageType(
|
|
43198
|
-
const type =
|
|
43197
|
+
findPackageType(packageEntity2, name, arity, typeEntityKind) {
|
|
43198
|
+
const type = packageEntity2.getMembers().getNamedMembersByName(name).filter((d) => d.kind === 2 /* Type */ && d.typeEntityKind === typeEntityKind).filter((t) => t.getArity() === arity).at(0);
|
|
43199
43199
|
if (type === void 0) {
|
|
43200
43200
|
throw new WellKnownDeclarationsLoadError(new Diagnostic(
|
|
43201
43201
|
DiagnosticData.withCode(
|
|
43202
43202
|
406 /* Declaration0NotFoundInStandardPackage1 */,
|
|
43203
|
-
[name.unescapedOriginal,
|
|
43203
|
+
[name.unescapedOriginal, packageEntity2.getName().toString()]
|
|
43204
43204
|
),
|
|
43205
43205
|
void 0
|
|
43206
43206
|
));
|
|
@@ -45292,10 +45292,10 @@ var SourceFileMembersMap = class {
|
|
|
45292
45292
|
Debug.never(d);
|
|
45293
45293
|
}
|
|
45294
45294
|
}
|
|
45295
|
-
const
|
|
45296
|
-
const isInterfacePackageFile =
|
|
45295
|
+
const packageEntity2 = TreeQuery.getPackageEntity(node, this.analyzer);
|
|
45296
|
+
const isInterfacePackageFile = packageEntity2.getInterfacePackageInfo() !== void 0;
|
|
45297
45297
|
if (!isInterfacePackageFile) {
|
|
45298
|
-
const backingVariables = this.analyzer.createBackingPackageVariables(namedMembers,
|
|
45298
|
+
const backingVariables = this.analyzer.createBackingPackageVariables(namedMembers, packageEntity2);
|
|
45299
45299
|
namedMembers.push(...backingVariables);
|
|
45300
45300
|
}
|
|
45301
45301
|
result = new SourceFileMembers(this.analyzer, namedMembers, typeExtensionEntities);
|
|
@@ -47589,8 +47589,8 @@ var InstanceFieldsInitializationValidator = class {
|
|
|
47589
47589
|
this.diagnostics.addDiagnostic(new Diagnostic(data, location));
|
|
47590
47590
|
}
|
|
47591
47591
|
} else {
|
|
47592
|
-
for (const
|
|
47593
|
-
this.checkConstructorInitializesAllFields(
|
|
47592
|
+
for (const constructorDeclaration2 of declaredConstructors) {
|
|
47593
|
+
this.checkConstructorInitializesAllFields(constructorDeclaration2, fields);
|
|
47594
47594
|
}
|
|
47595
47595
|
}
|
|
47596
47596
|
}
|
|
@@ -48629,11 +48629,11 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
|
48629
48629
|
);
|
|
48630
48630
|
const targetType = this.analyzer.getTargetTypeOfExpression(node);
|
|
48631
48631
|
if (targetType === void 0) {
|
|
48632
|
-
for (const
|
|
48633
|
-
if (
|
|
48632
|
+
for (const parameterDeclaration2 of node.parameterClause.parameterList.parameters) {
|
|
48633
|
+
if (parameterDeclaration2.typeAnnotation === void 0) {
|
|
48634
48634
|
this.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
48635
48635
|
372 /* CannotInferTypeOfFunctionLiteralAddTypeSpecifierForParameter */,
|
|
48636
|
-
|
|
48636
|
+
parameterDeclaration2.name
|
|
48637
48637
|
));
|
|
48638
48638
|
}
|
|
48639
48639
|
}
|
|
@@ -50123,16 +50123,16 @@ var SourcePackageDependencyGraph = class {
|
|
|
50123
50123
|
}
|
|
50124
50124
|
}
|
|
50125
50125
|
}
|
|
50126
|
-
for (const [
|
|
50127
|
-
const definition =
|
|
50126
|
+
for (const [packageEntity2, translationPackages] of translationPackagesByImportedPackage) {
|
|
50127
|
+
const definition = packageEntity2.getDefinition();
|
|
50128
50128
|
if (definition.kind !== 0 /* Source */) {
|
|
50129
50129
|
continue;
|
|
50130
50130
|
}
|
|
50131
50131
|
const node = this.getNodeForPackage(definition.package);
|
|
50132
50132
|
const translationPackageArray = Array.from(translationPackages);
|
|
50133
50133
|
const implementationPackagesByPlatformKind = /* @__PURE__ */ new Map();
|
|
50134
|
-
if (
|
|
50135
|
-
const linkedMultiPlatformPackagesByPlatform = this.analyzer.getLinkedMultiPlatformPackagesByPlatform(
|
|
50134
|
+
if (packageEntity2.getInterfacePackageInfo()?.kind === "multi-platform") {
|
|
50135
|
+
const linkedMultiPlatformPackagesByPlatform = this.analyzer.getLinkedMultiPlatformPackagesByPlatform(packageEntity2);
|
|
50136
50136
|
if (linkedMultiPlatformPackagesByPlatform !== void 0) {
|
|
50137
50137
|
for (const [platform, linkedPackage] of linkedMultiPlatformPackagesByPlatform) {
|
|
50138
50138
|
const linkedPackageDefinition = linkedPackage.implementationPackage.getDefinition();
|
|
@@ -51665,8 +51665,8 @@ var EntityHidingLevel_file = class {
|
|
|
51665
51665
|
}
|
|
51666
51666
|
};
|
|
51667
51667
|
var EntityHidingLevel_package = class {
|
|
51668
|
-
constructor(
|
|
51669
|
-
this.packageEntity =
|
|
51668
|
+
constructor(packageEntity2) {
|
|
51669
|
+
this.packageEntity = packageEntity2;
|
|
51670
51670
|
this.kind = "package";
|
|
51671
51671
|
}
|
|
51672
51672
|
};
|
|
@@ -56485,26 +56485,27 @@ var CommaExpression = class _CommaExpression {
|
|
|
56485
56485
|
}
|
|
56486
56486
|
};
|
|
56487
56487
|
var ConstructorCallExpression = class _ConstructorCallExpression {
|
|
56488
|
-
constructor(entity,
|
|
56488
|
+
constructor(entity, typeAccess, args, returnType, sourceLocation) {
|
|
56489
56489
|
this.entity = entity;
|
|
56490
|
-
this.containingTypeOfConstructor = containingTypeOfConstructor;
|
|
56491
56490
|
this.typeAccess = typeAccess;
|
|
56492
56491
|
this.args = args;
|
|
56493
56492
|
this.returnType = returnType;
|
|
56494
56493
|
this.sourceLocation = sourceLocation;
|
|
56495
|
-
this.options = options;
|
|
56496
56494
|
this.kind = 72 /* ConstructorCallExpression */;
|
|
56495
|
+
this.options = ConstructorCallExpressionEmitOptions.default();
|
|
56496
|
+
}
|
|
56497
|
+
withOptions(options) {
|
|
56498
|
+
this.options = options;
|
|
56499
|
+
return this;
|
|
56497
56500
|
}
|
|
56498
56501
|
clone() {
|
|
56499
56502
|
return new _ConstructorCallExpression(
|
|
56500
56503
|
this.entity,
|
|
56501
|
-
this.containingTypeOfConstructor,
|
|
56502
56504
|
this.typeAccess.clone(),
|
|
56503
56505
|
this.args.clone(),
|
|
56504
56506
|
this.returnType,
|
|
56505
|
-
this.sourceLocation
|
|
56506
|
-
|
|
56507
|
-
);
|
|
56507
|
+
this.sourceLocation
|
|
56508
|
+
).withOptions(this.options.clone());
|
|
56508
56509
|
}
|
|
56509
56510
|
};
|
|
56510
56511
|
var ContinueLoopStatement2 = class _ContinueLoopStatement {
|
|
@@ -57161,11 +57162,10 @@ var CaseClause2 = class _CaseClause {
|
|
|
57161
57162
|
}
|
|
57162
57163
|
};
|
|
57163
57164
|
var TernaryExpression = class _TernaryExpression {
|
|
57164
|
-
constructor(condition, firstExpression, secondExpression,
|
|
57165
|
+
constructor(condition, firstExpression, secondExpression, sourceLocation) {
|
|
57165
57166
|
this.condition = condition;
|
|
57166
57167
|
this.firstExpression = firstExpression;
|
|
57167
57168
|
this.secondExpression = secondExpression;
|
|
57168
|
-
this.type = type;
|
|
57169
57169
|
this.sourceLocation = sourceLocation;
|
|
57170
57170
|
this.kind = 58 /* TernaryExpression */;
|
|
57171
57171
|
}
|
|
@@ -57174,7 +57174,6 @@ var TernaryExpression = class _TernaryExpression {
|
|
|
57174
57174
|
this.condition.clone(),
|
|
57175
57175
|
this.firstExpression.clone(),
|
|
57176
57176
|
this.secondExpression.clone(),
|
|
57177
|
-
this.type,
|
|
57178
57177
|
this.sourceLocation
|
|
57179
57178
|
);
|
|
57180
57179
|
}
|
|
@@ -57211,39 +57210,45 @@ var TextWithEntityName = class _TextWithEntityName {
|
|
|
57211
57210
|
}
|
|
57212
57211
|
};
|
|
57213
57212
|
var TextTemplateLiteral2 = class _TextTemplateLiteral {
|
|
57214
|
-
constructor(textFragments, expressions, sourceLocation
|
|
57213
|
+
constructor(textFragments, expressions, sourceLocation) {
|
|
57215
57214
|
this.textFragments = textFragments;
|
|
57216
57215
|
this.expressions = expressions;
|
|
57217
57216
|
this.sourceLocation = sourceLocation;
|
|
57218
|
-
this.options = options;
|
|
57219
57217
|
this.kind = 47 /* TextTemplateLiteral */;
|
|
57218
|
+
this.options = TextTemplateEmitOptions.default();
|
|
57219
|
+
}
|
|
57220
|
+
withOptions(options) {
|
|
57221
|
+
this.options = options;
|
|
57222
|
+
return this;
|
|
57220
57223
|
}
|
|
57221
57224
|
clone() {
|
|
57222
57225
|
return new _TextTemplateLiteral(
|
|
57223
57226
|
this.textFragments,
|
|
57224
57227
|
this.expressions.map((e) => e.clone()),
|
|
57225
|
-
this.sourceLocation
|
|
57226
|
-
|
|
57227
|
-
);
|
|
57228
|
+
this.sourceLocation
|
|
57229
|
+
).withOptions(this.options.clone());
|
|
57228
57230
|
}
|
|
57229
57231
|
};
|
|
57230
57232
|
var LocalizableTextTemplateLiteral2 = class _LocalizableTextTemplateLiteral {
|
|
57231
|
-
constructor(textFragments, expressions, code, sourceLocation
|
|
57233
|
+
constructor(textFragments, expressions, code, sourceLocation) {
|
|
57232
57234
|
this.textFragments = textFragments;
|
|
57233
57235
|
this.expressions = expressions;
|
|
57234
57236
|
this.code = code;
|
|
57235
57237
|
this.sourceLocation = sourceLocation;
|
|
57236
|
-
this.options = options;
|
|
57237
57238
|
this.kind = 48 /* LocalizableTextTemplateLiteral */;
|
|
57239
|
+
this.options = TextTemplateEmitOptions.default();
|
|
57240
|
+
}
|
|
57241
|
+
withOptions(options) {
|
|
57242
|
+
this.options = options;
|
|
57243
|
+
return this;
|
|
57238
57244
|
}
|
|
57239
57245
|
clone() {
|
|
57240
57246
|
return new _LocalizableTextTemplateLiteral(
|
|
57241
57247
|
this.textFragments,
|
|
57242
57248
|
this.expressions.map((e) => e.clone()),
|
|
57243
57249
|
this.code,
|
|
57244
|
-
this.sourceLocation
|
|
57245
|
-
|
|
57246
|
-
);
|
|
57250
|
+
this.sourceLocation
|
|
57251
|
+
).withOptions(this.options.clone());
|
|
57247
57252
|
}
|
|
57248
57253
|
};
|
|
57249
57254
|
var ThisExpression = class _ThisExpression {
|
|
@@ -57267,137 +57272,163 @@ var TypeAccessExpression = class _TypeAccessExpression {
|
|
|
57267
57272
|
}
|
|
57268
57273
|
};
|
|
57269
57274
|
var ConstructorDeclaration2 = class _ConstructorDeclaration {
|
|
57270
|
-
constructor(
|
|
57271
|
-
this.
|
|
57275
|
+
constructor(entity, parameters, body, sourceLocation) {
|
|
57276
|
+
this.entity = entity;
|
|
57272
57277
|
this.parameters = parameters;
|
|
57273
57278
|
this.body = body;
|
|
57274
|
-
this.entity = entity;
|
|
57275
57279
|
this.sourceLocation = sourceLocation;
|
|
57276
57280
|
this.kind = 49 /* ConstructorDeclaration */;
|
|
57281
|
+
this.decorators = emptyDecorators;
|
|
57282
|
+
}
|
|
57283
|
+
withDecorators(decorators) {
|
|
57284
|
+
this.decorators = decorators;
|
|
57285
|
+
return this;
|
|
57277
57286
|
}
|
|
57278
57287
|
clone() {
|
|
57279
57288
|
return new _ConstructorDeclaration(
|
|
57280
|
-
this.
|
|
57289
|
+
this.entity,
|
|
57281
57290
|
this.parameters.map((p) => p.clone()),
|
|
57282
57291
|
this.body.clone(),
|
|
57283
|
-
this.entity,
|
|
57284
57292
|
this.sourceLocation
|
|
57285
|
-
);
|
|
57293
|
+
).withDecorators(this.decorators.map((d) => d.clone()));
|
|
57286
57294
|
}
|
|
57287
57295
|
};
|
|
57288
57296
|
var DereferencedVariableGetterDeclaration2 = class _DereferencedVariableGetterDeclaration {
|
|
57289
|
-
constructor(entity,
|
|
57297
|
+
constructor(entity, modifiers, body, sourceLocation) {
|
|
57290
57298
|
this.entity = entity;
|
|
57291
|
-
this.decorators = decorators;
|
|
57292
57299
|
this.modifiers = modifiers;
|
|
57293
57300
|
this.body = body;
|
|
57294
57301
|
this.sourceLocation = sourceLocation;
|
|
57295
57302
|
this.kind = 92 /* DereferencedVariableGetterDeclaration */;
|
|
57303
|
+
this.decorators = emptyDecorators;
|
|
57304
|
+
}
|
|
57305
|
+
withDecorators(decorators) {
|
|
57306
|
+
this.decorators = decorators;
|
|
57307
|
+
return this;
|
|
57296
57308
|
}
|
|
57297
57309
|
clone() {
|
|
57298
57310
|
return new _DereferencedVariableGetterDeclaration(
|
|
57299
57311
|
this.entity,
|
|
57300
|
-
this.decorators.map((d) => d.clone()),
|
|
57301
57312
|
this.modifiers.clone(),
|
|
57302
57313
|
this.body.clone(),
|
|
57303
57314
|
this.sourceLocation
|
|
57304
|
-
);
|
|
57315
|
+
).withDecorators(this.decorators.map((d) => d.clone()));
|
|
57305
57316
|
}
|
|
57306
57317
|
};
|
|
57307
57318
|
var DereferencedVariableSetterDeclaration2 = class _DereferencedVariableSetterDeclaration {
|
|
57308
|
-
constructor(entity,
|
|
57319
|
+
constructor(entity, modifiers, body, valueLocalVariableEntity, sourceLocation) {
|
|
57309
57320
|
this.entity = entity;
|
|
57310
|
-
this.decorators = decorators;
|
|
57311
57321
|
this.modifiers = modifiers;
|
|
57312
57322
|
this.body = body;
|
|
57313
57323
|
this.valueLocalVariableEntity = valueLocalVariableEntity;
|
|
57314
57324
|
this.sourceLocation = sourceLocation;
|
|
57315
57325
|
this.kind = 93 /* DereferencedVariableSetterDeclaration */;
|
|
57326
|
+
this.decorators = emptyDecorators;
|
|
57327
|
+
}
|
|
57328
|
+
withDecorators(decorators) {
|
|
57329
|
+
this.decorators = decorators;
|
|
57330
|
+
return this;
|
|
57316
57331
|
}
|
|
57317
57332
|
clone() {
|
|
57318
57333
|
return new _DereferencedVariableSetterDeclaration(
|
|
57319
57334
|
this.entity,
|
|
57320
|
-
this.decorators.map((d) => d.clone()),
|
|
57321
57335
|
this.modifiers.clone(),
|
|
57322
57336
|
this.body.clone(),
|
|
57323
57337
|
this.valueLocalVariableEntity,
|
|
57324
57338
|
this.sourceLocation
|
|
57325
|
-
);
|
|
57339
|
+
).withDecorators(this.decorators.map((d) => d.clone()));
|
|
57326
57340
|
}
|
|
57327
57341
|
};
|
|
57328
57342
|
var DestructorDeclaration2 = class _DestructorDeclaration {
|
|
57329
|
-
constructor(
|
|
57330
|
-
this.
|
|
57343
|
+
constructor(entity, parameters, body, sourceLocation) {
|
|
57344
|
+
this.entity = entity;
|
|
57331
57345
|
this.parameters = parameters;
|
|
57332
57346
|
this.body = body;
|
|
57333
|
-
this.entity = entity;
|
|
57334
57347
|
this.sourceLocation = sourceLocation;
|
|
57335
57348
|
this.kind = 50 /* DestructorDeclaration */;
|
|
57349
|
+
this.decorators = emptyDecorators;
|
|
57350
|
+
}
|
|
57351
|
+
withDecorators(decorators) {
|
|
57352
|
+
this.decorators = decorators;
|
|
57353
|
+
return this;
|
|
57336
57354
|
}
|
|
57337
57355
|
clone() {
|
|
57338
57356
|
return new _DestructorDeclaration(
|
|
57339
|
-
this.
|
|
57357
|
+
this.entity,
|
|
57340
57358
|
this.parameters.map((p) => p.clone()),
|
|
57341
57359
|
this.body.clone(),
|
|
57342
|
-
this.entity,
|
|
57343
57360
|
this.sourceLocation
|
|
57344
|
-
);
|
|
57361
|
+
).withDecorators(this.decorators.map((d) => d.clone()));
|
|
57345
57362
|
}
|
|
57346
57363
|
};
|
|
57347
57364
|
var IndexedElementGetterDeclaration2 = class _IndexedElementGetterDeclaration {
|
|
57348
|
-
constructor(entity,
|
|
57365
|
+
constructor(entity, modifiers, parameters, body, sourceLocation) {
|
|
57349
57366
|
this.entity = entity;
|
|
57350
|
-
this.decorators = decorators;
|
|
57351
57367
|
this.modifiers = modifiers;
|
|
57352
57368
|
this.parameters = parameters;
|
|
57353
57369
|
this.body = body;
|
|
57354
57370
|
this.sourceLocation = sourceLocation;
|
|
57355
57371
|
this.kind = 51 /* IndexedElementGetterDeclaration */;
|
|
57372
|
+
this.decorators = emptyDecorators;
|
|
57373
|
+
}
|
|
57374
|
+
withDecorators(decorators) {
|
|
57375
|
+
this.decorators = decorators;
|
|
57376
|
+
return this;
|
|
57356
57377
|
}
|
|
57357
57378
|
clone() {
|
|
57358
57379
|
return new _IndexedElementGetterDeclaration(
|
|
57359
57380
|
this.entity,
|
|
57360
|
-
this.decorators.map((d) => d.clone()),
|
|
57361
57381
|
this.modifiers.clone(),
|
|
57362
57382
|
this.parameters.map((p) => p.clone()),
|
|
57363
57383
|
this.body.clone(),
|
|
57364
57384
|
this.sourceLocation
|
|
57365
|
-
);
|
|
57385
|
+
).withDecorators(this.decorators.map((d) => d.clone()));
|
|
57366
57386
|
}
|
|
57367
57387
|
};
|
|
57368
57388
|
var IndexedElementSetterDeclaration2 = class _IndexedElementSetterDeclaration {
|
|
57369
|
-
constructor(entity,
|
|
57389
|
+
constructor(entity, modifiers, parameters, body, valueLocalVariableEntity, sourceLocation) {
|
|
57370
57390
|
this.entity = entity;
|
|
57371
|
-
this.decorators = decorators;
|
|
57372
57391
|
this.modifiers = modifiers;
|
|
57373
57392
|
this.parameters = parameters;
|
|
57374
57393
|
this.body = body;
|
|
57375
57394
|
this.valueLocalVariableEntity = valueLocalVariableEntity;
|
|
57376
57395
|
this.sourceLocation = sourceLocation;
|
|
57377
57396
|
this.kind = 52 /* IndexedElementSetterDeclaration */;
|
|
57397
|
+
this.decorators = emptyDecorators;
|
|
57398
|
+
}
|
|
57399
|
+
withDecorators(decorators) {
|
|
57400
|
+
this.decorators = decorators;
|
|
57401
|
+
return this;
|
|
57378
57402
|
}
|
|
57379
57403
|
clone() {
|
|
57380
57404
|
return new _IndexedElementSetterDeclaration(
|
|
57381
57405
|
this.entity,
|
|
57382
|
-
this.decorators.map((d) => d.clone()),
|
|
57383
57406
|
this.modifiers.clone(),
|
|
57384
57407
|
this.parameters.map((p) => p.clone()),
|
|
57385
57408
|
this.body.clone(),
|
|
57386
57409
|
this.valueLocalVariableEntity,
|
|
57387
57410
|
this.sourceLocation
|
|
57388
|
-
);
|
|
57411
|
+
).withDecorators(this.decorators.map((d) => d.clone()));
|
|
57389
57412
|
}
|
|
57390
57413
|
};
|
|
57391
57414
|
var MethodAccessExpression = class _MethodAccessExpression {
|
|
57392
|
-
constructor(expression, isOptionalAccess, method, isCallee,
|
|
57415
|
+
constructor(expression, isOptionalAccess, method, isCallee, sourceLocation) {
|
|
57393
57416
|
this.expression = expression;
|
|
57394
57417
|
this.isOptionalAccess = isOptionalAccess;
|
|
57395
57418
|
this.method = method;
|
|
57396
57419
|
this.isCallee = isCallee;
|
|
57397
|
-
this.ifComputedThenKey = ifComputedThenKey;
|
|
57398
57420
|
this.sourceLocation = sourceLocation;
|
|
57399
|
-
this.options = options;
|
|
57400
57421
|
this.kind = 71 /* MethodAccessExpression */;
|
|
57422
|
+
this.ifComputedThenKey = void 0;
|
|
57423
|
+
this.options = FunctionAccessExpressionEmitOptions.default();
|
|
57424
|
+
}
|
|
57425
|
+
withIfComputedThenKey(key) {
|
|
57426
|
+
this.ifComputedThenKey = key;
|
|
57427
|
+
return this;
|
|
57428
|
+
}
|
|
57429
|
+
withOptions(options) {
|
|
57430
|
+
this.options = options;
|
|
57431
|
+
return this;
|
|
57401
57432
|
}
|
|
57402
57433
|
clone() {
|
|
57403
57434
|
return new _MethodAccessExpression(
|
|
@@ -57405,81 +57436,64 @@ var MethodAccessExpression = class _MethodAccessExpression {
|
|
|
57405
57436
|
this.isOptionalAccess,
|
|
57406
57437
|
this.method,
|
|
57407
57438
|
this.isCallee,
|
|
57408
|
-
this.
|
|
57409
|
-
|
|
57410
|
-
this.options.clone()
|
|
57411
|
-
);
|
|
57439
|
+
this.sourceLocation
|
|
57440
|
+
).withIfComputedThenKey(this.ifComputedThenKey?.clone()).withOptions(this.options.clone());
|
|
57412
57441
|
}
|
|
57413
57442
|
};
|
|
57414
57443
|
var MethodDeclaration2 = class _MethodDeclaration {
|
|
57415
|
-
constructor(
|
|
57416
|
-
this.
|
|
57444
|
+
constructor(entity, modifiers, parameters, body, isGenerator, sourceLocation) {
|
|
57445
|
+
this.entity = entity;
|
|
57417
57446
|
this.modifiers = modifiers;
|
|
57418
57447
|
this.parameters = parameters;
|
|
57419
57448
|
this.body = body;
|
|
57420
|
-
this.entity = entity;
|
|
57421
57449
|
this.isGenerator = isGenerator;
|
|
57422
|
-
this.ifComputedThenKey = ifComputedThenKey;
|
|
57423
57450
|
this.sourceLocation = sourceLocation;
|
|
57424
|
-
this.options = options;
|
|
57425
57451
|
this.kind = 53 /* MethodDeclaration */;
|
|
57452
|
+
this.decorators = emptyDecorators;
|
|
57453
|
+
this.ifComputedThenKey = void 0;
|
|
57454
|
+
this.options = MethodDeclarationEmitOptions.default();
|
|
57455
|
+
}
|
|
57456
|
+
withDecorators(decorators) {
|
|
57457
|
+
this.decorators = decorators;
|
|
57458
|
+
return this;
|
|
57459
|
+
}
|
|
57460
|
+
withIfComputedThenKey(key) {
|
|
57461
|
+
this.ifComputedThenKey = key;
|
|
57462
|
+
return this;
|
|
57463
|
+
}
|
|
57464
|
+
withOptions(options) {
|
|
57465
|
+
this.options = options;
|
|
57466
|
+
return this;
|
|
57426
57467
|
}
|
|
57427
57468
|
clone() {
|
|
57428
57469
|
return new _MethodDeclaration(
|
|
57429
|
-
this.
|
|
57470
|
+
this.entity,
|
|
57430
57471
|
this.modifiers.clone(),
|
|
57431
57472
|
this.parameters.map((p) => p.clone()),
|
|
57432
57473
|
this.body.clone(),
|
|
57433
|
-
this.entity,
|
|
57434
57474
|
this.isGenerator,
|
|
57435
|
-
this.
|
|
57436
|
-
|
|
57437
|
-
this.options.clone()
|
|
57438
|
-
);
|
|
57475
|
+
this.sourceLocation
|
|
57476
|
+
).withDecorators(this.decorators.map((d) => d.clone())).withIfComputedThenKey(this.ifComputedThenKey?.clone()).withOptions(this.options.clone());
|
|
57439
57477
|
}
|
|
57440
57478
|
};
|
|
57441
57479
|
var FieldAccessExpression = class _FieldAccessExpression {
|
|
57442
|
-
constructor(expression, isOptionalAccess, field, accessKind,
|
|
57480
|
+
constructor(expression, isOptionalAccess, field, accessKind, sourceLocation) {
|
|
57443
57481
|
this.expression = expression;
|
|
57444
57482
|
this.isOptionalAccess = isOptionalAccess;
|
|
57445
57483
|
this.field = field;
|
|
57446
57484
|
this.accessKind = accessKind;
|
|
57447
|
-
this.ifComputedThenKey = ifComputedThenKey;
|
|
57448
57485
|
this.sourceLocation = sourceLocation;
|
|
57449
|
-
this.options = options;
|
|
57450
57486
|
this.kind = 70 /* FieldAccessExpression */;
|
|
57487
|
+
this.ifComputedThenKey = void 0;
|
|
57488
|
+
this.options = FieldAccessExpressionEmitOptions.default();
|
|
57451
57489
|
}
|
|
57452
|
-
|
|
57453
|
-
|
|
57454
|
-
|
|
57455
|
-
accessedVariable = field;
|
|
57456
|
-
} else {
|
|
57457
|
-
accessedVariable = AccessedVariable.fromEntity(field);
|
|
57458
|
-
}
|
|
57459
|
-
return new _FieldAccessExpression(
|
|
57460
|
-
expression,
|
|
57461
|
-
isOptionalAccess,
|
|
57462
|
-
accessedVariable,
|
|
57463
|
-
0 /* Get */,
|
|
57464
|
-
ifComputedThenKey,
|
|
57465
|
-
sourceLocation
|
|
57466
|
-
);
|
|
57490
|
+
withIfComputedThenKey(key) {
|
|
57491
|
+
this.ifComputedThenKey = key;
|
|
57492
|
+
return this;
|
|
57467
57493
|
}
|
|
57468
|
-
|
|
57469
|
-
|
|
57470
|
-
|
|
57471
|
-
accessedVariable = field;
|
|
57472
|
-
} else {
|
|
57473
|
-
accessedVariable = AccessedVariable.fromEntity(field);
|
|
57474
|
-
}
|
|
57475
|
-
return new _FieldAccessExpression(
|
|
57476
|
-
expression,
|
|
57477
|
-
isOptionalAccess,
|
|
57478
|
-
accessedVariable,
|
|
57479
|
-
1 /* Set */,
|
|
57480
|
-
ifComputedThenKey,
|
|
57481
|
-
sourceLocation
|
|
57482
|
-
);
|
|
57494
|
+
withOptions(options) {
|
|
57495
|
+
this.options = options;
|
|
57496
|
+
return this;
|
|
57483
57497
|
}
|
|
57484
57498
|
clone() {
|
|
57485
57499
|
return new _FieldAccessExpression(
|
|
@@ -57487,45 +57501,54 @@ var FieldAccessExpression = class _FieldAccessExpression {
|
|
|
57487
57501
|
this.isOptionalAccess,
|
|
57488
57502
|
this.field,
|
|
57489
57503
|
this.accessKind,
|
|
57490
|
-
this.
|
|
57491
|
-
|
|
57492
|
-
this.options.clone()
|
|
57493
|
-
);
|
|
57504
|
+
this.sourceLocation
|
|
57505
|
+
).withIfComputedThenKey(this.ifComputedThenKey?.clone()).withOptions(this.options.clone());
|
|
57494
57506
|
}
|
|
57495
57507
|
};
|
|
57496
57508
|
var FieldDeclaration2 = class _FieldDeclaration {
|
|
57497
|
-
constructor(
|
|
57498
|
-
this.
|
|
57509
|
+
constructor(entity, modifiers, initializer, sourceLocation) {
|
|
57510
|
+
this.entity = entity;
|
|
57499
57511
|
this.modifiers = modifiers;
|
|
57500
57512
|
this.initializer = initializer;
|
|
57501
|
-
this.entity = entity;
|
|
57502
|
-
this.ifComputedThenKey = ifComputedThenKey;
|
|
57503
57513
|
this.sourceLocation = sourceLocation;
|
|
57504
|
-
this.options = options;
|
|
57505
57514
|
this.kind = 54 /* FieldDeclaration */;
|
|
57515
|
+
this.decorators = emptyDecorators;
|
|
57516
|
+
this.ifComputedThenKey = void 0;
|
|
57517
|
+
this.options = FieldDeclarationEmitOptions.default();
|
|
57518
|
+
}
|
|
57519
|
+
withDecorators(decorators) {
|
|
57520
|
+
this.decorators = decorators;
|
|
57521
|
+
return this;
|
|
57522
|
+
}
|
|
57523
|
+
withIfComputedThenKey(key) {
|
|
57524
|
+
this.ifComputedThenKey = key;
|
|
57525
|
+
return this;
|
|
57526
|
+
}
|
|
57527
|
+
withOptions(options) {
|
|
57528
|
+
this.options = options;
|
|
57529
|
+
return this;
|
|
57506
57530
|
}
|
|
57507
57531
|
clone() {
|
|
57508
|
-
return new _FieldDeclaration(
|
|
57509
|
-
this.decorators.map((d) => d.clone()),
|
|
57510
|
-
this.modifiers.clone(),
|
|
57511
|
-
this.initializer?.clone(),
|
|
57512
|
-
this.entity,
|
|
57513
|
-
this.ifComputedThenKey?.clone(),
|
|
57514
|
-
this.sourceLocation,
|
|
57515
|
-
this.options.clone()
|
|
57516
|
-
);
|
|
57532
|
+
return new _FieldDeclaration(this.entity, this.modifiers.clone(), this.initializer?.clone(), this.sourceLocation).withDecorators(this.decorators.map((d) => d.clone())).withIfComputedThenKey(this.ifComputedThenKey?.clone()).withOptions(this.options.clone());
|
|
57517
57533
|
}
|
|
57518
57534
|
};
|
|
57519
57535
|
var ComputedFieldDeclaration = class _ComputedFieldDeclaration {
|
|
57520
|
-
constructor(entity, modifiers, getter, setter,
|
|
57536
|
+
constructor(entity, modifiers, getter, setter, sourceLocation) {
|
|
57521
57537
|
this.entity = entity;
|
|
57522
57538
|
this.modifiers = modifiers;
|
|
57523
57539
|
this.getter = getter;
|
|
57524
57540
|
this.setter = setter;
|
|
57525
|
-
this.ifComputedThenKey = ifComputedThenKey;
|
|
57526
57541
|
this.sourceLocation = sourceLocation;
|
|
57527
|
-
this.options = options;
|
|
57528
57542
|
this.kind = 95 /* ComputedFieldDeclaration */;
|
|
57543
|
+
this.options = FieldDeclarationEmitOptions.default();
|
|
57544
|
+
}
|
|
57545
|
+
withIfComputedThenKey(key) {
|
|
57546
|
+
this.ifComputedThenKey = key;
|
|
57547
|
+
return this;
|
|
57548
|
+
}
|
|
57549
|
+
withOptions(options) {
|
|
57550
|
+
this.options = options;
|
|
57551
|
+
return this;
|
|
57529
57552
|
}
|
|
57530
57553
|
clone() {
|
|
57531
57554
|
return new _ComputedFieldDeclaration(
|
|
@@ -57533,46 +57556,46 @@ var ComputedFieldDeclaration = class _ComputedFieldDeclaration {
|
|
|
57533
57556
|
this.modifiers.clone(),
|
|
57534
57557
|
this.getter.clone(),
|
|
57535
57558
|
this.setter?.clone(),
|
|
57536
|
-
this.
|
|
57537
|
-
|
|
57538
|
-
this.options.clone()
|
|
57539
|
-
);
|
|
57559
|
+
this.sourceLocation
|
|
57560
|
+
).withIfComputedThenKey(this.ifComputedThenKey?.clone()).withOptions(this.options.clone());
|
|
57540
57561
|
}
|
|
57541
57562
|
};
|
|
57542
57563
|
var FieldGetterDeclaration2 = class _FieldGetterDeclaration {
|
|
57543
|
-
constructor(entity,
|
|
57564
|
+
constructor(entity, body, sourceLocation) {
|
|
57544
57565
|
this.entity = entity;
|
|
57545
|
-
this.decorators = decorators;
|
|
57546
57566
|
this.body = body;
|
|
57547
57567
|
this.sourceLocation = sourceLocation;
|
|
57548
57568
|
this.kind = 55 /* FieldGetterDeclaration */;
|
|
57569
|
+
this.decorators = emptyDecorators;
|
|
57570
|
+
}
|
|
57571
|
+
withDecorators(decorators) {
|
|
57572
|
+
this.decorators = decorators;
|
|
57573
|
+
return this;
|
|
57549
57574
|
}
|
|
57550
57575
|
clone() {
|
|
57551
|
-
return new _FieldGetterDeclaration(
|
|
57552
|
-
this.entity,
|
|
57553
|
-
this.decorators.map((d) => d.clone()),
|
|
57554
|
-
this.body.clone(),
|
|
57555
|
-
this.sourceLocation
|
|
57556
|
-
);
|
|
57576
|
+
return new _FieldGetterDeclaration(this.entity, this.body.clone(), this.sourceLocation).withDecorators(this.decorators.map((d) => d.clone()));
|
|
57557
57577
|
}
|
|
57558
57578
|
};
|
|
57559
57579
|
var FieldSetterDeclaration2 = class _FieldSetterDeclaration {
|
|
57560
|
-
constructor(entity,
|
|
57580
|
+
constructor(entity, body, valueLocalVariableEntity, sourceLocation) {
|
|
57561
57581
|
this.entity = entity;
|
|
57562
|
-
this.decorators = decorators;
|
|
57563
57582
|
this.body = body;
|
|
57564
57583
|
this.valueLocalVariableEntity = valueLocalVariableEntity;
|
|
57565
57584
|
this.sourceLocation = sourceLocation;
|
|
57566
57585
|
this.kind = 56 /* FieldSetterDeclaration */;
|
|
57586
|
+
this.decorators = emptyDecorators;
|
|
57587
|
+
}
|
|
57588
|
+
withDecorators(decorators) {
|
|
57589
|
+
this.decorators = decorators;
|
|
57590
|
+
return this;
|
|
57567
57591
|
}
|
|
57568
57592
|
clone() {
|
|
57569
57593
|
return new _FieldSetterDeclaration(
|
|
57570
57594
|
this.entity,
|
|
57571
|
-
this.decorators.map((d) => d.clone()),
|
|
57572
57595
|
this.body.clone(),
|
|
57573
57596
|
this.valueLocalVariableEntity,
|
|
57574
57597
|
this.sourceLocation
|
|
57575
|
-
);
|
|
57598
|
+
).withDecorators(this.decorators.map((d) => d.clone()));
|
|
57576
57599
|
}
|
|
57577
57600
|
};
|
|
57578
57601
|
var ParameterDeclaration2 = class _ParameterDeclaration {
|
|
@@ -57594,24 +57617,6 @@ var VariableAccessExpression = class _VariableAccessExpression {
|
|
|
57594
57617
|
this.sourceLocation = sourceLocation;
|
|
57595
57618
|
this.kind = 66 /* VariableAccessExpression */;
|
|
57596
57619
|
}
|
|
57597
|
-
static get(variable) {
|
|
57598
|
-
let accessedVariable;
|
|
57599
|
-
if (variable instanceof AccessedVariable) {
|
|
57600
|
-
accessedVariable = variable;
|
|
57601
|
-
} else {
|
|
57602
|
-
accessedVariable = AccessedVariable.fromEntity(variable);
|
|
57603
|
-
}
|
|
57604
|
-
return new _VariableAccessExpression(accessedVariable, 0 /* Get */, void 0);
|
|
57605
|
-
}
|
|
57606
|
-
static set(variable) {
|
|
57607
|
-
let accessedVariable;
|
|
57608
|
-
if (variable instanceof AccessedVariable) {
|
|
57609
|
-
accessedVariable = variable;
|
|
57610
|
-
} else {
|
|
57611
|
-
accessedVariable = AccessedVariable.fromEntity(variable);
|
|
57612
|
-
}
|
|
57613
|
-
return new _VariableAccessExpression(accessedVariable, 1 /* Set */, void 0);
|
|
57614
|
-
}
|
|
57615
57620
|
clone() {
|
|
57616
57621
|
return new _VariableAccessExpression(this.variable, this.accessKind, this.sourceLocation);
|
|
57617
57622
|
}
|
|
@@ -57839,7 +57844,9 @@ var TypeUtils2 = class {
|
|
|
57839
57844
|
case 48 /* LocalizableTextTemplateLiteral */:
|
|
57840
57845
|
return this.ectx.standardTypes.text;
|
|
57841
57846
|
case 58 /* TernaryExpression */:
|
|
57842
|
-
return
|
|
57847
|
+
return this.ectx.createUnionType(
|
|
57848
|
+
[this.ofExpression(expression.firstExpression), this.ofExpression(expression.secondExpression)]
|
|
57849
|
+
);
|
|
57843
57850
|
case 59 /* ThisExpression */:
|
|
57844
57851
|
return expression.type;
|
|
57845
57852
|
case 90 /* BaseExpression */:
|
|
@@ -58980,6 +58987,49 @@ function callExpression(expression, isOptionalAccess, args, isAsyncFunctionCall,
|
|
|
58980
58987
|
const argsNode = args instanceof Array ? new OrderedArguments(args, false) : args;
|
|
58981
58988
|
return new CallExpression2(expression, isOptionalAccess, argsNode, isAsyncFunctionCall, returnType, sourceLocation);
|
|
58982
58989
|
}
|
|
58990
|
+
function functionCallExpression(func, args, sourceLocation) {
|
|
58991
|
+
const accessedFunction2 = func instanceof AccessedFunction5 ? func : AccessedFunction5.fromEntity(func);
|
|
58992
|
+
const argsNode = args instanceof Array ? new OrderedArguments(args, false) : args;
|
|
58993
|
+
return new CallExpression2(
|
|
58994
|
+
new FunctionAccessExpression(accessedFunction2, true),
|
|
58995
|
+
false,
|
|
58996
|
+
argsNode,
|
|
58997
|
+
accessedFunction2.entity.details.isAsync,
|
|
58998
|
+
accessedFunction2.returnType,
|
|
58999
|
+
sourceLocation
|
|
59000
|
+
);
|
|
59001
|
+
}
|
|
59002
|
+
function instanceMethodCallExpression(expression, method, args, isOptionalAccess, sourceLocation) {
|
|
59003
|
+
const accessedFunction2 = method instanceof AccessedFunction5 ? method : AccessedFunction5.fromEntity(method);
|
|
59004
|
+
const argsNode = args instanceof Array ? new OrderedArguments(args, false) : args;
|
|
59005
|
+
return new CallExpression2(
|
|
59006
|
+
new MethodAccessExpression(expression, isOptionalAccess, accessedFunction2, true),
|
|
59007
|
+
false,
|
|
59008
|
+
argsNode,
|
|
59009
|
+
accessedFunction2.entity.details.isAsync,
|
|
59010
|
+
accessedFunction2.returnType,
|
|
59011
|
+
sourceLocation
|
|
59012
|
+
);
|
|
59013
|
+
}
|
|
59014
|
+
function staticMethodCallExpression(method, args, sourceLocation) {
|
|
59015
|
+
const accessedFunction2 = method instanceof AccessedFunction5 ? method : AccessedFunction5.fromEntity(method);
|
|
59016
|
+
const type = accessedFunction2.entity.ifTypeMemberThenContainingType;
|
|
59017
|
+
Debug.assertNotNull(type, "\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u0432\u0441\u0435\u043E\u0431\u0449\u0438\u0439 \u043C\u0435\u0442\u043E\u0434.");
|
|
59018
|
+
const argsNode = args instanceof Array ? new OrderedArguments(args, false) : args;
|
|
59019
|
+
return new CallExpression2(
|
|
59020
|
+
new MethodAccessExpression(
|
|
59021
|
+
new TypeAccessExpression(type, void 0),
|
|
59022
|
+
false,
|
|
59023
|
+
accessedFunction2,
|
|
59024
|
+
true
|
|
59025
|
+
),
|
|
59026
|
+
false,
|
|
59027
|
+
argsNode,
|
|
59028
|
+
accessedFunction2.entity.details.isAsync,
|
|
59029
|
+
accessedFunction2.returnType,
|
|
59030
|
+
sourceLocation
|
|
59031
|
+
);
|
|
59032
|
+
}
|
|
58983
59033
|
function charLiteral(value, sourceLocation) {
|
|
58984
59034
|
return new CharLiteral(value, sourceLocation);
|
|
58985
59035
|
}
|
|
@@ -59020,25 +59070,28 @@ function forStatement(label, elementVariableEntity, indexVariableEntity, enumera
|
|
|
59020
59070
|
function ifStatement(condition, thenStatement, elseStatement, sourceLocation) {
|
|
59021
59071
|
return new IfStatement2(condition, thenStatement, elseStatement, sourceLocation);
|
|
59022
59072
|
}
|
|
59073
|
+
function indexedAccessExpression(expression, isOptionalAccess, args, access, sourceLocation) {
|
|
59074
|
+
return new IndexedAccessExpression2(expression, isOptionalAccess, args, access, sourceLocation);
|
|
59075
|
+
}
|
|
59023
59076
|
function indexedGetAccessExpression(expression, getter, args, isOptionalAccess, sourceLocation) {
|
|
59024
|
-
const
|
|
59077
|
+
const accessedFunction2 = getter instanceof AccessedFunction5 ? getter : AccessedFunction5.fromEntity(getter);
|
|
59025
59078
|
const argsNode = args instanceof Array ? new OrderedArguments(args, false) : args;
|
|
59026
59079
|
return new IndexedAccessExpression2(
|
|
59027
59080
|
expression,
|
|
59028
59081
|
isOptionalAccess,
|
|
59029
59082
|
argsNode,
|
|
59030
|
-
{ kind: 0 /* Get */, getAccessor:
|
|
59083
|
+
{ kind: 0 /* Get */, getAccessor: accessedFunction2 },
|
|
59031
59084
|
sourceLocation
|
|
59032
59085
|
);
|
|
59033
59086
|
}
|
|
59034
59087
|
function indexedSetAccessExpression(expression, setter, args, isOptionalAccess, sourceLocation) {
|
|
59035
|
-
const
|
|
59088
|
+
const accessedFunction2 = setter instanceof AccessedFunction5 ? setter : AccessedFunction5.fromEntity(setter);
|
|
59036
59089
|
const argsNode = args instanceof Array ? new OrderedArguments(args, false) : args;
|
|
59037
59090
|
return new IndexedAccessExpression2(
|
|
59038
59091
|
expression,
|
|
59039
59092
|
isOptionalAccess,
|
|
59040
59093
|
argsNode,
|
|
59041
|
-
{ kind: 1 /* Set */, setAccessor:
|
|
59094
|
+
{ kind: 1 /* Set */, setAccessor: accessedFunction2 },
|
|
59042
59095
|
sourceLocation
|
|
59043
59096
|
);
|
|
59044
59097
|
}
|
|
@@ -59145,101 +59198,251 @@ function switchStatement(matchExpression, caseClauses, defaultClauseBody, source
|
|
|
59145
59198
|
function caseClause(expressions, body, sourceLocation) {
|
|
59146
59199
|
return new CaseClause2(expressions, body, sourceLocation);
|
|
59147
59200
|
}
|
|
59201
|
+
function ternaryExpression(condition, firstExpression, secondExpression, sourceLocation) {
|
|
59202
|
+
return new TernaryExpression(condition, firstExpression, secondExpression, sourceLocation);
|
|
59203
|
+
}
|
|
59148
59204
|
function textLiteral(value, sourceLocation) {
|
|
59149
59205
|
return new TextLiteral2(value, sourceLocation);
|
|
59150
59206
|
}
|
|
59151
|
-
function
|
|
59152
|
-
|
|
59153
|
-
|
|
59154
|
-
|
|
59155
|
-
|
|
59156
|
-
|
|
59157
|
-
|
|
59158
|
-
|
|
59159
|
-
|
|
59160
|
-
|
|
59161
|
-
|
|
59162
|
-
|
|
59207
|
+
function localizableTextLiteral(value, code, sourceLocation) {
|
|
59208
|
+
return new LocalizableTextLiteral2(value, code, sourceLocation);
|
|
59209
|
+
}
|
|
59210
|
+
function textWithEntityName(entity, sourceLocation) {
|
|
59211
|
+
return new TextWithEntityName(entity, sourceLocation);
|
|
59212
|
+
}
|
|
59213
|
+
function textTemplateLiteral(textFragments, expressions, sourceLocation) {
|
|
59214
|
+
return new TextTemplateLiteral2(textFragments, expressions, sourceLocation);
|
|
59215
|
+
}
|
|
59216
|
+
function localizableTextTemplateLiteral(textFragments, expressions, code, sourceLocation) {
|
|
59217
|
+
return new LocalizableTextTemplateLiteral2(textFragments, expressions, code, sourceLocation);
|
|
59218
|
+
}
|
|
59219
|
+
function thisExpression(type, sourceLocation) {
|
|
59220
|
+
return new ThisExpression(type, sourceLocation);
|
|
59221
|
+
}
|
|
59222
|
+
function typeAccessExpression(entity, sourceLocation) {
|
|
59223
|
+
return new TypeAccessExpression(entity, sourceLocation);
|
|
59224
|
+
}
|
|
59225
|
+
function constructorDeclaration(entity, parameters, body, sourceLocation) {
|
|
59226
|
+
return new ConstructorDeclaration2(entity, parameters, body, sourceLocation);
|
|
59227
|
+
}
|
|
59228
|
+
function dereferencedVariableGetterDeclaration(entity, body, sourceLocation) {
|
|
59229
|
+
const modifiers = new Modifiers().setStatic(entity.details.isStatic);
|
|
59230
|
+
return new DereferencedVariableGetterDeclaration2(entity, modifiers, body, sourceLocation);
|
|
59231
|
+
}
|
|
59232
|
+
function dereferencedVariableSetterDeclaration(entity, body, valueLocalVariableEntity, sourceLocation) {
|
|
59233
|
+
const modifiers = new Modifiers().setStatic(entity.details.isStatic);
|
|
59234
|
+
return new DereferencedVariableSetterDeclaration2(entity, modifiers, body, valueLocalVariableEntity, sourceLocation);
|
|
59235
|
+
}
|
|
59236
|
+
function destructorDeclaration(entity, parameters, body, sourceLocation) {
|
|
59237
|
+
return new DestructorDeclaration2(entity, parameters, body, sourceLocation);
|
|
59238
|
+
}
|
|
59239
|
+
function indexedElementGetterDeclaration(entity, parameters, body, sourceLocation) {
|
|
59240
|
+
const modifiers = new Modifiers().setStatic(entity.details.isStatic);
|
|
59241
|
+
return new IndexedElementGetterDeclaration2(entity, modifiers, parameters, body, sourceLocation);
|
|
59242
|
+
}
|
|
59243
|
+
function indexedElementSetterDeclaration(entity, parameters, body, valueLocalVariableEntity, sourceLocation) {
|
|
59244
|
+
const modifiers = new Modifiers().setStatic(entity.details.isStatic);
|
|
59245
|
+
return new IndexedElementSetterDeclaration2(
|
|
59246
|
+
entity,
|
|
59247
|
+
modifiers,
|
|
59248
|
+
parameters,
|
|
59249
|
+
body,
|
|
59250
|
+
valueLocalVariableEntity,
|
|
59251
|
+
sourceLocation
|
|
59252
|
+
);
|
|
59253
|
+
}
|
|
59254
|
+
function methodAccessExpression(expression, isOptionalAccess, method, isCallee, sourceLocation) {
|
|
59255
|
+
const accessedFunction2 = method instanceof AccessedFunction5 ? method : AccessedFunction5.fromEntity(method);
|
|
59256
|
+
return new MethodAccessExpression(expression, isOptionalAccess, accessedFunction2, isCallee, sourceLocation);
|
|
59257
|
+
}
|
|
59258
|
+
function methodDeclaration(entity, parameters, body, isGenerator, sourceLocation) {
|
|
59259
|
+
const modifiers = new Modifiers().setAsync(entity.details.isAsync).setStatic(entity.details.isStatic);
|
|
59260
|
+
return new MethodDeclaration2(entity, modifiers, parameters, body, isGenerator, sourceLocation);
|
|
59261
|
+
}
|
|
59262
|
+
function fieldAccessExpression(expression, isOptionalAccess, field, accessKind, sourceLocation) {
|
|
59263
|
+
const accessedVariable2 = field instanceof AccessedVariable ? field : AccessedVariable.fromEntity(field);
|
|
59264
|
+
return new FieldAccessExpression(expression, isOptionalAccess, accessedVariable2, accessKind, sourceLocation);
|
|
59265
|
+
}
|
|
59266
|
+
function instanceFieldGetAccess(expression, field, isOptionalAccess, sourceLocation) {
|
|
59267
|
+
const accessedVariable2 = field instanceof AccessedVariable ? field : AccessedVariable.fromEntity(field);
|
|
59268
|
+
return new FieldAccessExpression(expression, isOptionalAccess, accessedVariable2, 0 /* Get */, sourceLocation);
|
|
59269
|
+
}
|
|
59270
|
+
function staticFieldGetAccess(field, sourceLocation) {
|
|
59271
|
+
const accessedVariable2 = field instanceof AccessedVariable ? field : AccessedVariable.fromEntity(field);
|
|
59272
|
+
const type = accessedVariable2.entity.ifTypeMemberThenContainingType;
|
|
59273
|
+
Debug.assertNotNull(type, "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0441\u0435\u043E\u0431\u0449\u0435\u0435 \u043F\u043E\u043B\u0435.");
|
|
59274
|
+
return new FieldAccessExpression(
|
|
59275
|
+
new TypeAccessExpression(type, void 0),
|
|
59163
59276
|
false,
|
|
59164
|
-
|
|
59165
|
-
|
|
59166
|
-
accessedFunction.returnType,
|
|
59277
|
+
accessedVariable2,
|
|
59278
|
+
0 /* Get */,
|
|
59167
59279
|
sourceLocation
|
|
59168
59280
|
);
|
|
59169
59281
|
}
|
|
59170
|
-
function
|
|
59171
|
-
const
|
|
59172
|
-
|
|
59173
|
-
|
|
59174
|
-
|
|
59175
|
-
|
|
59176
|
-
|
|
59177
|
-
|
|
59178
|
-
|
|
59179
|
-
|
|
59180
|
-
true,
|
|
59181
|
-
void 0,
|
|
59182
|
-
void 0
|
|
59183
|
-
),
|
|
59282
|
+
function instanceFieldSetAccess(expression, field, isOptionalAccess, sourceLocation) {
|
|
59283
|
+
const accessedVariable2 = field instanceof AccessedVariable ? field : AccessedVariable.fromEntity(field);
|
|
59284
|
+
return new FieldAccessExpression(expression, isOptionalAccess, accessedVariable2, 1 /* Set */, sourceLocation);
|
|
59285
|
+
}
|
|
59286
|
+
function staticFieldSetAccess(field, sourceLocation) {
|
|
59287
|
+
const accessedVariable2 = field instanceof AccessedVariable ? field : AccessedVariable.fromEntity(field);
|
|
59288
|
+
const type = accessedVariable2.entity.ifTypeMemberThenContainingType;
|
|
59289
|
+
Debug.assertNotNull(type, "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0441\u0435\u043E\u0431\u0449\u0435\u0435 \u043F\u043E\u043B\u0435.");
|
|
59290
|
+
return new FieldAccessExpression(
|
|
59291
|
+
new TypeAccessExpression(type, void 0),
|
|
59184
59292
|
false,
|
|
59185
|
-
|
|
59186
|
-
|
|
59187
|
-
accessedFunction.returnType,
|
|
59293
|
+
accessedVariable2,
|
|
59294
|
+
1 /* Set */,
|
|
59188
59295
|
sourceLocation
|
|
59189
59296
|
);
|
|
59190
59297
|
}
|
|
59298
|
+
function fieldDeclaration(entity, initializer, sourceLocation) {
|
|
59299
|
+
const modifiers = new Modifiers().setStatic(entity.details.isStatic);
|
|
59300
|
+
return new FieldDeclaration2(entity, modifiers, initializer, sourceLocation);
|
|
59301
|
+
}
|
|
59302
|
+
function computedFieldDeclaration(entity, getter, setter, sourceLocation) {
|
|
59303
|
+
const modifiers = new Modifiers().setStatic(entity.details.isStatic);
|
|
59304
|
+
return new ComputedFieldDeclaration(entity, modifiers, getter, setter, sourceLocation);
|
|
59305
|
+
}
|
|
59306
|
+
function fieldGetterDeclaration(entity, body, sourceLocation) {
|
|
59307
|
+
return new FieldGetterDeclaration2(entity, body, sourceLocation);
|
|
59308
|
+
}
|
|
59309
|
+
function fieldSetterDeclaration(entity, body, valueLocalVariableEntity, sourceLocation) {
|
|
59310
|
+
return new FieldSetterDeclaration2(entity, body, valueLocalVariableEntity, sourceLocation);
|
|
59311
|
+
}
|
|
59312
|
+
function parameterDeclaration(entity, defaultValue, isRest, sourceLocation) {
|
|
59313
|
+
return new ParameterDeclaration2(entity, defaultValue, isRest, sourceLocation);
|
|
59314
|
+
}
|
|
59315
|
+
function whileStatement(label, condition, body, sourceLocation) {
|
|
59316
|
+
return new WhileStatement2(label, condition, body, sourceLocation);
|
|
59317
|
+
}
|
|
59318
|
+
function yieldStatement(expression, sourceLocation) {
|
|
59319
|
+
return new YieldStatement2(expression, sourceLocation);
|
|
59320
|
+
}
|
|
59321
|
+
function textTranslationDeclaration(key, sourceTextTemplate, translatedTextOrFunctionBlock, sourceLocation) {
|
|
59322
|
+
return new TextTranslationDeclaration2(key, sourceTextTemplate, translatedTextOrFunctionBlock, sourceLocation);
|
|
59323
|
+
}
|
|
59324
|
+
function translationTextTemplate(fragments, parameters, sourceLocation) {
|
|
59325
|
+
return new TranslationTextTemplate2(fragments, parameters, sourceLocation);
|
|
59326
|
+
}
|
|
59191
59327
|
function constructorCallExpression(ectx, constructor, args, sourceLocation) {
|
|
59192
59328
|
const type = constructor.ifTypeMemberThenContainingType;
|
|
59193
59329
|
Debug.assertNotNull(type, "\u041A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440 \u0434\u043E\u043B\u0436\u0435\u043D \u044F\u0432\u043B\u044F\u0442\u044C\u0441\u044F \u0447\u043B\u0435\u043D\u043E\u043C \u0442\u0438\u043F\u0430.");
|
|
59194
59330
|
const argsNode = args instanceof Array ? new OrderedArguments(args, false) : args;
|
|
59195
59331
|
return new ConstructorCallExpression(
|
|
59196
59332
|
constructor,
|
|
59197
|
-
type,
|
|
59198
59333
|
new TypeAccessExpression(type, void 0),
|
|
59199
59334
|
argsNode,
|
|
59200
59335
|
ectx.createIdentitySubstitutedType(type),
|
|
59201
59336
|
sourceLocation
|
|
59202
59337
|
);
|
|
59203
59338
|
}
|
|
59204
|
-
function
|
|
59205
|
-
const
|
|
59339
|
+
function constructorCallExpressionWithResultType(constructor, args, type, sourceLocation) {
|
|
59340
|
+
const typeEntity = constructor.ifTypeMemberThenContainingType;
|
|
59341
|
+
Debug.assertNotNull(typeEntity, "\u041A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440 \u0434\u043E\u043B\u0436\u0435\u043D \u044F\u0432\u043B\u044F\u0442\u044C\u0441\u044F \u0447\u043B\u0435\u043D\u043E\u043C \u0442\u0438\u043F\u0430.");
|
|
59206
59342
|
const argsNode = args instanceof Array ? new OrderedArguments(args, false) : args;
|
|
59207
|
-
return new
|
|
59208
|
-
|
|
59209
|
-
|
|
59343
|
+
return new ConstructorCallExpression(
|
|
59344
|
+
constructor,
|
|
59345
|
+
new TypeAccessExpression(typeEntity, void 0),
|
|
59210
59346
|
argsNode,
|
|
59211
|
-
|
|
59212
|
-
accessedFunction.returnType,
|
|
59347
|
+
type,
|
|
59213
59348
|
sourceLocation
|
|
59214
59349
|
);
|
|
59215
59350
|
}
|
|
59351
|
+
function variableAccessExpressions(variable, accessKind, sourceLocation) {
|
|
59352
|
+
const accessedVariable2 = variable instanceof AccessedVariable ? variable : AccessedVariable.fromEntity(variable);
|
|
59353
|
+
return new VariableAccessExpression(accessedVariable2, accessKind, sourceLocation);
|
|
59354
|
+
}
|
|
59216
59355
|
function variableGetAccess(variable, sourceLocation) {
|
|
59217
|
-
const
|
|
59218
|
-
return new VariableAccessExpression(
|
|
59356
|
+
const accessedVariable2 = variable instanceof AccessedVariable ? variable : AccessedVariable.fromEntity(variable);
|
|
59357
|
+
return new VariableAccessExpression(accessedVariable2, 0 /* Get */, sourceLocation);
|
|
59219
59358
|
}
|
|
59220
|
-
function
|
|
59221
|
-
const
|
|
59222
|
-
return new
|
|
59223
|
-
|
|
59224
|
-
|
|
59225
|
-
|
|
59226
|
-
|
|
59227
|
-
|
|
59228
|
-
|
|
59359
|
+
function variableSetAccess(variable, sourceLocation) {
|
|
59360
|
+
const accessedVariable2 = variable instanceof AccessedVariable ? variable : AccessedVariable.fromEntity(variable);
|
|
59361
|
+
return new VariableAccessExpression(accessedVariable2, 1 /* Set */, sourceLocation);
|
|
59362
|
+
}
|
|
59363
|
+
function accessedVariable(entity, type) {
|
|
59364
|
+
return new AccessedVariable(entity, type);
|
|
59365
|
+
}
|
|
59366
|
+
function accessedFunction(entity, returnType) {
|
|
59367
|
+
return new AccessedFunction5(entity, returnType);
|
|
59368
|
+
}
|
|
59369
|
+
function localVariableEntity(name, type, containingPackage, isConst) {
|
|
59370
|
+
const result = new IntrinsicVariableEntity(name, type, containingPackage);
|
|
59371
|
+
result.details.isConst = isConst;
|
|
59372
|
+
return result;
|
|
59373
|
+
}
|
|
59374
|
+
function parameterEntity(name, type, containingPackage, isVariadic) {
|
|
59375
|
+
const result = new IntrinsicVariableEntity(name, type, containingPackage);
|
|
59376
|
+
result.details.isVariadicParameter = isVariadic;
|
|
59377
|
+
return result;
|
|
59378
|
+
}
|
|
59379
|
+
function fieldEntity(name, type, containingType, overriddenMembers, isBasic, isAbstract, isStatic, isConst, computedNameInfo) {
|
|
59380
|
+
const result = new IntrinsicVariableEntity(name, type, containingType.containingPackage);
|
|
59381
|
+
result.ifTypeMemberThenContainingType = containingType;
|
|
59382
|
+
result.details.overriddenMembers = overriddenMembers;
|
|
59383
|
+
result.details.isBasic = isBasic;
|
|
59384
|
+
result.details.isAbstract = isAbstract;
|
|
59385
|
+
result.details.isStatic = isStatic;
|
|
59386
|
+
result.details.isConst = isConst;
|
|
59387
|
+
result.details.hasComputedName = computedNameInfo;
|
|
59388
|
+
return result;
|
|
59389
|
+
}
|
|
59390
|
+
function packageVariableEntity(name, type, containingPackage, isConst) {
|
|
59391
|
+
const result = new IntrinsicVariableEntity(name, type, containingPackage);
|
|
59392
|
+
result.isPackageMember = true;
|
|
59393
|
+
result.details.isConst = isConst;
|
|
59394
|
+
return result;
|
|
59395
|
+
}
|
|
59396
|
+
function typeMemberFunctionEntity(functionEntityKind, name, parameters, returnType, containingType, isAsync, overriddenMembers, isBasic, isAbstract, isStatic, hasComputedName) {
|
|
59397
|
+
const result = new IntrinsicFunctionEntity(
|
|
59398
|
+
functionEntityKind,
|
|
59399
|
+
name,
|
|
59400
|
+
parameters,
|
|
59401
|
+
returnType,
|
|
59402
|
+
containingType.containingPackage
|
|
59403
|
+
);
|
|
59404
|
+
result.ifTypeMemberThenContainingType = containingType;
|
|
59405
|
+
result.details.isAsync = isAsync;
|
|
59406
|
+
result.details.overriddenMembers = overriddenMembers;
|
|
59407
|
+
result.details.isBasic = isBasic;
|
|
59408
|
+
result.details.isAbstract = isAbstract;
|
|
59409
|
+
result.details.isStatic = isStatic;
|
|
59410
|
+
result.details.hasComputedName = hasComputedName;
|
|
59411
|
+
return result;
|
|
59412
|
+
}
|
|
59413
|
+
function fieldAccessorEntity(name, parameters, returnType, containingPackage, overriddenMembers, isBasic, isAbstract, isStatic) {
|
|
59414
|
+
const result = new IntrinsicFunctionEntity(
|
|
59415
|
+
1 /* GetterOrSetter */,
|
|
59416
|
+
name,
|
|
59417
|
+
parameters,
|
|
59418
|
+
returnType,
|
|
59419
|
+
containingPackage
|
|
59229
59420
|
);
|
|
59421
|
+
result.details.overriddenMembers = overriddenMembers;
|
|
59422
|
+
result.details.isBasic = isBasic;
|
|
59423
|
+
result.details.isAbstract = isAbstract;
|
|
59424
|
+
result.details.isStatic = isStatic;
|
|
59425
|
+
return result;
|
|
59230
59426
|
}
|
|
59231
|
-
function
|
|
59232
|
-
const
|
|
59233
|
-
|
|
59234
|
-
|
|
59235
|
-
|
|
59236
|
-
|
|
59237
|
-
|
|
59238
|
-
accessedVariable,
|
|
59239
|
-
0 /* Get */,
|
|
59240
|
-
void 0,
|
|
59241
|
-
sourceLocation
|
|
59427
|
+
function packageFunctionEntity(name, parameters, returnType, containingPackage, isAsync, isPackageConstructor, isPackageEntryPoint) {
|
|
59428
|
+
const result = new IntrinsicFunctionEntity(
|
|
59429
|
+
0 /* RegularFunction */,
|
|
59430
|
+
name,
|
|
59431
|
+
parameters,
|
|
59432
|
+
returnType,
|
|
59433
|
+
containingPackage
|
|
59242
59434
|
);
|
|
59435
|
+
result.isPackageMember = true;
|
|
59436
|
+
result.details.isAsync = isAsync;
|
|
59437
|
+
result.details.isPackageConstructor = isPackageConstructor;
|
|
59438
|
+
result.details.isPackageEntryPoint = isPackageEntryPoint;
|
|
59439
|
+
return result;
|
|
59440
|
+
}
|
|
59441
|
+
function packageEntity(name, locale, isPackageWithMainFunction, isMainPackage) {
|
|
59442
|
+
const result = new IntrinsicPackageEntity(name, locale);
|
|
59443
|
+
result.details.isPackageWithMainFunction = isPackageWithMainFunction;
|
|
59444
|
+
result.details.isMainPackage = isMainPackage;
|
|
59445
|
+
return result;
|
|
59243
59446
|
}
|
|
59244
59447
|
|
|
59245
59448
|
// source/emitter/DebugStack.ts
|
|
@@ -60909,8 +61112,8 @@ var GeneralLoweringContext = class {
|
|
|
60909
61112
|
this.ectx.type.ofExpression(initializer)
|
|
60910
61113
|
);
|
|
60911
61114
|
tempVariables?.push(tempVariable);
|
|
60912
|
-
assignment = assignmentExpression(
|
|
60913
|
-
access =
|
|
61115
|
+
assignment = assignmentExpression(variableGetAccess(tempVariable), initializer).withOptions(new AssignmentEmitOptions(false, false, false));
|
|
61116
|
+
access = variableGetAccess(tempVariable);
|
|
60914
61117
|
}
|
|
60915
61118
|
return [tempVariable, assignment, access];
|
|
60916
61119
|
}
|
|
@@ -61006,9 +61209,9 @@ var GeneralLoweringContext = class {
|
|
|
61006
61209
|
* })
|
|
61007
61210
|
*/
|
|
61008
61211
|
createCallOfDefineObjectPropertyMethodWithDescriptor(object, propertyKey, descriptor, descriptorOptionsOverride) {
|
|
61009
|
-
const keyExpression = typeof propertyKey === "string" ?
|
|
61212
|
+
const keyExpression = typeof propertyKey === "string" ? textLiteral(propertyKey) : propertyKey;
|
|
61010
61213
|
const definePropertyAccess = jsPropertyAccessExpression(
|
|
61011
|
-
|
|
61214
|
+
typeAccessExpression(this.ectx.jsObjectType),
|
|
61012
61215
|
false,
|
|
61013
61216
|
"defineProperty",
|
|
61014
61217
|
this.ectx.standardTypes.func
|
|
@@ -61046,9 +61249,9 @@ var GeneralLoweringContext = class {
|
|
|
61046
61249
|
* Object.getOwnPropertyDescriptor(object, propertyKey)
|
|
61047
61250
|
*/
|
|
61048
61251
|
createGetOwnPropertyDescriptorCall(object, propertyKey) {
|
|
61049
|
-
const keyExpression = typeof propertyKey === "string" ?
|
|
61252
|
+
const keyExpression = typeof propertyKey === "string" ? textLiteral(propertyKey) : propertyKey;
|
|
61050
61253
|
const getOwnPropertyDescriptorAccess = jsPropertyAccessExpression(
|
|
61051
|
-
|
|
61254
|
+
typeAccessExpression(this.ectx.jsObjectType),
|
|
61052
61255
|
false,
|
|
61053
61256
|
"getOwnPropertyDescriptor",
|
|
61054
61257
|
this.ectx.standardTypes.func
|
|
@@ -61072,18 +61275,7 @@ var GeneralLoweringContext = class {
|
|
|
61072
61275
|
return jsPropertyAccessExpression(object, isOptionalChaining, "call", this.ectx.standardTypes.func);
|
|
61073
61276
|
}
|
|
61074
61277
|
createKeyForComputedNameWithSymbolKey(symbolDeclaration) {
|
|
61075
|
-
|
|
61076
|
-
return new FieldAccessExpression(
|
|
61077
|
-
new TypeAccessExpression(symbolDeclaration.ifTypeMemberThenContainingType, void 0),
|
|
61078
|
-
false,
|
|
61079
|
-
AccessedVariable.fromEntity(symbolDeclaration),
|
|
61080
|
-
0 /* Get */,
|
|
61081
|
-
void 0,
|
|
61082
|
-
void 0
|
|
61083
|
-
);
|
|
61084
|
-
} else {
|
|
61085
|
-
return new VariableAccessExpression(AccessedVariable.fromEntity(symbolDeclaration), 0 /* Get */, void 0);
|
|
61086
|
-
}
|
|
61278
|
+
return symbolDeclaration.ifTypeMemberThenContainingType !== void 0 ? staticFieldGetAccess(symbolDeclaration) : variableGetAccess(symbolDeclaration);
|
|
61087
61279
|
}
|
|
61088
61280
|
isWriteableVariable(entity) {
|
|
61089
61281
|
if (this.isComputedVariable(entity)) {
|
|
@@ -61166,8 +61358,7 @@ var GeneralLoweringContext = class {
|
|
|
61166
61358
|
5 /* Equals */,
|
|
61167
61359
|
nullLiteral()
|
|
61168
61360
|
);
|
|
61169
|
-
|
|
61170
|
-
result = new TernaryExpression(isEmptyExpression, nullLiteral(), substitutionMemberAccess, memberAccessType);
|
|
61361
|
+
result = ternaryExpression(isEmptyExpression, nullLiteral(), substitutionMemberAccess);
|
|
61171
61362
|
} else {
|
|
61172
61363
|
result = createMemberAccess(receiver);
|
|
61173
61364
|
}
|
|
@@ -61185,23 +61376,22 @@ var GeneralLoweringContext = class {
|
|
|
61185
61376
|
path: fileUri.path,
|
|
61186
61377
|
fragment: nodePathText
|
|
61187
61378
|
}).toString();
|
|
61188
|
-
return
|
|
61379
|
+
return textLiteral(locationText);
|
|
61189
61380
|
}
|
|
61190
61381
|
findOrCreatePackageConstructor(pkg2) {
|
|
61191
61382
|
let result = pkg2.declarations.find((d) => d.kind === 22 /* PackageFunctionDeclaration */ && d.entity.details.isPackageConstructor);
|
|
61192
61383
|
if (result === void 0) {
|
|
61193
|
-
const entity =
|
|
61194
|
-
0 /* RegularFunction */,
|
|
61384
|
+
const entity = packageFunctionEntity(
|
|
61195
61385
|
EmitPhaseName.ofPackageConstructor(pkg2.entity.locale),
|
|
61196
61386
|
[],
|
|
61197
61387
|
this.ectx.standardTypes.nullType,
|
|
61198
|
-
pkg2.entity
|
|
61388
|
+
pkg2.entity,
|
|
61389
|
+
false,
|
|
61390
|
+
true,
|
|
61391
|
+
false
|
|
61199
61392
|
);
|
|
61200
|
-
entity.details.isPackageConstructor = true;
|
|
61201
|
-
entity.isPackageMember = true;
|
|
61202
61393
|
const entityMembers = Array.from(pkg2.entity.members);
|
|
61203
|
-
|
|
61204
|
-
pkg2.entity.members = entityMembers;
|
|
61394
|
+
pkg2.entity.members = pkg2.entity.members.concat(entity);
|
|
61205
61395
|
result = packageFunctionDeclaration(entity, [], blockStatement([]), false);
|
|
61206
61396
|
pkg2.declarations = pkg2.declarations.concat(result);
|
|
61207
61397
|
}
|
|
@@ -61226,7 +61416,7 @@ var GeneralLoweringContext = class {
|
|
|
61226
61416
|
}
|
|
61227
61417
|
createUniqueLocalVariableEntity(containingPackage, type) {
|
|
61228
61418
|
const name = EmitPhaseName.ofTempVariable(containingPackage.locale, this.generateId());
|
|
61229
|
-
return
|
|
61419
|
+
return localVariableEntity(name, type, containingPackage, false);
|
|
61230
61420
|
}
|
|
61231
61421
|
};
|
|
61232
61422
|
var HelperFunctions = class {
|
|
@@ -61252,9 +61442,9 @@ var HelperFunctions = class {
|
|
|
61252
61442
|
}
|
|
61253
61443
|
};
|
|
61254
61444
|
var ExecutableCodeLowering = class {
|
|
61255
|
-
constructor(ctx,
|
|
61445
|
+
constructor(ctx, packageEntity2) {
|
|
61256
61446
|
this.ctx = ctx;
|
|
61257
|
-
this.packageEntity =
|
|
61447
|
+
this.packageEntity = packageEntity2;
|
|
61258
61448
|
}
|
|
61259
61449
|
createCachingTemporaryVariable(initializer, tempVariables) {
|
|
61260
61450
|
return this.ctx.createCachingTemporaryVariable(initializer, this.packageEntity, tempVariables);
|
|
@@ -61304,42 +61494,30 @@ var ImplicitImplementationLowering = class {
|
|
|
61304
61494
|
// return base.method(p1, p2)
|
|
61305
61495
|
// }
|
|
61306
61496
|
createExplicitMethodImplementation(implementingMethod, implementedAbstractMethods, containingType) {
|
|
61307
|
-
const parameterEntities = implementingMethod.parameters.map((p) =>
|
|
61308
|
-
const
|
|
61497
|
+
const parameterEntities = implementingMethod.parameters.map((p) => parameterEntity(p.name, p.type, p.containingPackage, p.details.isVariadicParameter));
|
|
61498
|
+
const computedNameInfo = implementingMethod.details.hasComputedName !== void 0 ? { ...implementingMethod.details.hasComputedName } : void 0;
|
|
61499
|
+
const methodEntity = typeMemberFunctionEntity(
|
|
61309
61500
|
0 /* RegularFunction */,
|
|
61310
61501
|
implementingMethod.name,
|
|
61311
61502
|
parameterEntities,
|
|
61312
61503
|
implementingMethod.returnType,
|
|
61313
|
-
|
|
61314
|
-
|
|
61315
|
-
|
|
61316
|
-
if (implementingMethod.details.hasComputedName !== void 0) {
|
|
61317
|
-
methodEntity.details.hasComputedName = { ...implementingMethod.details.hasComputedName };
|
|
61318
|
-
}
|
|
61319
|
-
methodEntity.details.overriddenMembers = [implementingMethod, ...implementedAbstractMethods];
|
|
61320
|
-
const parameterDeclarations = parameterEntities.map((e) => new ParameterDeclaration2(
|
|
61321
|
-
e,
|
|
61322
|
-
void 0,
|
|
61504
|
+
containingType,
|
|
61505
|
+
implementingMethod.details.isAsync,
|
|
61506
|
+
[implementingMethod, ...implementedAbstractMethods],
|
|
61323
61507
|
false,
|
|
61324
|
-
|
|
61325
|
-
|
|
61508
|
+
false,
|
|
61509
|
+
false,
|
|
61510
|
+
computedNameInfo
|
|
61511
|
+
);
|
|
61512
|
+
const parameterDeclarations = parameterEntities.map((e) => parameterDeclaration(e, void 0, false));
|
|
61326
61513
|
const methodCall = instanceMethodCallExpression(
|
|
61327
61514
|
baseExpression(),
|
|
61328
61515
|
implementingMethod,
|
|
61329
|
-
parameterEntities.map((e) =>
|
|
61516
|
+
parameterEntities.map((e) => variableGetAccess(e)),
|
|
61330
61517
|
false
|
|
61331
61518
|
);
|
|
61332
61519
|
const body = blockStatement([returnStatement(methodCall)]);
|
|
61333
|
-
return
|
|
61334
|
-
[],
|
|
61335
|
-
new Modifiers(),
|
|
61336
|
-
parameterDeclarations,
|
|
61337
|
-
body,
|
|
61338
|
-
methodEntity,
|
|
61339
|
-
false,
|
|
61340
|
-
void 0,
|
|
61341
|
-
void 0
|
|
61342
|
-
);
|
|
61520
|
+
return methodDeclaration(methodEntity, parameterDeclarations, body, false);
|
|
61343
61521
|
}
|
|
61344
61522
|
// get field() {
|
|
61345
61523
|
// return super.field
|
|
@@ -61348,71 +61526,76 @@ var ImplicitImplementationLowering = class {
|
|
|
61348
61526
|
// super.field = value
|
|
61349
61527
|
// }
|
|
61350
61528
|
createExplicitFieldImplementation(implementingField, implementedAbstractFields, containingType) {
|
|
61351
|
-
const
|
|
61529
|
+
const computedNameInfo = implementingField.details.hasComputedName !== void 0 ? { ...implementingField.details.hasComputedName } : void 0;
|
|
61530
|
+
const fieldEntity2 = fieldEntity(
|
|
61352
61531
|
implementingField.name,
|
|
61353
61532
|
implementingField.type,
|
|
61354
|
-
|
|
61533
|
+
containingType,
|
|
61534
|
+
[implementingField, ...implementedAbstractFields],
|
|
61535
|
+
false,
|
|
61536
|
+
false,
|
|
61537
|
+
false,
|
|
61538
|
+
false,
|
|
61539
|
+
computedNameInfo
|
|
61355
61540
|
);
|
|
61356
|
-
fieldEntity.ifTypeMemberThenContainingType = containingType;
|
|
61357
|
-
if (implementingField.details.hasComputedName !== void 0) {
|
|
61358
|
-
fieldEntity.details.hasComputedName = { ...implementingField.details.hasComputedName };
|
|
61359
|
-
}
|
|
61360
|
-
fieldEntity.details.overriddenMembers = [implementingField, ...implementedAbstractFields];
|
|
61361
61541
|
const getter = this.createRedirectingGetter(implementingField);
|
|
61362
61542
|
let setter;
|
|
61363
61543
|
if (this.ctx.isWriteableVariable(implementingField)) {
|
|
61364
61544
|
setter = this.createRedirectingSetter(implementingField);
|
|
61365
61545
|
}
|
|
61366
|
-
return
|
|
61546
|
+
return computedFieldDeclaration(fieldEntity2, getter, setter);
|
|
61367
61547
|
}
|
|
61368
61548
|
// get field() {
|
|
61369
61549
|
// return super.field
|
|
61370
61550
|
// }
|
|
61371
61551
|
createRedirectingGetter(targetFieldEntity) {
|
|
61372
|
-
const getterEntity =
|
|
61373
|
-
1 /* GetterOrSetter */,
|
|
61552
|
+
const getterEntity = fieldAccessorEntity(
|
|
61374
61553
|
targetFieldEntity.name,
|
|
61375
61554
|
[],
|
|
61376
61555
|
targetFieldEntity.type,
|
|
61377
|
-
targetFieldEntity.containingPackage
|
|
61556
|
+
targetFieldEntity.containingPackage,
|
|
61557
|
+
[],
|
|
61558
|
+
false,
|
|
61559
|
+
false,
|
|
61560
|
+
false
|
|
61378
61561
|
);
|
|
61379
|
-
const variableAccess =
|
|
61562
|
+
const variableAccess = instanceFieldGetAccess(
|
|
61380
61563
|
baseExpression(),
|
|
61381
|
-
false,
|
|
61382
61564
|
targetFieldEntity,
|
|
61383
|
-
|
|
61384
|
-
void 0
|
|
61565
|
+
false
|
|
61385
61566
|
);
|
|
61386
61567
|
const body = blockStatement([returnStatement(variableAccess)]);
|
|
61387
|
-
return
|
|
61568
|
+
return fieldGetterDeclaration(getterEntity, body);
|
|
61388
61569
|
}
|
|
61389
61570
|
// set field(value) {
|
|
61390
61571
|
// super.field = value
|
|
61391
61572
|
// }
|
|
61392
61573
|
createRedirectingSetter(targetFieldEntity) {
|
|
61393
|
-
const
|
|
61574
|
+
const parameterEntity2 = parameterEntity(
|
|
61394
61575
|
EmitPhaseName.ofSetterParameter(targetFieldEntity.containingPackage.locale),
|
|
61395
61576
|
targetFieldEntity.type,
|
|
61396
|
-
targetFieldEntity.containingPackage
|
|
61577
|
+
targetFieldEntity.containingPackage,
|
|
61578
|
+
false
|
|
61397
61579
|
);
|
|
61398
|
-
const setterEntity =
|
|
61399
|
-
1 /* GetterOrSetter */,
|
|
61580
|
+
const setterEntity = fieldAccessorEntity(
|
|
61400
61581
|
targetFieldEntity.name,
|
|
61401
|
-
[
|
|
61582
|
+
[parameterEntity2],
|
|
61402
61583
|
this.ctx.ectx.standardTypes.nullType,
|
|
61403
|
-
targetFieldEntity.containingPackage
|
|
61584
|
+
targetFieldEntity.containingPackage,
|
|
61585
|
+
[],
|
|
61586
|
+
false,
|
|
61587
|
+
false,
|
|
61588
|
+
false
|
|
61404
61589
|
);
|
|
61405
|
-
const variableAccess =
|
|
61590
|
+
const variableAccess = instanceFieldSetAccess(
|
|
61406
61591
|
baseExpression(),
|
|
61407
|
-
false,
|
|
61408
61592
|
targetFieldEntity,
|
|
61409
|
-
|
|
61410
|
-
void 0
|
|
61593
|
+
false
|
|
61411
61594
|
);
|
|
61412
|
-
const parameterAccess =
|
|
61595
|
+
const parameterAccess = variableGetAccess(parameterEntity2);
|
|
61413
61596
|
const variableAssignment = assignmentStatement(variableAccess, parameterAccess).withOptions(new AssignmentEmitOptions(false, false, false));
|
|
61414
61597
|
const body = blockStatement([variableAssignment]);
|
|
61415
|
-
return
|
|
61598
|
+
return fieldSetterDeclaration(setterEntity, body, parameterEntity2);
|
|
61416
61599
|
}
|
|
61417
61600
|
};
|
|
61418
61601
|
var CompoundDeclarationsAndOperatorsLowering = class {
|
|
@@ -61437,12 +61620,7 @@ var CompoundDeclarationsAndOperatorsLowering = class {
|
|
|
61437
61620
|
memberEntities.delete(d.variableEntity);
|
|
61438
61621
|
memberEntities.add(d.entity);
|
|
61439
61622
|
d.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
61440
|
-
const parameters = [
|
|
61441
|
-
d.valueLocalVariableEntity,
|
|
61442
|
-
void 0,
|
|
61443
|
-
false,
|
|
61444
|
-
void 0
|
|
61445
|
-
)];
|
|
61623
|
+
const parameters = [parameterDeclaration(d.valueLocalVariableEntity, void 0, false)];
|
|
61446
61624
|
d = packageFunctionDeclaration(d.entity, parameters, d.body, false, d.sourceLocation);
|
|
61447
61625
|
return d;
|
|
61448
61626
|
}
|
|
@@ -61456,66 +61634,25 @@ var CompoundDeclarationsAndOperatorsLowering = class {
|
|
|
61456
61634
|
declaration.members = declaration.members.map((m) => {
|
|
61457
61635
|
if (m.kind === 51 /* IndexedElementGetterDeclaration */) {
|
|
61458
61636
|
m.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
61459
|
-
const method =
|
|
61460
|
-
m.decorators,
|
|
61461
|
-
m.modifiers,
|
|
61462
|
-
m.parameters,
|
|
61463
|
-
m.body,
|
|
61464
|
-
m.entity,
|
|
61465
|
-
false,
|
|
61466
|
-
void 0,
|
|
61467
|
-
m.sourceLocation
|
|
61468
|
-
);
|
|
61637
|
+
const method = methodDeclaration(m.entity, m.parameters, m.body, false, m.sourceLocation).withDecorators(m.decorators);
|
|
61469
61638
|
return method;
|
|
61470
61639
|
} else if (m.kind === 52 /* IndexedElementSetterDeclaration */) {
|
|
61471
61640
|
m.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
61472
61641
|
m.entity.parameters = m.entity.parameters.concat(m.valueLocalVariableEntity);
|
|
61473
61642
|
const parameters = Array.from(m.parameters);
|
|
61474
|
-
parameters.push(
|
|
61475
|
-
const method =
|
|
61476
|
-
m.decorators,
|
|
61477
|
-
m.modifiers,
|
|
61478
|
-
parameters,
|
|
61479
|
-
m.body,
|
|
61480
|
-
m.entity,
|
|
61481
|
-
false,
|
|
61482
|
-
void 0,
|
|
61483
|
-
m.sourceLocation
|
|
61484
|
-
);
|
|
61643
|
+
parameters.push(parameterDeclaration(m.valueLocalVariableEntity, void 0, false));
|
|
61644
|
+
const method = methodDeclaration(m.entity, parameters, m.body, false, m.sourceLocation).withDecorators(m.decorators);
|
|
61485
61645
|
return method;
|
|
61486
61646
|
}
|
|
61487
61647
|
if (m.kind === 92 /* DereferencedVariableGetterDeclaration */) {
|
|
61488
61648
|
m.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
61489
|
-
const method =
|
|
61490
|
-
m.decorators,
|
|
61491
|
-
m.modifiers,
|
|
61492
|
-
[],
|
|
61493
|
-
m.body,
|
|
61494
|
-
m.entity,
|
|
61495
|
-
false,
|
|
61496
|
-
void 0,
|
|
61497
|
-
m.sourceLocation
|
|
61498
|
-
);
|
|
61649
|
+
const method = methodDeclaration(m.entity, [], m.body, false, m.sourceLocation).withDecorators(m.decorators);
|
|
61499
61650
|
return method;
|
|
61500
61651
|
} else if (m.kind === 93 /* DereferencedVariableSetterDeclaration */) {
|
|
61501
61652
|
m.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
61502
61653
|
m.entity.parameters = [m.valueLocalVariableEntity];
|
|
61503
|
-
const parameters = [
|
|
61504
|
-
|
|
61505
|
-
void 0,
|
|
61506
|
-
false,
|
|
61507
|
-
void 0
|
|
61508
|
-
)];
|
|
61509
|
-
const method = new MethodDeclaration2(
|
|
61510
|
-
m.decorators,
|
|
61511
|
-
m.modifiers,
|
|
61512
|
-
parameters,
|
|
61513
|
-
m.body,
|
|
61514
|
-
m.entity,
|
|
61515
|
-
false,
|
|
61516
|
-
void 0,
|
|
61517
|
-
m.sourceLocation
|
|
61518
|
-
);
|
|
61654
|
+
const parameters = [parameterDeclaration(m.valueLocalVariableEntity, void 0, false)];
|
|
61655
|
+
const method = methodDeclaration(m.entity, parameters, m.body, false, m.sourceLocation).withDecorators(m.decorators);
|
|
61519
61656
|
return method;
|
|
61520
61657
|
} else {
|
|
61521
61658
|
return m;
|
|
@@ -61556,7 +61693,7 @@ var TypeExtensionBasicMembersLowering = class {
|
|
|
61556
61693
|
// configurable: false,
|
|
61557
61694
|
// enumerable: false,
|
|
61558
61695
|
// })
|
|
61559
|
-
addBasicMembersToExtendedTypePrototype(
|
|
61696
|
+
addBasicMembersToExtendedTypePrototype(packageEntity2, node) {
|
|
61560
61697
|
if (node.entity.details.extendedType === void 0) {
|
|
61561
61698
|
return void 0;
|
|
61562
61699
|
}
|
|
@@ -61569,14 +61706,14 @@ var TypeExtensionBasicMembersLowering = class {
|
|
|
61569
61706
|
for (const member of node.members) {
|
|
61570
61707
|
if ((member.kind === 53 /* MethodDeclaration */ || member.kind === 95 /* ComputedFieldDeclaration */) && member.entity.details.isBasic) {
|
|
61571
61708
|
const keyName = `${node.entity.name}_${member.entity.name}`;
|
|
61572
|
-
const keyEntity =
|
|
61709
|
+
const keyEntity = packageVariableEntity(
|
|
61573
61710
|
keyName,
|
|
61574
61711
|
this.ctx.ectx.createIdentitySubstitutedType(this.ctx.ectx.jsSymbolType),
|
|
61575
|
-
|
|
61712
|
+
packageEntity2,
|
|
61713
|
+
true
|
|
61576
61714
|
);
|
|
61577
|
-
keyEntity.isPackageMember = true;
|
|
61578
61715
|
const keyInitializer = callExpression(
|
|
61579
|
-
|
|
61716
|
+
typeAccessExpression(this.ctx.ectx.jsSymbolType),
|
|
61580
61717
|
false,
|
|
61581
61718
|
[],
|
|
61582
61719
|
false,
|
|
@@ -61584,19 +61721,17 @@ var TypeExtensionBasicMembersLowering = class {
|
|
|
61584
61721
|
);
|
|
61585
61722
|
const keyDeclaration = packageVariableDeclaration(keyEntity, keyInitializer).withOptions(new PackageVariableDeclarationEmitOptions(true, true));
|
|
61586
61723
|
symbolDeclarations.push(keyDeclaration);
|
|
61587
|
-
const typeExtensionPrototypeAccess = this.ctx.createPrototypeAccess(
|
|
61588
|
-
new TypeAccessExpression(node.entity, void 0)
|
|
61589
|
-
);
|
|
61724
|
+
const typeExtensionPrototypeAccess = this.ctx.createPrototypeAccess(typeAccessExpression(node.entity));
|
|
61590
61725
|
const getOwnPropertyDescriptorCall = this.ctx.createGetOwnPropertyDescriptorCall(
|
|
61591
61726
|
typeExtensionPrototypeAccess,
|
|
61592
|
-
|
|
61727
|
+
textWithEntityName(member.entity)
|
|
61593
61728
|
);
|
|
61594
61729
|
const extendedTypePrototypeAccess = this.ctx.createPrototypeAccess(
|
|
61595
|
-
|
|
61730
|
+
typeAccessExpression(extendedType.entity)
|
|
61596
61731
|
);
|
|
61597
61732
|
const definePropertyCall = this.ctx.createCallOfDefineObjectPropertyMethodWithDescriptor(
|
|
61598
61733
|
extendedTypePrototypeAccess,
|
|
61599
|
-
|
|
61734
|
+
variableGetAccess(keyEntity),
|
|
61600
61735
|
getOwnPropertyDescriptorCall,
|
|
61601
61736
|
{ isConfigurable: false, isEnumerable: false }
|
|
61602
61737
|
);
|
|
@@ -61657,17 +61792,17 @@ var AspectsLowering = class {
|
|
|
61657
61792
|
}
|
|
61658
61793
|
}
|
|
61659
61794
|
// const key = Symbol()
|
|
61660
|
-
createAspectMemberKeyDeclaration(entity,
|
|
61795
|
+
createAspectMemberKeyDeclaration(entity, packageEntity2) {
|
|
61661
61796
|
Debug.assertNotNull(entity.ifTypeMemberThenContainingType);
|
|
61662
61797
|
const keyName = `${entity.ifTypeMemberThenContainingType.name}_${entity.name}`;
|
|
61663
|
-
const keyEntity =
|
|
61798
|
+
const keyEntity = packageVariableEntity(
|
|
61664
61799
|
keyName,
|
|
61665
61800
|
this.ctx.ectx.createIdentitySubstitutedType(this.ctx.ectx.jsSymbolType),
|
|
61666
|
-
|
|
61801
|
+
packageEntity2,
|
|
61802
|
+
true
|
|
61667
61803
|
);
|
|
61668
|
-
keyEntity.isPackageMember = true;
|
|
61669
61804
|
const keyInitializer = callExpression(
|
|
61670
|
-
|
|
61805
|
+
typeAccessExpression(this.ctx.ectx.jsSymbolType),
|
|
61671
61806
|
false,
|
|
61672
61807
|
[],
|
|
61673
61808
|
false,
|
|
@@ -61687,8 +61822,8 @@ var AspectsLowering = class {
|
|
|
61687
61822
|
if (overriddenAspectMethods !== void 0) {
|
|
61688
61823
|
for (const overriddenAspectMethod of overriddenAspectMethods) {
|
|
61689
61824
|
if (overriddenAspectMethod.containingPackage.details.isSource && overriddenAspectMethod.details.hasComputedName !== void 0) {
|
|
61690
|
-
const
|
|
61691
|
-
addedMembers.push(
|
|
61825
|
+
const methodDeclaration2 = this.createRedirectingMethod(member.entity, overriddenAspectMethod);
|
|
61826
|
+
addedMembers.push(methodDeclaration2);
|
|
61692
61827
|
}
|
|
61693
61828
|
}
|
|
61694
61829
|
}
|
|
@@ -61700,11 +61835,11 @@ var AspectsLowering = class {
|
|
|
61700
61835
|
if (overriddenAspectVariables !== void 0) {
|
|
61701
61836
|
for (const overriddenAspectVariable of overriddenAspectVariables) {
|
|
61702
61837
|
if (overriddenAspectVariable.containingPackage.details.isSource && overriddenAspectVariable.details.hasComputedName !== void 0) {
|
|
61703
|
-
const
|
|
61838
|
+
const methodDeclaration2 = this.createRedirectingComputedVariable(
|
|
61704
61839
|
member.entity,
|
|
61705
61840
|
overriddenAspectVariable
|
|
61706
61841
|
);
|
|
61707
|
-
addedMembers.push(
|
|
61842
|
+
addedMembers.push(methodDeclaration2);
|
|
61708
61843
|
}
|
|
61709
61844
|
}
|
|
61710
61845
|
}
|
|
@@ -61735,44 +61870,34 @@ var AspectsLowering = class {
|
|
|
61735
61870
|
createRedirectingMethod(targetFunctionEntity, aspectFunctionEntity) {
|
|
61736
61871
|
Debug.assertNotNull(targetFunctionEntity.ifTypeMemberThenContainingType);
|
|
61737
61872
|
Debug.assertNotNull(aspectFunctionEntity.details.hasComputedName);
|
|
61738
|
-
const parameterEntities = targetFunctionEntity.parameters.map((p) =>
|
|
61739
|
-
const
|
|
61740
|
-
0 /* RegularFunction */,
|
|
61741
|
-
targetFunctionEntity.name,
|
|
61742
|
-
parameterEntities,
|
|
61743
|
-
targetFunctionEntity.returnType,
|
|
61744
|
-
targetFunctionEntity.containingPackage
|
|
61745
|
-
);
|
|
61746
|
-
functionEntity.ifTypeMemberThenContainingType = targetFunctionEntity.ifTypeMemberThenContainingType;
|
|
61747
|
-
functionEntity.details.hasComputedName = {
|
|
61873
|
+
const parameterEntities = targetFunctionEntity.parameters.map((p) => parameterEntity(p.name, p.type, p.containingPackage, p.details.isVariadicParameter));
|
|
61874
|
+
const computedNameInfo = {
|
|
61748
61875
|
symbolDeclaration: aspectFunctionEntity.details.hasComputedName.symbolDeclaration,
|
|
61749
61876
|
affectsDeclaration: true,
|
|
61750
61877
|
affectsDerivedMembers: false
|
|
61751
61878
|
};
|
|
61752
|
-
functionEntity
|
|
61753
|
-
|
|
61754
|
-
|
|
61755
|
-
|
|
61879
|
+
const functionEntity = typeMemberFunctionEntity(
|
|
61880
|
+
0 /* RegularFunction */,
|
|
61881
|
+
targetFunctionEntity.name,
|
|
61882
|
+
parameterEntities,
|
|
61883
|
+
targetFunctionEntity.returnType,
|
|
61884
|
+
targetFunctionEntity.ifTypeMemberThenContainingType,
|
|
61885
|
+
aspectFunctionEntity.details.isAsync,
|
|
61886
|
+
[aspectFunctionEntity],
|
|
61756
61887
|
false,
|
|
61757
|
-
|
|
61758
|
-
|
|
61888
|
+
false,
|
|
61889
|
+
false,
|
|
61890
|
+
computedNameInfo
|
|
61891
|
+
);
|
|
61892
|
+
const parameterDeclarations = parameterEntities.map((e) => parameterDeclaration(e, void 0, false));
|
|
61759
61893
|
const methodCall = instanceMethodCallExpression(
|
|
61760
|
-
|
|
61894
|
+
thisExpression(this.ctx.ectx.standardTypes.refObject),
|
|
61761
61895
|
targetFunctionEntity,
|
|
61762
|
-
parameterEntities.map((e) =>
|
|
61896
|
+
parameterEntities.map((e) => variableGetAccess(e)),
|
|
61763
61897
|
false
|
|
61764
61898
|
);
|
|
61765
61899
|
const body = blockStatement([returnStatement(methodCall)]);
|
|
61766
|
-
return
|
|
61767
|
-
[],
|
|
61768
|
-
new Modifiers(),
|
|
61769
|
-
parameterDeclarations,
|
|
61770
|
-
body,
|
|
61771
|
-
functionEntity,
|
|
61772
|
-
false,
|
|
61773
|
-
void 0,
|
|
61774
|
-
void 0
|
|
61775
|
-
);
|
|
61900
|
+
return methodDeclaration(functionEntity, parameterDeclarations, body, false);
|
|
61776
61901
|
}
|
|
61777
61902
|
// get [Aspect_variable]() {
|
|
61778
61903
|
// return this.variable
|
|
@@ -61783,72 +61908,80 @@ var AspectsLowering = class {
|
|
|
61783
61908
|
createRedirectingComputedVariable(targetVariableEntity, aspectVariableEntity) {
|
|
61784
61909
|
Debug.assertNotNull(targetVariableEntity.ifTypeMemberThenContainingType);
|
|
61785
61910
|
Debug.assertNotNull(aspectVariableEntity.details.hasComputedName);
|
|
61786
|
-
const
|
|
61787
|
-
targetVariableEntity.name,
|
|
61788
|
-
targetVariableEntity.type,
|
|
61789
|
-
targetVariableEntity.containingPackage
|
|
61790
|
-
);
|
|
61791
|
-
entity.ifTypeMemberThenContainingType = targetVariableEntity.ifTypeMemberThenContainingType;
|
|
61792
|
-
entity.details.hasComputedName = {
|
|
61911
|
+
const computedNameInfo = {
|
|
61793
61912
|
symbolDeclaration: aspectVariableEntity.details.hasComputedName.symbolDeclaration,
|
|
61794
61913
|
affectsDeclaration: true,
|
|
61795
61914
|
affectsDerivedMembers: false
|
|
61796
61915
|
};
|
|
61916
|
+
const entity = fieldEntity(
|
|
61917
|
+
targetVariableEntity.name,
|
|
61918
|
+
targetVariableEntity.type,
|
|
61919
|
+
targetVariableEntity.ifTypeMemberThenContainingType,
|
|
61920
|
+
[],
|
|
61921
|
+
aspectVariableEntity.details.isBasic,
|
|
61922
|
+
false,
|
|
61923
|
+
false,
|
|
61924
|
+
aspectVariableEntity.details.isConst,
|
|
61925
|
+
computedNameInfo
|
|
61926
|
+
);
|
|
61797
61927
|
const getter = this.createRedirectingGetter(targetVariableEntity);
|
|
61798
61928
|
let setter;
|
|
61799
61929
|
if (this.ctx.isWriteableVariable(aspectVariableEntity)) {
|
|
61800
61930
|
setter = this.createRedirectingSetter(targetVariableEntity);
|
|
61801
61931
|
}
|
|
61802
|
-
return
|
|
61932
|
+
return computedFieldDeclaration(entity, getter, setter);
|
|
61803
61933
|
}
|
|
61804
61934
|
// get [Aspect_variable]() {
|
|
61805
61935
|
// return this.variable
|
|
61806
61936
|
// }
|
|
61807
61937
|
createRedirectingGetter(targetVariableEntity) {
|
|
61808
|
-
const getterEntity =
|
|
61809
|
-
1 /* GetterOrSetter */,
|
|
61938
|
+
const getterEntity = fieldAccessorEntity(
|
|
61810
61939
|
targetVariableEntity.name,
|
|
61811
61940
|
[],
|
|
61812
61941
|
targetVariableEntity.type,
|
|
61813
|
-
targetVariableEntity.containingPackage
|
|
61814
|
-
|
|
61815
|
-
|
|
61816
|
-
new ThisExpression(this.ctx.ectx.standardTypes.refObject, void 0),
|
|
61942
|
+
targetVariableEntity.containingPackage,
|
|
61943
|
+
[],
|
|
61944
|
+
false,
|
|
61817
61945
|
false,
|
|
61946
|
+
false
|
|
61947
|
+
);
|
|
61948
|
+
const variableAccess = instanceFieldGetAccess(
|
|
61949
|
+
thisExpression(this.ctx.ectx.standardTypes.refObject),
|
|
61818
61950
|
targetVariableEntity,
|
|
61819
|
-
|
|
61820
|
-
void 0
|
|
61951
|
+
false
|
|
61821
61952
|
);
|
|
61822
61953
|
const body = blockStatement([returnStatement(variableAccess)]);
|
|
61823
|
-
return
|
|
61954
|
+
return fieldGetterDeclaration(getterEntity, body);
|
|
61824
61955
|
}
|
|
61825
61956
|
// set [Aspect_variable](value) {
|
|
61826
61957
|
// this.variable = value
|
|
61827
61958
|
// }
|
|
61828
61959
|
createRedirectingSetter(targetVariableEntity) {
|
|
61829
|
-
const
|
|
61960
|
+
const parameterEntity2 = parameterEntity(
|
|
61830
61961
|
EmitPhaseName.ofSetterParameter(targetVariableEntity.containingPackage.locale),
|
|
61831
61962
|
targetVariableEntity.type,
|
|
61832
|
-
targetVariableEntity.containingPackage
|
|
61963
|
+
targetVariableEntity.containingPackage,
|
|
61964
|
+
false
|
|
61833
61965
|
);
|
|
61834
|
-
const setterEntity =
|
|
61835
|
-
1 /* GetterOrSetter */,
|
|
61966
|
+
const setterEntity = fieldAccessorEntity(
|
|
61836
61967
|
targetVariableEntity.name,
|
|
61837
|
-
[
|
|
61968
|
+
[parameterEntity2],
|
|
61838
61969
|
this.ctx.ectx.standardTypes.nullType,
|
|
61839
|
-
targetVariableEntity.containingPackage
|
|
61840
|
-
|
|
61841
|
-
|
|
61842
|
-
new ThisExpression(this.ctx.ectx.standardTypes.refObject, void 0),
|
|
61970
|
+
targetVariableEntity.containingPackage,
|
|
61971
|
+
[],
|
|
61972
|
+
false,
|
|
61843
61973
|
false,
|
|
61974
|
+
false
|
|
61975
|
+
);
|
|
61976
|
+
const variableAccess = instanceFieldSetAccess(
|
|
61977
|
+
thisExpression(this.ctx.ectx.standardTypes.refObject),
|
|
61844
61978
|
targetVariableEntity,
|
|
61845
|
-
|
|
61846
|
-
void 0
|
|
61979
|
+
false
|
|
61847
61980
|
);
|
|
61848
|
-
const parameterAccess =
|
|
61981
|
+
const parameterAccess = variableGetAccess(parameterEntity2);
|
|
61849
61982
|
const variableAssignment = assignmentStatement(variableAccess, parameterAccess).withOptions(new AssignmentEmitOptions(false, false, false));
|
|
61850
61983
|
const body = blockStatement([variableAssignment]);
|
|
61851
|
-
return
|
|
61984
|
+
return fieldSetterDeclaration(setterEntity, body, parameterEntity2);
|
|
61852
61985
|
}
|
|
61853
61986
|
getNotAbstractAspectMembersToAddToDerivedType(entity) {
|
|
61854
61987
|
const overriddenMembers = Query.from(entity.members).map((m) => this.getAllOverriddenAspectMembers(m)).filter((m) => m !== void 0).flatMap((m) => m).uniqueToSet();
|
|
@@ -61923,13 +62056,11 @@ var AspectsLowering = class {
|
|
|
61923
62056
|
const computedNameInfo = entity.details.hasComputedName;
|
|
61924
62057
|
Debug.assertNotNull(computedNameInfo);
|
|
61925
62058
|
const keyAccess = this.ctx.createKeyForComputedNameWithSymbolKey(computedNameInfo.symbolDeclaration);
|
|
61926
|
-
const targetTypePrototypeAccess = this.ctx.createPrototypeAccess(
|
|
61927
|
-
const aspectTypePrototypeAccess = this.ctx.createPrototypeAccess(
|
|
61928
|
-
new TypeAccessExpression(containingType, void 0)
|
|
61929
|
-
);
|
|
62059
|
+
const targetTypePrototypeAccess = this.ctx.createPrototypeAccess(typeAccessExpression(targetType));
|
|
62060
|
+
const aspectTypePrototypeAccess = this.ctx.createPrototypeAccess(typeAccessExpression(containingType));
|
|
61930
62061
|
const getOwnPropertyDescriptorCall = this.ctx.createGetOwnPropertyDescriptorCall(
|
|
61931
62062
|
aspectTypePrototypeAccess,
|
|
61932
|
-
|
|
62063
|
+
textWithEntityName(entity)
|
|
61933
62064
|
);
|
|
61934
62065
|
const definePropertyCall = this.ctx.createCallOfDefineObjectPropertyMethodWithDescriptor(
|
|
61935
62066
|
targetTypePrototypeAccess,
|
|
@@ -62002,7 +62133,7 @@ var AliasTypeAndExtensionLowering = class {
|
|
|
62002
62133
|
const modifiers = node.modifiers;
|
|
62003
62134
|
modifiers.makeStatic();
|
|
62004
62135
|
node.parameters = [
|
|
62005
|
-
|
|
62136
|
+
parameterDeclaration(targetParameterEntity, void 0, false),
|
|
62006
62137
|
...node.parameters
|
|
62007
62138
|
];
|
|
62008
62139
|
this.lowerSubprogramBody(node.body, targetParameterEntity);
|
|
@@ -62023,19 +62154,9 @@ var AliasTypeAndExtensionLowering = class {
|
|
|
62023
62154
|
node.entity.parameters = [targetParameterEntity];
|
|
62024
62155
|
node.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
62025
62156
|
node.entity.details.isAliasTypeOrExtensionMemberThatRequiresLowering = true;
|
|
62026
|
-
const
|
|
62027
|
-
const parameterDeclarations = [new ParameterDeclaration2(targetParameterEntity, void 0, false, void 0)];
|
|
62157
|
+
const parameterDeclarations = [parameterDeclaration(targetParameterEntity, void 0, false)];
|
|
62028
62158
|
this.lowerSubprogramBody(node.body, targetParameterEntity);
|
|
62029
|
-
return
|
|
62030
|
-
node.decorators,
|
|
62031
|
-
modifiers,
|
|
62032
|
-
parameterDeclarations,
|
|
62033
|
-
node.body,
|
|
62034
|
-
node.entity,
|
|
62035
|
-
false,
|
|
62036
|
-
void 0,
|
|
62037
|
-
node.sourceLocation
|
|
62038
|
-
);
|
|
62159
|
+
return methodDeclaration(node.entity, parameterDeclarations, node.body, false, node.sourceLocation).withDecorators(node.decorators);
|
|
62039
62160
|
}
|
|
62040
62161
|
lowerVariableSetterDeclaration(node, variableEntity) {
|
|
62041
62162
|
const containingType = variableEntity.ifTypeMemberThenContainingType;
|
|
@@ -62046,47 +62167,27 @@ var AliasTypeAndExtensionLowering = class {
|
|
|
62046
62167
|
node.entity.parameters = [targetParameterEntity, node.valueLocalVariableEntity];
|
|
62047
62168
|
node.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
62048
62169
|
node.entity.details.isAliasTypeOrExtensionMemberThatRequiresLowering = true;
|
|
62049
|
-
const modifiers = new Modifiers().makeStatic();
|
|
62050
62170
|
const parameterDeclarations = [
|
|
62051
|
-
|
|
62052
|
-
|
|
62171
|
+
parameterDeclaration(targetParameterEntity, void 0, false),
|
|
62172
|
+
parameterDeclaration(node.valueLocalVariableEntity, void 0, false)
|
|
62053
62173
|
];
|
|
62054
62174
|
this.lowerSubprogramBody(node.body, targetParameterEntity);
|
|
62055
|
-
return
|
|
62056
|
-
node.decorators,
|
|
62057
|
-
modifiers,
|
|
62058
|
-
parameterDeclarations,
|
|
62059
|
-
node.body,
|
|
62060
|
-
node.entity,
|
|
62061
|
-
false,
|
|
62062
|
-
void 0,
|
|
62063
|
-
node.sourceLocation
|
|
62064
|
-
);
|
|
62175
|
+
return methodDeclaration(node.entity, parameterDeclarations, node.body, false, node.sourceLocation).withDecorators(node.decorators);
|
|
62065
62176
|
}
|
|
62066
62177
|
lowerConstructorDeclaration(node) {
|
|
62067
62178
|
node.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
62068
62179
|
node.entity.details.isStatic = true;
|
|
62069
|
-
const modifiers = new Modifiers().makeStatic();
|
|
62070
62180
|
this.lowerConstructorBody(node.body, node.entity);
|
|
62071
|
-
return
|
|
62072
|
-
node.decorators,
|
|
62073
|
-
modifiers,
|
|
62074
|
-
node.parameters,
|
|
62075
|
-
node.body,
|
|
62076
|
-
node.entity,
|
|
62077
|
-
false,
|
|
62078
|
-
void 0,
|
|
62079
|
-
void 0
|
|
62080
|
-
);
|
|
62181
|
+
return methodDeclaration(node.entity, node.parameters, node.body, false, node.sourceLocation).withDecorators(node.decorators);
|
|
62081
62182
|
}
|
|
62082
62183
|
lowerSubprogramBody(body, targetVariableEntity) {
|
|
62083
62184
|
const transformer = new Transformer({
|
|
62084
62185
|
transformThisExpression: (_) => {
|
|
62085
|
-
const targetVariableAccess =
|
|
62186
|
+
const targetVariableAccess = variableGetAccess(targetVariableEntity);
|
|
62086
62187
|
return replaceExpression(targetVariableAccess);
|
|
62087
62188
|
},
|
|
62088
62189
|
transformBaseExpression: (_node) => {
|
|
62089
|
-
const targetVariableAccess =
|
|
62190
|
+
const targetVariableAccess = variableGetAccess(targetVariableEntity);
|
|
62090
62191
|
return replaceExpression(targetVariableAccess);
|
|
62091
62192
|
}
|
|
62092
62193
|
});
|
|
@@ -62100,18 +62201,13 @@ var AliasTypeAndExtensionLowering = class {
|
|
|
62100
62201
|
const bodyStatements = Array.from(body.statements);
|
|
62101
62202
|
const baseConstructorCall = this.ctx.findBaseConstructorCall(body);
|
|
62102
62203
|
if (baseConstructorCall !== void 0) {
|
|
62103
|
-
const
|
|
62104
|
-
|
|
62105
|
-
const typeAccess = new TypeAccessExpression(baseConstructorEntity.ifTypeMemberThenContainingType, void 0);
|
|
62106
|
-
const constructorCall = new ConstructorCallExpression(
|
|
62204
|
+
const constructorCall = constructorCallExpression(
|
|
62205
|
+
this.ctx.ectx,
|
|
62107
62206
|
baseConstructorCall.expression.entity,
|
|
62108
|
-
baseConstructorEntity.ifTypeMemberThenContainingType,
|
|
62109
|
-
typeAccess,
|
|
62110
62207
|
baseConstructorCall.expression.args,
|
|
62111
|
-
entity.returnType,
|
|
62112
62208
|
baseConstructorCall.expression.sourceLocation
|
|
62113
62209
|
);
|
|
62114
|
-
const resultSetAccess =
|
|
62210
|
+
const resultSetAccess = variableSetAccess(targetVariableEntity);
|
|
62115
62211
|
const resultAssignment = assignmentStatement(resultSetAccess, constructorCall);
|
|
62116
62212
|
bodyStatements.splice(baseConstructorCall.statementIndex, 1, resultAssignment);
|
|
62117
62213
|
} else {
|
|
@@ -62123,13 +62219,12 @@ var AliasTypeAndExtensionLowering = class {
|
|
|
62123
62219
|
ownConstructorEntity,
|
|
62124
62220
|
ownConstructorCall.expression.args
|
|
62125
62221
|
);
|
|
62126
|
-
const
|
|
62127
|
-
const resultAssignment = assignmentStatement(resultSetAccess, constructorCall);
|
|
62222
|
+
const resultAssignment = assignmentStatement(variableGetAccess(targetVariableEntity), constructorCall);
|
|
62128
62223
|
bodyStatements.splice(ownConstructorCall.statementIndex, 1, resultAssignment);
|
|
62129
62224
|
}
|
|
62130
62225
|
}
|
|
62131
62226
|
const targetVariableDeclaration = localVariableDeclarationStatement(targetVariableEntity, void 0);
|
|
62132
|
-
const returnStatement3 = returnStatement(
|
|
62227
|
+
const returnStatement3 = returnStatement(variableGetAccess(targetVariableEntity));
|
|
62133
62228
|
body.statements = Query.from([targetVariableDeclaration]).chain(bodyStatements).chain([returnStatement3]).toArray();
|
|
62134
62229
|
}
|
|
62135
62230
|
createTargetParameter(typeEntity, containingPackage) {
|
|
@@ -62140,7 +62235,7 @@ var AliasTypeAndExtensionLowering = class {
|
|
|
62140
62235
|
} else {
|
|
62141
62236
|
type = this.ctx.ectx.createIdentitySubstitutedType(typeEntity);
|
|
62142
62237
|
}
|
|
62143
|
-
return
|
|
62238
|
+
return parameterEntity(name, type, containingPackage, false);
|
|
62144
62239
|
}
|
|
62145
62240
|
};
|
|
62146
62241
|
var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLowering {
|
|
@@ -62154,7 +62249,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
|
62154
62249
|
const { expression, tempVariables } = this.lowerMethodCall(node);
|
|
62155
62250
|
return replaceExpression(expression, tempVariables);
|
|
62156
62251
|
} else {
|
|
62157
|
-
node.expression.method =
|
|
62252
|
+
node.expression.method = accessedFunction(realBasicMethod, node.expression.method.returnType);
|
|
62158
62253
|
return preserveExpression();
|
|
62159
62254
|
}
|
|
62160
62255
|
}
|
|
@@ -62193,7 +62288,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
|
62193
62288
|
const tempVariables = new Array();
|
|
62194
62289
|
let receiver = callee.expression;
|
|
62195
62290
|
if (this.ctx.isPossiblyCastedBaseExpression(receiver)) {
|
|
62196
|
-
receiver =
|
|
62291
|
+
receiver = thisExpression(this.ctx.ectx.type.ofExpression(receiver), receiver.sourceLocation);
|
|
62197
62292
|
}
|
|
62198
62293
|
const expression = this.createMemberAccessWithNullCheck(
|
|
62199
62294
|
receiver,
|
|
@@ -62209,7 +62304,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
|
62209
62304
|
}
|
|
62210
62305
|
lowerConstructorCall(node) {
|
|
62211
62306
|
return staticMethodCallExpression(
|
|
62212
|
-
|
|
62307
|
+
accessedFunction(node.entity, node.returnType),
|
|
62213
62308
|
node.args,
|
|
62214
62309
|
node.sourceLocation
|
|
62215
62310
|
).withOptions(new CallExpressionEmitOptions().setIsAliasOrExtensionMethodCallLowered(true));
|
|
@@ -62222,7 +62317,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
|
62222
62317
|
const tempVariables = new Array();
|
|
62223
62318
|
let receiver = node.expression;
|
|
62224
62319
|
if (this.ctx.isPossiblyCastedBaseExpression(receiver)) {
|
|
62225
|
-
receiver =
|
|
62320
|
+
receiver = thisExpression(this.ctx.ectx.type.ofExpression(receiver), receiver.sourceLocation);
|
|
62226
62321
|
}
|
|
62227
62322
|
const expression = this.createMemberAccessWithNullCheck(
|
|
62228
62323
|
receiver,
|
|
@@ -62257,7 +62352,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
|
62257
62352
|
createCallOfMethodWithExplicitReceiver(entity, receiver, args, returnType) {
|
|
62258
62353
|
const newArguments = [receiver, ...args.values];
|
|
62259
62354
|
const options = new CallExpressionEmitOptions().setIsAliasOrExtensionMethodCallLowered(true);
|
|
62260
|
-
return staticMethodCallExpression(
|
|
62355
|
+
return staticMethodCallExpression(accessedFunction(entity, returnType), newArguments).withOptions(options);
|
|
62261
62356
|
}
|
|
62262
62357
|
lowerSimpleAssignmentToComputedVariable(left, value) {
|
|
62263
62358
|
const setter = left.field.entity.setter;
|
|
@@ -62265,7 +62360,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
|
62265
62360
|
const args = new OrderedArguments([value], false);
|
|
62266
62361
|
let receiver = left.expression;
|
|
62267
62362
|
if (this.ctx.isPossiblyCastedBaseExpression(receiver)) {
|
|
62268
|
-
receiver =
|
|
62363
|
+
receiver = thisExpression(this.ctx.ectx.type.ofExpression(receiver), receiver.sourceLocation);
|
|
62269
62364
|
}
|
|
62270
62365
|
const callExpression3 = this.createCallOfMethodWithExplicitReceiver(
|
|
62271
62366
|
setter,
|
|
@@ -62281,13 +62376,13 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
|
62281
62376
|
const tempVariables = new Array();
|
|
62282
62377
|
let receiver = left.expression;
|
|
62283
62378
|
if (this.ctx.isPossiblyCastedBaseExpression(receiver)) {
|
|
62284
|
-
receiver =
|
|
62379
|
+
receiver = thisExpression(this.ctx.ectx.type.ofExpression(receiver), receiver.sourceLocation);
|
|
62285
62380
|
}
|
|
62286
62381
|
const [, receiverTempAssignment, receiverTempAccess] = this.createCachingTemporaryVariable(
|
|
62287
62382
|
receiver,
|
|
62288
62383
|
tempVariables
|
|
62289
62384
|
);
|
|
62290
|
-
const variableGetAccess2 =
|
|
62385
|
+
const variableGetAccess2 = instanceFieldGetAccess(receiverTempAccess, left.field, false);
|
|
62291
62386
|
const binaryOperator = this.ctx.getBinaryExpressionOperatorFromAssignmentOperator(operatorKind);
|
|
62292
62387
|
const newValue = binaryExpression(this.ctx.ectx, variableGetAccess2, binaryOperator, value).withOperator(operator);
|
|
62293
62388
|
const args = new OrderedArguments([newValue], false);
|
|
@@ -62310,14 +62405,19 @@ var PlainObjectConstructorsLowering = class {
|
|
|
62310
62405
|
if (!(declaration.kind === 23 /* PackageTypeDeclaration */ && declaration.entity.typeOrExtensionKind === 0 /* StructuredType */ && declaration.entity.details.structuredTypeKind === 1 /* PlainObject */)) {
|
|
62311
62406
|
continue;
|
|
62312
62407
|
}
|
|
62313
|
-
const defaultConstructorEntity =
|
|
62408
|
+
const defaultConstructorEntity = typeMemberFunctionEntity(
|
|
62314
62409
|
2 /* Constructor */,
|
|
62315
62410
|
EmitPhaseName.ofConstructor(declaration.entity.containingPackage.locale),
|
|
62316
62411
|
[],
|
|
62317
62412
|
this.ctx.ectx.createIdentitySubstitutedType(declaration.entity),
|
|
62318
|
-
declaration.entity
|
|
62413
|
+
declaration.entity,
|
|
62414
|
+
false,
|
|
62415
|
+
[],
|
|
62416
|
+
false,
|
|
62417
|
+
false,
|
|
62418
|
+
false,
|
|
62419
|
+
void 0
|
|
62319
62420
|
);
|
|
62320
|
-
defaultConstructorEntity.ifTypeMemberThenContainingType = declaration.entity;
|
|
62321
62421
|
declaration.entity.members = Array.from([defaultConstructorEntity]).concat(declaration.entity.members);
|
|
62322
62422
|
declaration.members = declaration.members.map((member) => {
|
|
62323
62423
|
if (member.kind === 49 /* ConstructorDeclaration */) {
|
|
@@ -62332,29 +62432,22 @@ var PlainObjectConstructorsLowering = class {
|
|
|
62332
62432
|
Debug.assertNotNull(containingType);
|
|
62333
62433
|
node.entity.functionEntityKind = 0 /* RegularFunction */;
|
|
62334
62434
|
node.entity.details.isStatic = true;
|
|
62335
|
-
const newThisVariable =
|
|
62435
|
+
const newThisVariable = localVariableEntity(
|
|
62336
62436
|
EmitPhaseName.ofPlainObjectMethodNewThisVariable(node.entity.containingPackage.locale),
|
|
62337
62437
|
this.ctx.ectx.createIdentitySubstitutedType(containingType),
|
|
62338
|
-
node.entity.containingPackage
|
|
62339
|
-
|
|
62340
|
-
const initializer = new ConstructorCallExpression(
|
|
62341
|
-
defaultConstructor,
|
|
62342
|
-
containingType,
|
|
62343
|
-
new TypeAccessExpression(containingType, void 0),
|
|
62344
|
-
new OrderedArguments([], false),
|
|
62345
|
-
this.ctx.ectx.createIdentitySubstitutedType(containingType),
|
|
62346
|
-
void 0,
|
|
62347
|
-
new ConstructorCallExpressionEmitOptions().setIsPlainObjectConstructorCallLowered(true)
|
|
62438
|
+
node.entity.containingPackage,
|
|
62439
|
+
false
|
|
62348
62440
|
);
|
|
62441
|
+
const initializer = constructorCallExpression(this.ctx.ectx, defaultConstructor, []).withOptions(new ConstructorCallExpressionEmitOptions().setIsPlainObjectConstructorCallLowered(true));
|
|
62349
62442
|
const newThisVariableDeclaration = localVariableDeclarationStatement(newThisVariable, initializer);
|
|
62350
62443
|
const transformer = new Transformer({
|
|
62351
62444
|
transformThisExpression: (_) => {
|
|
62352
|
-
const variableAccess =
|
|
62445
|
+
const variableAccess = variableGetAccess(newThisVariable);
|
|
62353
62446
|
return replaceExpression(variableAccess);
|
|
62354
62447
|
},
|
|
62355
62448
|
transformReturnStatement: (returnStatement4) => {
|
|
62356
62449
|
if (transformer.transformedDeclaration === node) {
|
|
62357
|
-
returnStatement4.expression =
|
|
62450
|
+
returnStatement4.expression = variableGetAccess(newThisVariable);
|
|
62358
62451
|
}
|
|
62359
62452
|
return preserveStatement();
|
|
62360
62453
|
},
|
|
@@ -62366,18 +62459,9 @@ var PlainObjectConstructorsLowering = class {
|
|
|
62366
62459
|
}
|
|
62367
62460
|
});
|
|
62368
62461
|
transformer.transformBlockStatementChildren(node.body);
|
|
62369
|
-
const returnStatement3 = returnStatement(
|
|
62462
|
+
const returnStatement3 = returnStatement(variableGetAccess(newThisVariable));
|
|
62370
62463
|
node.body.statements = [newThisVariableDeclaration, ...node.body.statements, returnStatement3];
|
|
62371
|
-
return
|
|
62372
|
-
node.decorators,
|
|
62373
|
-
new Modifiers().makeStatic(),
|
|
62374
|
-
node.parameters,
|
|
62375
|
-
node.body,
|
|
62376
|
-
node.entity,
|
|
62377
|
-
false,
|
|
62378
|
-
void 0,
|
|
62379
|
-
void 0
|
|
62380
|
-
);
|
|
62464
|
+
return methodDeclaration(node.entity, node.parameters, node.body, false, node.sourceLocation).withDecorators(node.decorators);
|
|
62381
62465
|
}
|
|
62382
62466
|
};
|
|
62383
62467
|
var PlainObjectConstructorCallsLowering = class extends ExecutableCodeLowering {
|
|
@@ -62390,7 +62474,7 @@ var PlainObjectConstructorCallsLowering = class extends ExecutableCodeLowering {
|
|
|
62390
62474
|
}
|
|
62391
62475
|
lowerPlainObjectConstructorCall(node) {
|
|
62392
62476
|
return staticMethodCallExpression(
|
|
62393
|
-
|
|
62477
|
+
accessedFunction(node.entity, node.returnType),
|
|
62394
62478
|
node.args,
|
|
62395
62479
|
node.sourceLocation
|
|
62396
62480
|
);
|
|
@@ -62436,17 +62520,17 @@ var OverloadedConstructorsLowering = class {
|
|
|
62436
62520
|
const declarationByEntity = /* @__PURE__ */ new Map();
|
|
62437
62521
|
const loweredConstructorEntities = /* @__PURE__ */ new Set();
|
|
62438
62522
|
const notLoweredConstructorInfos = new Array();
|
|
62439
|
-
for (const
|
|
62440
|
-
declarationByEntity.set(
|
|
62441
|
-
const ownConstructorCall = this.ctx.findOwnConstructorCall(
|
|
62523
|
+
for (const constructorDeclaration2 of constructorDeclarations) {
|
|
62524
|
+
declarationByEntity.set(constructorDeclaration2.entity, constructorDeclaration2);
|
|
62525
|
+
const ownConstructorCall = this.ctx.findOwnConstructorCall(constructorDeclaration2.body);
|
|
62442
62526
|
if (ownConstructorCall !== void 0) {
|
|
62443
62527
|
notLoweredConstructorInfos.push({
|
|
62444
|
-
declaration:
|
|
62528
|
+
declaration: constructorDeclaration2,
|
|
62445
62529
|
ownConstructorCallExpression: ownConstructorCall.expression,
|
|
62446
62530
|
statementIndex: ownConstructorCall.statementIndex
|
|
62447
62531
|
});
|
|
62448
62532
|
} else {
|
|
62449
|
-
loweredConstructorEntities.add(
|
|
62533
|
+
loweredConstructorEntities.add(constructorDeclaration2.entity);
|
|
62450
62534
|
}
|
|
62451
62535
|
}
|
|
62452
62536
|
while (notLoweredConstructorInfos.length > 0) {
|
|
@@ -62486,11 +62570,11 @@ var OverloadedConstructorsLowering = class {
|
|
|
62486
62570
|
parameter.defaultValue = void 0;
|
|
62487
62571
|
const isEmptyCheck = binaryExpression(
|
|
62488
62572
|
this.ctx.ectx,
|
|
62489
|
-
|
|
62573
|
+
variableGetAccess(parameter.entity),
|
|
62490
62574
|
5 /* Equals */,
|
|
62491
62575
|
nullLiteral()
|
|
62492
62576
|
);
|
|
62493
|
-
const assignmentStatement2 = assignmentStatement(
|
|
62577
|
+
const assignmentStatement2 = assignmentStatement(variableSetAccess(parameter.entity), defaultValue);
|
|
62494
62578
|
const ifStatement3 = ifStatement(isEmptyCheck, blockStatement([assignmentStatement2]), void 0);
|
|
62495
62579
|
statements.push(ifStatement3);
|
|
62496
62580
|
}
|
|
@@ -62499,29 +62583,29 @@ var OverloadedConstructorsLowering = class {
|
|
|
62499
62583
|
mergeOverloadedConstructors(constructorDeclarations, constructorGroup) {
|
|
62500
62584
|
const constructorEntity = constructorGroup.mergedConstructor;
|
|
62501
62585
|
const constructorParameters = constructorEntity.parameters;
|
|
62502
|
-
const mergedParameters = constructorParameters.map((p) =>
|
|
62586
|
+
const mergedParameters = constructorParameters.map((p) => parameterDeclaration(p, void 0, false));
|
|
62503
62587
|
const caseClauses = [];
|
|
62504
62588
|
const constructorDeclarationByEntity = new Map(constructorDeclarations.map((c) => [c.entity, c]));
|
|
62505
62589
|
for (const constructor of constructorGroup.constructors) {
|
|
62506
|
-
const
|
|
62507
|
-
Debug.assertNotNull(
|
|
62590
|
+
const constructorDeclaration2 = constructorDeclarationByEntity.get(constructor);
|
|
62591
|
+
Debug.assertNotNull(constructorDeclaration2);
|
|
62508
62592
|
const overloadId = constructorGroup.getOverloadId(constructor);
|
|
62509
62593
|
const expression = numericLiteral(overloadId);
|
|
62510
62594
|
const parameterDeclarations = Query.zip(
|
|
62511
62595
|
constructor.parameters,
|
|
62512
62596
|
constructorGroup.mergedConstructor.parameters.slice(1),
|
|
62513
|
-
(original, merged) => localVariableDeclarationStatement(original,
|
|
62597
|
+
(original, merged) => localVariableDeclarationStatement(original, variableGetAccess(merged)).withOptions(new DeclarationWithInitializerEmitOptions(false))
|
|
62514
62598
|
).toArray();
|
|
62515
|
-
const body =
|
|
62516
|
-
const bodyStatements = parameterDeclarations.concat(
|
|
62599
|
+
const body = constructorDeclaration2.body;
|
|
62600
|
+
const bodyStatements = parameterDeclarations.concat(constructorDeclaration2.body.statements);
|
|
62517
62601
|
body.statements = bodyStatements;
|
|
62518
62602
|
caseClauses.push(caseClause([expression], body));
|
|
62519
62603
|
}
|
|
62520
|
-
const overloadIdAccess =
|
|
62521
|
-
const defaultClauseBody = blockStatement([errorStatement(
|
|
62604
|
+
const overloadIdAccess = variableGetAccess(constructorParameters[0]);
|
|
62605
|
+
const defaultClauseBody = blockStatement([errorStatement(textLiteral(""))]);
|
|
62522
62606
|
const switchStatement3 = switchStatement(overloadIdAccess, caseClauses, defaultClauseBody);
|
|
62523
62607
|
const constructorBody = blockStatement([switchStatement3]);
|
|
62524
|
-
return
|
|
62608
|
+
return constructorDeclaration(constructorEntity, mergedParameters, constructorBody);
|
|
62525
62609
|
}
|
|
62526
62610
|
inlineCalledConstructorBody(declaration, callExpression3, statementIndex, calledConstructorDeclaration) {
|
|
62527
62611
|
const parameterAssignments = Query.zip(
|
|
@@ -62536,8 +62620,8 @@ var OverloadedConstructorsLowering = class {
|
|
|
62536
62620
|
}
|
|
62537
62621
|
};
|
|
62538
62622
|
var OverloadedConstructorCallsLowering = class extends ExecutableCodeLowering {
|
|
62539
|
-
constructor(ctx,
|
|
62540
|
-
super(ctx,
|
|
62623
|
+
constructor(ctx, packageEntity2, overloadedConstructorGroupByOriginalConstructor) {
|
|
62624
|
+
super(ctx, packageEntity2);
|
|
62541
62625
|
this.overloadedConstructorGroupByOriginalConstructor = overloadedConstructorGroupByOriginalConstructor;
|
|
62542
62626
|
}
|
|
62543
62627
|
tryLowerConstructorCallExpression(node) {
|
|
@@ -62583,30 +62667,37 @@ var OverloadedConstructorGroup = class {
|
|
|
62583
62667
|
createMergedConstructor() {
|
|
62584
62668
|
const locale = this.containingType.containingPackage.locale;
|
|
62585
62669
|
const idParameterName = EmitPhaseName.ofMergedConstructorIdParameter(locale);
|
|
62586
|
-
const idParameterEntity =
|
|
62670
|
+
const idParameterEntity = parameterEntity(
|
|
62587
62671
|
idParameterName,
|
|
62588
62672
|
this.ectx.standardTypes.integer,
|
|
62589
|
-
this.containingType.containingPackage
|
|
62673
|
+
this.containingType.containingPackage,
|
|
62674
|
+
false
|
|
62590
62675
|
);
|
|
62591
62676
|
const mergedParameters = [idParameterEntity];
|
|
62592
62677
|
const parameterCount = Query.maxByValue(this.constructors, (c) => c.parameters.length)?.parameters.length ?? 0;
|
|
62593
62678
|
for (let id = 0; id < parameterCount; id++) {
|
|
62594
62679
|
const parameterName = EmitPhaseName.ofMergedConstructorParameter(locale, id);
|
|
62595
|
-
const parameter =
|
|
62680
|
+
const parameter = parameterEntity(
|
|
62596
62681
|
parameterName,
|
|
62597
62682
|
this.ectx.standardTypes.refObject,
|
|
62598
|
-
this.containingType.containingPackage
|
|
62683
|
+
this.containingType.containingPackage,
|
|
62684
|
+
false
|
|
62599
62685
|
);
|
|
62600
62686
|
mergedParameters.push(parameter);
|
|
62601
62687
|
}
|
|
62602
|
-
const result =
|
|
62688
|
+
const result = typeMemberFunctionEntity(
|
|
62603
62689
|
2 /* Constructor */,
|
|
62604
62690
|
EmitPhaseName.ofConstructor(locale),
|
|
62605
62691
|
mergedParameters,
|
|
62606
62692
|
this.ectx.createIdentitySubstitutedType(this.containingType),
|
|
62607
|
-
this.containingType
|
|
62693
|
+
this.containingType,
|
|
62694
|
+
false,
|
|
62695
|
+
[],
|
|
62696
|
+
false,
|
|
62697
|
+
false,
|
|
62698
|
+
false,
|
|
62699
|
+
void 0
|
|
62608
62700
|
);
|
|
62609
|
-
result.ifTypeMemberThenContainingType = this.containingType;
|
|
62610
62701
|
return result;
|
|
62611
62702
|
}
|
|
62612
62703
|
};
|
|
@@ -62666,9 +62757,9 @@ var MiscLowering = class {
|
|
|
62666
62757
|
}
|
|
62667
62758
|
sourcePackageEntities.add(pkgIr.entity);
|
|
62668
62759
|
}
|
|
62669
|
-
for (const
|
|
62670
|
-
if (!sourcePackageEntities.has(
|
|
62671
|
-
for (const packageMember of
|
|
62760
|
+
for (const packageEntity2 of ctx.ectx.entityMap.enumerateAllPackageEntities()) {
|
|
62761
|
+
if (!sourcePackageEntities.has(packageEntity2)) {
|
|
62762
|
+
for (const packageMember of packageEntity2.members) {
|
|
62672
62763
|
if (packageMember.kind === "type-or-extension") {
|
|
62673
62764
|
this.resolveComputedNamesOfTypeMembers(packageMember);
|
|
62674
62765
|
}
|
|
@@ -62678,43 +62769,34 @@ var MiscLowering = class {
|
|
|
62678
62769
|
}
|
|
62679
62770
|
static createThisPackageVariables(ctx) {
|
|
62680
62771
|
for (const pkg2 of ctx.packages) {
|
|
62681
|
-
const
|
|
62682
|
-
const variableEntity =
|
|
62683
|
-
EmitPhaseName.ofThisPackageVariable(
|
|
62772
|
+
const packageEntity2 = pkg2.ir.entity;
|
|
62773
|
+
const variableEntity = packageVariableEntity(
|
|
62774
|
+
EmitPhaseName.ofThisPackageVariable(packageEntity2.locale),
|
|
62684
62775
|
ctx.ectx.createIdentitySubstitutedType(ctx.packageType),
|
|
62685
|
-
|
|
62776
|
+
packageEntity2,
|
|
62777
|
+
true
|
|
62686
62778
|
);
|
|
62687
|
-
|
|
62688
|
-
|
|
62689
|
-
packageEntity.details.thisPackageVariableEntity = variableEntity;
|
|
62779
|
+
packageEntity2.members = packageEntity2.members.concat(variableEntity);
|
|
62780
|
+
packageEntity2.details.thisPackageVariableEntity = variableEntity;
|
|
62690
62781
|
const variableDeclaration2 = packageVariableDeclaration(variableEntity, void 0);
|
|
62691
62782
|
const packageMembers = Array.from(pkg2.ir.declarations);
|
|
62692
62783
|
packageMembers.unshift(variableDeclaration2);
|
|
62693
62784
|
pkg2.ir.declarations = packageMembers;
|
|
62694
|
-
const packageConstructorCall =
|
|
62785
|
+
const packageConstructorCall = constructorCallExpression(
|
|
62786
|
+
ctx.ectx,
|
|
62695
62787
|
ctx.packageConstructor,
|
|
62696
|
-
|
|
62697
|
-
new TypeAccessExpression(ctx.packageType, void 0),
|
|
62698
|
-
new OrderedArguments([new TextLiteral2(packageEntity.name, void 0)], false, void 0),
|
|
62699
|
-
variableEntity.type,
|
|
62700
|
-
void 0
|
|
62788
|
+
[textLiteral(packageEntity2.name)]
|
|
62701
62789
|
);
|
|
62702
62790
|
const thisPackageVariableAssignment = assignmentStatement(
|
|
62703
|
-
|
|
62791
|
+
variableGetAccess(variableEntity),
|
|
62704
62792
|
packageConstructorCall
|
|
62705
62793
|
);
|
|
62706
62794
|
const statements = [thisPackageVariableAssignment];
|
|
62707
|
-
if (
|
|
62708
|
-
const mainPackageFieldAccess =
|
|
62709
|
-
new TypeAccessExpression(ctx.packageType, void 0),
|
|
62710
|
-
false,
|
|
62711
|
-
ctx.packageMainPackageField,
|
|
62712
|
-
void 0,
|
|
62713
|
-
void 0
|
|
62714
|
-
);
|
|
62795
|
+
if (packageEntity2.details.isMainPackage) {
|
|
62796
|
+
const mainPackageFieldAccess = staticFieldGetAccess(ctx.packageMainPackageField);
|
|
62715
62797
|
const mainPackageFieldAssignment = assignmentStatement(
|
|
62716
62798
|
mainPackageFieldAccess,
|
|
62717
|
-
|
|
62799
|
+
variableGetAccess(variableEntity)
|
|
62718
62800
|
);
|
|
62719
62801
|
statements.push(mainPackageFieldAssignment);
|
|
62720
62802
|
}
|
|
@@ -62748,10 +62830,10 @@ var MiscLowering = class {
|
|
|
62748
62830
|
}
|
|
62749
62831
|
};
|
|
62750
62832
|
var CompoundDeclarationsAndOperatorsAccessLowering = class extends ExecutableCodeLowering {
|
|
62751
|
-
constructor(ctx,
|
|
62752
|
-
super(ctx,
|
|
62753
|
-
this.indexedAccessExpressionLowering = new IndexedAccessExpressionLowering(ctx,
|
|
62754
|
-
this.dereferenceExpressionLowering = new DereferenceExpressionLowering(ctx,
|
|
62833
|
+
constructor(ctx, packageEntity2) {
|
|
62834
|
+
super(ctx, packageEntity2);
|
|
62835
|
+
this.indexedAccessExpressionLowering = new IndexedAccessExpressionLowering(ctx, packageEntity2);
|
|
62836
|
+
this.dereferenceExpressionLowering = new DereferenceExpressionLowering(ctx, packageEntity2);
|
|
62755
62837
|
}
|
|
62756
62838
|
tryLowerIndexedAccessExpression(node) {
|
|
62757
62839
|
if (node.access.kind === 0 /* Get */ && node.access.getAccessor.entity.containingPackage.details.isSource) {
|
|
@@ -62800,26 +62882,26 @@ var CompoundDeclarationsAndOperatorsAccessLowering = class extends ExecutableCod
|
|
|
62800
62882
|
lowerComputedPackageVariableGetAccessExpression(node) {
|
|
62801
62883
|
const getter = node.variable.entity.getter;
|
|
62802
62884
|
Debug.assertNotNull(getter);
|
|
62803
|
-
return functionCallExpression(
|
|
62885
|
+
return functionCallExpression(accessedFunction(getter, node.variable.type), []);
|
|
62804
62886
|
}
|
|
62805
62887
|
lowerComputedPackageVariableSetAccessExpression(left, operatorKind, right, operator, sourceLocation) {
|
|
62806
62888
|
let value;
|
|
62807
62889
|
if (operatorKind === 0 /* Equals */) {
|
|
62808
62890
|
value = right;
|
|
62809
62891
|
} else {
|
|
62810
|
-
const variableGetAccess2 =
|
|
62892
|
+
const variableGetAccess2 = variableGetAccess(left.variable);
|
|
62811
62893
|
const binaryOperator = this.ctx.getBinaryExpressionOperatorFromAssignmentOperator(operatorKind);
|
|
62812
62894
|
value = binaryExpression(this.ctx.ectx, variableGetAccess2, binaryOperator, right).withOperator(operator);
|
|
62813
62895
|
}
|
|
62814
62896
|
const setter = left.variable.entity.setter;
|
|
62815
62897
|
Debug.assertNotNull(setter);
|
|
62816
|
-
const callExpression3 = functionCallExpression(
|
|
62898
|
+
const callExpression3 = functionCallExpression(accessedFunction(setter, left.variable.type), [value]);
|
|
62817
62899
|
return expressionStatement(callExpression3, sourceLocation);
|
|
62818
62900
|
}
|
|
62819
62901
|
};
|
|
62820
62902
|
var IndexedAccessExpressionLowering = class extends ExecutableCodeLowering {
|
|
62821
|
-
constructor(ctx,
|
|
62822
|
-
super(ctx,
|
|
62903
|
+
constructor(ctx, packageEntity2) {
|
|
62904
|
+
super(ctx, packageEntity2);
|
|
62823
62905
|
}
|
|
62824
62906
|
/**
|
|
62825
62907
|
* @example Понижающее преобразование команды чтения
|
|
@@ -62915,8 +62997,8 @@ var IndexedAccessExpressionLowering = class extends ExecutableCodeLowering {
|
|
|
62915
62997
|
}
|
|
62916
62998
|
};
|
|
62917
62999
|
var DereferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
62918
|
-
constructor(ctx,
|
|
62919
|
-
super(ctx,
|
|
63000
|
+
constructor(ctx, packageEntity2) {
|
|
63001
|
+
super(ctx, packageEntity2);
|
|
62920
63002
|
}
|
|
62921
63003
|
/**
|
|
62922
63004
|
* @example Понижающее преобразование команды чтения
|
|
@@ -63000,8 +63082,8 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
|
63000
63082
|
static {
|
|
63001
63083
|
this.ContextFieldName = "_0";
|
|
63002
63084
|
}
|
|
63003
|
-
constructor(ctx,
|
|
63004
|
-
super(ctx,
|
|
63085
|
+
constructor(ctx, packageEntity2) {
|
|
63086
|
+
super(ctx, packageEntity2);
|
|
63005
63087
|
}
|
|
63006
63088
|
tryLowerFunctionAccessExpression(node) {
|
|
63007
63089
|
if (!node.isCallee && node.options.bindIfNotCallee) {
|
|
@@ -63040,20 +63122,21 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
|
63040
63122
|
} else {
|
|
63041
63123
|
receiverTempGetAccess = receiverIfBaseExpression;
|
|
63042
63124
|
}
|
|
63043
|
-
const argsParameter =
|
|
63125
|
+
const argsParameter = parameterEntity(
|
|
63044
63126
|
"args",
|
|
63045
63127
|
this.ctx.ectx.standardTypes.refObject,
|
|
63046
|
-
node.method.entity.containingPackage
|
|
63128
|
+
node.method.entity.containingPackage,
|
|
63129
|
+
false
|
|
63047
63130
|
);
|
|
63048
63131
|
argsParameter.details.isVariadicParameter = true;
|
|
63049
63132
|
const methodCall = instanceMethodCallExpression(
|
|
63050
63133
|
receiverTempGetAccess,
|
|
63051
63134
|
node.method,
|
|
63052
|
-
orderedArguments([
|
|
63135
|
+
orderedArguments([variableGetAccess(argsParameter)], true),
|
|
63053
63136
|
false
|
|
63054
63137
|
);
|
|
63055
63138
|
const returnStatement3 = returnStatement(methodCall);
|
|
63056
|
-
const parameter =
|
|
63139
|
+
const parameter = parameterDeclaration(argsParameter, void 0, true);
|
|
63057
63140
|
const functionLiteral2 = functionLiteral(
|
|
63058
63141
|
[parameter],
|
|
63059
63142
|
blockStatement([returnStatement3]),
|
|
@@ -63073,7 +63156,7 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
|
63073
63156
|
if (receiverIfBaseExpression === void 0) {
|
|
63074
63157
|
context = receiverTempGetAccess;
|
|
63075
63158
|
} else {
|
|
63076
|
-
context =
|
|
63159
|
+
context = thisExpression(this.ctx.ectx.type.ofExpression(receiverIfBaseExpression));
|
|
63077
63160
|
}
|
|
63078
63161
|
contextFieldAssignment = assignmentExpression(contextFieldSetAccess, context);
|
|
63079
63162
|
}
|
|
@@ -63095,18 +63178,12 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
|
63095
63178
|
}
|
|
63096
63179
|
expressions.push(boundMethodTempGetAccess);
|
|
63097
63180
|
const secondExpression = commaExpression(expressions);
|
|
63098
|
-
const
|
|
63099
|
-
nullCheck,
|
|
63100
|
-
firstExpression,
|
|
63101
|
-
secondExpression,
|
|
63102
|
-
this.ctx.ectx.type.ofExpression(node),
|
|
63103
|
-
void 0
|
|
63104
|
-
);
|
|
63181
|
+
const ternaryExpression2 = ternaryExpression(nullCheck, firstExpression, secondExpression);
|
|
63105
63182
|
const resultExpressions = new Array();
|
|
63106
63183
|
if (receiverTempAssignment !== void 0) {
|
|
63107
63184
|
resultExpressions.push(receiverTempAssignment);
|
|
63108
63185
|
}
|
|
63109
|
-
resultExpressions.push(
|
|
63186
|
+
resultExpressions.push(ternaryExpression2);
|
|
63110
63187
|
resultExpression = commaExpression(resultExpressions, node.sourceLocation);
|
|
63111
63188
|
} else {
|
|
63112
63189
|
const resultExpressions = new Array();
|
|
@@ -63147,34 +63224,25 @@ var VariableProxyLowering = class {
|
|
|
63147
63224
|
for (const member of declaration.members) {
|
|
63148
63225
|
if (member.kind === 54 /* FieldDeclaration */ && member.entity.details.isProxiedField !== void 0) {
|
|
63149
63226
|
const proxiedFieldInfo = member.entity.details.isProxiedField;
|
|
63150
|
-
const proxyVariableEntity =
|
|
63227
|
+
const proxyVariableEntity = fieldEntity(
|
|
63151
63228
|
EmitPhaseName.ofProxyVariable(member.entity.containingPackage.locale, member.entity.name),
|
|
63152
63229
|
this.ctx.ectx.createIdentitySubstitutedType(proxiedFieldInfo.tagType),
|
|
63153
|
-
|
|
63230
|
+
declaration.entity,
|
|
63231
|
+
[],
|
|
63232
|
+
false,
|
|
63233
|
+
false,
|
|
63234
|
+
member.entity.details.isStatic,
|
|
63235
|
+
member.entity.details.isConst,
|
|
63236
|
+
void 0
|
|
63154
63237
|
);
|
|
63155
|
-
proxyVariableEntity.ifTypeMemberThenContainingType = declaration.entity;
|
|
63156
63238
|
let args;
|
|
63157
63239
|
if (member.initializer !== void 0) {
|
|
63158
|
-
args =
|
|
63240
|
+
args = [member.initializer];
|
|
63159
63241
|
} else {
|
|
63160
|
-
args =
|
|
63242
|
+
args = [];
|
|
63161
63243
|
}
|
|
63162
|
-
const initializer =
|
|
63163
|
-
|
|
63164
|
-
proxiedFieldInfo.tagType,
|
|
63165
|
-
new TypeAccessExpression(proxiedFieldInfo.tagType, void 0),
|
|
63166
|
-
args,
|
|
63167
|
-
proxyVariableEntity.type,
|
|
63168
|
-
void 0
|
|
63169
|
-
);
|
|
63170
|
-
const proxyVariableDeclaration = new FieldDeclaration2(
|
|
63171
|
-
[],
|
|
63172
|
-
member.modifiers,
|
|
63173
|
-
initializer,
|
|
63174
|
-
proxyVariableEntity,
|
|
63175
|
-
void 0,
|
|
63176
|
-
void 0
|
|
63177
|
-
);
|
|
63244
|
+
const initializer = constructorCallExpression(this.ctx.ectx, proxiedFieldInfo.constructor, args);
|
|
63245
|
+
const proxyVariableDeclaration = fieldDeclaration(proxyVariableEntity, initializer);
|
|
63178
63246
|
proxyVariableDeclarations.push(proxyVariableDeclaration);
|
|
63179
63247
|
proxyVariableByOriginal.set(member.entity, proxyVariableEntity);
|
|
63180
63248
|
}
|
|
@@ -63492,7 +63560,7 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
63492
63560
|
statement.indexVariableEntity,
|
|
63493
63561
|
indexVariableInitializer
|
|
63494
63562
|
);
|
|
63495
|
-
const indexVariableAccess =
|
|
63563
|
+
const indexVariableAccess = variableSetAccess(statement.indexVariableEntity);
|
|
63496
63564
|
const oneLiteral = numericLiteral(1);
|
|
63497
63565
|
const indexVariableIncrement = assignmentStatementWithOperatorKind(
|
|
63498
63566
|
indexVariableAccess,
|
|
@@ -63514,15 +63582,7 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
63514
63582
|
Debug.assertNotNull(enumeratorMethod);
|
|
63515
63583
|
node.options.addExplicitCallOfEnumeratorMethodIfRequired = false;
|
|
63516
63584
|
const iteratorField = this.ctx.iteratorSymbolField;
|
|
63517
|
-
|
|
63518
|
-
const key = new FieldAccessExpression(
|
|
63519
|
-
new TypeAccessExpression(iteratorField.ifTypeMemberThenContainingType, void 0),
|
|
63520
|
-
false,
|
|
63521
|
-
AccessedVariable.fromEntity(iteratorField),
|
|
63522
|
-
0 /* Get */,
|
|
63523
|
-
void 0,
|
|
63524
|
-
void 0
|
|
63525
|
-
);
|
|
63585
|
+
const key = staticFieldGetAccess(iteratorField);
|
|
63526
63586
|
const enumeratorMethodCall = instanceMethodCallExpression(
|
|
63527
63587
|
node.enumeratedExpression,
|
|
63528
63588
|
enumeratorMethod,
|
|
@@ -63537,10 +63597,7 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
63537
63597
|
return this.createTextTemplateConstructorCall(node.textFragments, node.expressions, node.sourceLocation);
|
|
63538
63598
|
}
|
|
63539
63599
|
lowerLocalizableTextLiteral(node) {
|
|
63540
|
-
const translateMethodArgs = [
|
|
63541
|
-
staticFieldGetAccess(this.ctx.packageThisPackageField),
|
|
63542
|
-
new TextLiteral2(node.value, void 0)
|
|
63543
|
-
];
|
|
63600
|
+
const translateMethodArgs = [staticFieldGetAccess(this.ctx.packageThisPackageField), textLiteral(node.value)];
|
|
63544
63601
|
if (node.code !== void 0) {
|
|
63545
63602
|
translateMethodArgs.push(numericLiteral(node.code));
|
|
63546
63603
|
}
|
|
@@ -63568,16 +63625,12 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
63568
63625
|
return result;
|
|
63569
63626
|
}
|
|
63570
63627
|
createTextTemplateConstructorCall(textFragments, expressions, sourceLocation) {
|
|
63571
|
-
const textFragmentsArray = arrayLiteral(this.ctx.ectx, textFragments.map((s) =>
|
|
63628
|
+
const textFragmentsArray = arrayLiteral(this.ctx.ectx, textFragments.map((s) => textLiteral(s)));
|
|
63572
63629
|
const expressionArray = arrayLiteral(this.ctx.ectx, expressions);
|
|
63573
|
-
const
|
|
63574
|
-
|
|
63575
|
-
const constructorCall = new ConstructorCallExpression(
|
|
63630
|
+
const constructorCall = constructorCallExpression(
|
|
63631
|
+
this.ctx.ectx,
|
|
63576
63632
|
this.ctx.textTemplateConstructor,
|
|
63577
|
-
|
|
63578
|
-
typeAccess,
|
|
63579
|
-
args,
|
|
63580
|
-
this.ctx.ectx.standardTypes.textTemplate,
|
|
63633
|
+
[textFragmentsArray, expressionArray],
|
|
63581
63634
|
sourceLocation
|
|
63582
63635
|
);
|
|
63583
63636
|
return constructorCall;
|
|
@@ -63598,14 +63651,14 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
63598
63651
|
const containingType = node.field.entity.ifTypeMemberThenContainingType;
|
|
63599
63652
|
Debug.assertNotNull(containingType);
|
|
63600
63653
|
if (!(node.expression.kind === 65 /* TypeAccessExpression */ && node.expression.entity === containingType)) {
|
|
63601
|
-
node.expression =
|
|
63654
|
+
node.expression = typeAccessExpression(containingType);
|
|
63602
63655
|
}
|
|
63603
63656
|
}
|
|
63604
63657
|
lowerStaticAliasTypeMethodAccess(node) {
|
|
63605
63658
|
const containingType = node.method.entity.ifTypeMemberThenContainingType;
|
|
63606
63659
|
Debug.assertNotNull(containingType);
|
|
63607
63660
|
if (!(node.expression.kind === 65 /* TypeAccessExpression */ && node.expression.entity === containingType)) {
|
|
63608
|
-
node.expression =
|
|
63661
|
+
node.expression = typeAccessExpression(containingType);
|
|
63609
63662
|
}
|
|
63610
63663
|
}
|
|
63611
63664
|
lowerErrorStatement(node) {
|
|
@@ -63654,7 +63707,7 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
|
63654
63707
|
thisPackageVariable,
|
|
63655
63708
|
"\u041F\u043E\u043B\u0435 packageEntity.details.thisPackageVariableEntity \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u043D\u0430 \u044D\u0442\u0430\u043F\u0435 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u0441\u0432\u043E\u0439-\u043F\u0430\u043A\u0435\u0442."
|
|
63656
63709
|
);
|
|
63657
|
-
return replaceExpression(
|
|
63710
|
+
return replaceExpression(variableGetAccess(thisPackageVariable));
|
|
63658
63711
|
}
|
|
63659
63712
|
};
|
|
63660
63713
|
var OperatorsUsageLowering = class extends ExecutableCodeLowering {
|
|
@@ -63711,23 +63764,19 @@ var OperatorsUsageLowering = class extends ExecutableCodeLowering {
|
|
|
63711
63764
|
switch (left.kind) {
|
|
63712
63765
|
case 66 /* VariableAccessExpression */:
|
|
63713
63766
|
leftExpressionSetAccess = left;
|
|
63714
|
-
leftExpressionGetAccess =
|
|
63767
|
+
leftExpressionGetAccess = variableGetAccess(left.variable);
|
|
63715
63768
|
break;
|
|
63716
63769
|
case 70 /* FieldAccessExpression */: {
|
|
63717
63770
|
const [, receiverTempAssignment, receiverTempGetAccess] = this.createCachingTemporaryVariable(
|
|
63718
63771
|
left.expression,
|
|
63719
63772
|
tempVariables
|
|
63720
63773
|
);
|
|
63721
|
-
leftExpressionSetAccess =
|
|
63774
|
+
leftExpressionSetAccess = instanceFieldSetAccess(
|
|
63722
63775
|
receiverTempAssignment ?? receiverTempGetAccess,
|
|
63723
|
-
|
|
63724
|
-
|
|
63725
|
-
);
|
|
63726
|
-
leftExpressionGetAccess = FieldAccessExpression.get(
|
|
63727
|
-
receiverTempGetAccess,
|
|
63728
|
-
false,
|
|
63729
|
-
left.field
|
|
63776
|
+
left.field,
|
|
63777
|
+
false
|
|
63730
63778
|
);
|
|
63779
|
+
leftExpressionGetAccess = instanceFieldGetAccess(receiverTempGetAccess, left.field, false);
|
|
63731
63780
|
break;
|
|
63732
63781
|
}
|
|
63733
63782
|
case 85 /* JsPropertyAccessExpression */: {
|
|
@@ -63772,7 +63821,7 @@ var OperatorsUsageLowering = class extends ExecutableCodeLowering {
|
|
|
63772
63821
|
}
|
|
63773
63822
|
case 59 /* ThisExpression */: {
|
|
63774
63823
|
leftExpressionSetAccess = left;
|
|
63775
|
-
leftExpressionGetAccess =
|
|
63824
|
+
leftExpressionGetAccess = thisExpression(left.type);
|
|
63776
63825
|
break;
|
|
63777
63826
|
}
|
|
63778
63827
|
case 29 /* IndexedAccessExpression */: {
|
|
@@ -63819,8 +63868,8 @@ var OperatorsUsageLowering = class extends ExecutableCodeLowering {
|
|
|
63819
63868
|
}
|
|
63820
63869
|
};
|
|
63821
63870
|
var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
63822
|
-
constructor(ctx,
|
|
63823
|
-
super(ctx,
|
|
63871
|
+
constructor(ctx, packageEntity2, proxyVariableByOriginal) {
|
|
63872
|
+
super(ctx, packageEntity2);
|
|
63824
63873
|
this.proxyVariableByOriginal = proxyVariableByOriginal;
|
|
63825
63874
|
}
|
|
63826
63875
|
tryLowerFieldAccessExpression(node) {
|
|
@@ -63915,8 +63964,8 @@ var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
|
63915
63964
|
}
|
|
63916
63965
|
};
|
|
63917
63966
|
var ReferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
63918
|
-
constructor(ctx,
|
|
63919
|
-
super(ctx,
|
|
63967
|
+
constructor(ctx, packageEntity2) {
|
|
63968
|
+
super(ctx, packageEntity2);
|
|
63920
63969
|
}
|
|
63921
63970
|
lower(node) {
|
|
63922
63971
|
const referencedExpression = node.expression;
|
|
@@ -63968,32 +64017,32 @@ var ReferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
|
63968
64017
|
return { expression: commaExpression2, tempVariables };
|
|
63969
64018
|
}
|
|
63970
64019
|
lowerVariableAccessExpressionReference(referencedExpression, sourceLocation) {
|
|
63971
|
-
const variableGetAccess2 =
|
|
64020
|
+
const variableGetAccess2 = variableGetAccess(referencedExpression.variable);
|
|
63972
64021
|
const reader = this.createReaderMethod(variableGetAccess2);
|
|
63973
64022
|
let writer;
|
|
63974
64023
|
if (referencedExpression.accessKind === 2 /* GetSet */) {
|
|
63975
|
-
const
|
|
63976
|
-
writer = this.createWriterMethod(
|
|
64024
|
+
const variableSetAccess2 = variableSetAccess(referencedExpression.variable);
|
|
64025
|
+
writer = this.createWriterMethod(variableSetAccess2);
|
|
63977
64026
|
}
|
|
63978
64027
|
return this.createReference(reader, writer, sourceLocation);
|
|
63979
64028
|
}
|
|
63980
64029
|
lowerFieldAccessExpressionReference(referencedExpression, sourceLocation) {
|
|
63981
64030
|
const tempVariables = new Array();
|
|
63982
64031
|
const [, receiverAssignment, receiverGetAccess] = this.createCachingTemporaryVariable(referencedExpression.expression, tempVariables);
|
|
63983
|
-
const variableGetAccess2 =
|
|
64032
|
+
const variableGetAccess2 = instanceFieldGetAccess(
|
|
63984
64033
|
receiverGetAccess,
|
|
63985
|
-
referencedExpression.
|
|
63986
|
-
referencedExpression.
|
|
64034
|
+
referencedExpression.field,
|
|
64035
|
+
referencedExpression.isOptionalAccess
|
|
63987
64036
|
);
|
|
63988
64037
|
const reader = this.createReaderMethod(variableGetAccess2);
|
|
63989
64038
|
let writer;
|
|
63990
64039
|
if (referencedExpression.accessKind === 2 /* GetSet */) {
|
|
63991
|
-
const
|
|
64040
|
+
const variableSetAccess2 = instanceFieldSetAccess(
|
|
63992
64041
|
receiverGetAccess,
|
|
63993
|
-
referencedExpression.
|
|
63994
|
-
referencedExpression.
|
|
64042
|
+
referencedExpression.field,
|
|
64043
|
+
referencedExpression.isOptionalAccess
|
|
63995
64044
|
);
|
|
63996
|
-
writer = this.createWriterMethod(
|
|
64045
|
+
writer = this.createWriterMethod(variableSetAccess2);
|
|
63997
64046
|
}
|
|
63998
64047
|
const reference = this.createReference(reader, writer, sourceLocation);
|
|
63999
64048
|
const expressions = new Array();
|
|
@@ -64010,13 +64059,14 @@ var ReferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
|
64010
64059
|
return this.createSingleStatementFunctionLiteral([], returnStatement3, returnType);
|
|
64011
64060
|
}
|
|
64012
64061
|
createWriterMethod(setExpression) {
|
|
64013
|
-
const valueEntity =
|
|
64062
|
+
const valueEntity = parameterEntity(
|
|
64014
64063
|
"value",
|
|
64015
64064
|
this.ctx.ectx.type.ofExpression(setExpression),
|
|
64016
|
-
this.packageEntity
|
|
64065
|
+
this.packageEntity,
|
|
64066
|
+
false
|
|
64017
64067
|
);
|
|
64018
|
-
const parameter =
|
|
64019
|
-
const valueGetAccess =
|
|
64068
|
+
const parameter = parameterDeclaration(valueEntity, void 0, false);
|
|
64069
|
+
const valueGetAccess = variableGetAccess(valueEntity);
|
|
64020
64070
|
const assignment = assignmentStatement(setExpression, valueGetAccess);
|
|
64021
64071
|
return this.createSingleStatementFunctionLiteral([parameter], assignment, this.ctx.ectx.standardTypes.nullType);
|
|
64022
64072
|
}
|
|
@@ -64048,7 +64098,7 @@ var VariableInitializersLowering = class {
|
|
|
64048
64098
|
if (declaration.kind === 24 /* PackageVariableDeclaration */) {
|
|
64049
64099
|
if (declaration.initializer !== void 0 && !declaration.options.shouldNotMoveInitializerToConstructor) {
|
|
64050
64100
|
const assignment = assignmentStatement(
|
|
64051
|
-
|
|
64101
|
+
variableSetAccess(declaration.entity),
|
|
64052
64102
|
declaration.initializer
|
|
64053
64103
|
);
|
|
64054
64104
|
statements.push(assignment);
|
|
@@ -64058,12 +64108,7 @@ var VariableInitializersLowering = class {
|
|
|
64058
64108
|
if (declaration.entity.typeOrExtensionKind === 0 /* StructuredType */ || declaration.entity.typeOrExtensionKind === 1 /* AliasType */ || declaration.entity.typeOrExtensionKind === 5 /* TypeExtension */) {
|
|
64059
64109
|
for (const member of declaration.members) {
|
|
64060
64110
|
if (member.kind === 54 /* FieldDeclaration */ && member.initializer !== void 0 && member.entity.details.isStatic) {
|
|
64061
|
-
const variableAccess =
|
|
64062
|
-
new TypeAccessExpression(declaration.entity, void 0),
|
|
64063
|
-
false,
|
|
64064
|
-
member.entity,
|
|
64065
|
-
void 0
|
|
64066
|
-
);
|
|
64111
|
+
const variableAccess = staticFieldSetAccess(member.entity);
|
|
64067
64112
|
const assignment = assignmentStatement(variableAccess, member.initializer);
|
|
64068
64113
|
statements.push(assignment);
|
|
64069
64114
|
member.initializer = void 0;
|
|
@@ -64084,11 +64129,10 @@ var VariableInitializersLowering = class {
|
|
|
64084
64129
|
const statements = new Array();
|
|
64085
64130
|
for (const member of declaration.members) {
|
|
64086
64131
|
if (member.kind === 54 /* FieldDeclaration */ && member.initializer !== void 0 && !member.entity.details.isStatic) {
|
|
64087
|
-
const variableAccess =
|
|
64088
|
-
|
|
64089
|
-
false,
|
|
64132
|
+
const variableAccess = instanceFieldSetAccess(
|
|
64133
|
+
thisExpression(this.ctx.ectx.createIdentitySubstitutedType(declaration.entity)),
|
|
64090
64134
|
member.entity,
|
|
64091
|
-
|
|
64135
|
+
false
|
|
64092
64136
|
);
|
|
64093
64137
|
const assignment = assignmentStatement(variableAccess, member.initializer);
|
|
64094
64138
|
statements.push(assignment);
|
|
@@ -64102,26 +64146,26 @@ var VariableInitializersLowering = class {
|
|
|
64102
64146
|
return;
|
|
64103
64147
|
}
|
|
64104
64148
|
for (let i = 0; i < constructorDeclarations.length; i++) {
|
|
64105
|
-
const
|
|
64106
|
-
const baseConstructorCallInfo = this.ctx.findBaseConstructorCall(
|
|
64149
|
+
const constructorDeclaration2 = constructorDeclarations[i];
|
|
64150
|
+
const baseConstructorCallInfo = this.ctx.findBaseConstructorCall(constructorDeclaration2.body);
|
|
64107
64151
|
let index = 0;
|
|
64108
64152
|
if (baseConstructorCallInfo !== void 0) {
|
|
64109
64153
|
index = baseConstructorCallInfo.statementIndex + 1;
|
|
64110
64154
|
}
|
|
64111
|
-
const newBodyStatements = Array.from(
|
|
64155
|
+
const newBodyStatements = Array.from(constructorDeclaration2.body.statements);
|
|
64112
64156
|
if (i > 0) {
|
|
64113
64157
|
newBodyStatements.splice(index, 0, ...statements.map((s) => s.clone()));
|
|
64114
64158
|
} else {
|
|
64115
64159
|
newBodyStatements.splice(index, 0, ...statements);
|
|
64116
64160
|
}
|
|
64117
|
-
|
|
64161
|
+
constructorDeclaration2.body.statements = newBodyStatements;
|
|
64118
64162
|
}
|
|
64119
64163
|
}
|
|
64120
64164
|
}
|
|
64121
64165
|
};
|
|
64122
64166
|
var IsExpressionLowering = class extends ExecutableCodeLowering {
|
|
64123
|
-
constructor(ctx,
|
|
64124
|
-
super(ctx,
|
|
64167
|
+
constructor(ctx, packageEntity2) {
|
|
64168
|
+
super(ctx, packageEntity2);
|
|
64125
64169
|
}
|
|
64126
64170
|
lower(expression) {
|
|
64127
64171
|
let type = expression.type;
|
|
@@ -64205,13 +64249,13 @@ var IsExpressionLowering = class extends ExecutableCodeLowering {
|
|
|
64205
64249
|
}
|
|
64206
64250
|
createTypeOfCheck(expression, typeName, sourceLocation) {
|
|
64207
64251
|
const typeOfExpression = jsTypeOfExpression(expression, sourceLocation);
|
|
64208
|
-
const textLiteral2 =
|
|
64252
|
+
const textLiteral2 = textLiteral(typeName);
|
|
64209
64253
|
return binaryExpression(this.ctx.ectx, typeOfExpression, 5 /* Equals */, textLiteral2);
|
|
64210
64254
|
}
|
|
64211
64255
|
};
|
|
64212
64256
|
var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
64213
|
-
constructor(ctx,
|
|
64214
|
-
super(ctx,
|
|
64257
|
+
constructor(ctx, packageEntity2) {
|
|
64258
|
+
super(ctx, packageEntity2);
|
|
64215
64259
|
}
|
|
64216
64260
|
tryLowerCallExpression(node) {
|
|
64217
64261
|
const callee = node.expression;
|
|
@@ -64250,21 +64294,18 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
|
64250
64294
|
lowerBaseAspectMethodCallExpression(node, callee) {
|
|
64251
64295
|
const containingType = callee.method.entity.ifTypeMemberThenContainingType;
|
|
64252
64296
|
Debug.assertNotNull(containingType);
|
|
64253
|
-
const typeAccess =
|
|
64254
|
-
const aspectMethodAccess =
|
|
64297
|
+
const typeAccess = typeAccessExpression(containingType);
|
|
64298
|
+
const aspectMethodAccess = methodAccessExpression(
|
|
64255
64299
|
this.ctx.createPrototypeAccess(typeAccess),
|
|
64256
64300
|
false,
|
|
64257
64301
|
callee.method,
|
|
64258
64302
|
/* isCallee = true чтобы не выполнять bind */
|
|
64259
|
-
true
|
|
64260
|
-
|
|
64261
|
-
void 0,
|
|
64262
|
-
new FunctionAccessExpressionEmitOptions().setForceUseNonComputedName(true)
|
|
64263
|
-
);
|
|
64303
|
+
true
|
|
64304
|
+
).withOptions(new FunctionAccessExpressionEmitOptions().setForceUseNonComputedName(true));
|
|
64264
64305
|
const callMethodAccess = this.ctx.createJsFunctionCallMethodAccess(aspectMethodAccess);
|
|
64265
64306
|
const originalArguments = this.ctx.getOrderedArguments(node.args);
|
|
64266
64307
|
const newArguments = [
|
|
64267
|
-
|
|
64308
|
+
thisExpression(this.ctx.ectx.type.ofExpression(callee.expression)),
|
|
64268
64309
|
...originalArguments.values
|
|
64269
64310
|
];
|
|
64270
64311
|
return callExpression(
|
|
@@ -64283,10 +64324,10 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
|
64283
64324
|
lowerBaseAspectFieldGetAccess(node) {
|
|
64284
64325
|
const containingType = node.field.entity.ifTypeMemberThenContainingType;
|
|
64285
64326
|
Debug.assertNotNull(containingType);
|
|
64286
|
-
const aspectPrototypeAccess = this.ctx.createPrototypeAccess(
|
|
64327
|
+
const aspectPrototypeAccess = this.ctx.createPrototypeAccess(typeAccessExpression(containingType));
|
|
64287
64328
|
const getOwnPropertyDescriptorCall = this.ctx.createGetOwnPropertyDescriptorCall(
|
|
64288
64329
|
aspectPrototypeAccess,
|
|
64289
|
-
|
|
64330
|
+
textWithEntityName(node.field.entity)
|
|
64290
64331
|
);
|
|
64291
64332
|
const descriptorGetAccess = jsPropertyAccessExpression(
|
|
64292
64333
|
getOwnPropertyDescriptorCall,
|
|
@@ -64295,7 +64336,7 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
|
64295
64336
|
this.ctx.ectx.standardTypes.func
|
|
64296
64337
|
);
|
|
64297
64338
|
const callMethodAccess = this.ctx.createJsFunctionCallMethodAccess(descriptorGetAccess);
|
|
64298
|
-
const callArguments = [
|
|
64339
|
+
const callArguments = [thisExpression(this.ctx.ectx.type.ofExpression(node.expression))];
|
|
64299
64340
|
return callExpression(callMethodAccess, false, callArguments, false, node.field.type, node.sourceLocation);
|
|
64300
64341
|
}
|
|
64301
64342
|
/**
|
|
@@ -64305,10 +64346,10 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
|
64305
64346
|
lowerBaseAspectFieldAssignment(node, left) {
|
|
64306
64347
|
const containingType = left.field.entity.ifTypeMemberThenContainingType;
|
|
64307
64348
|
Debug.assertNotNull(containingType);
|
|
64308
|
-
const aspectPrototypeAccess = this.ctx.createPrototypeAccess(
|
|
64349
|
+
const aspectPrototypeAccess = this.ctx.createPrototypeAccess(typeAccessExpression(containingType));
|
|
64309
64350
|
const getOwnPropertyDescriptorCall = this.ctx.createGetOwnPropertyDescriptorCall(
|
|
64310
64351
|
aspectPrototypeAccess,
|
|
64311
|
-
|
|
64352
|
+
textWithEntityName(left.field.entity)
|
|
64312
64353
|
);
|
|
64313
64354
|
const descriptorGetAccess = jsPropertyAccessExpression(
|
|
64314
64355
|
getOwnPropertyDescriptorCall,
|
|
@@ -64317,7 +64358,7 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
|
64317
64358
|
this.ctx.ectx.standardTypes.func
|
|
64318
64359
|
);
|
|
64319
64360
|
const callMethodAccess = this.ctx.createJsFunctionCallMethodAccess(descriptorGetAccess);
|
|
64320
|
-
const callArguments = [
|
|
64361
|
+
const callArguments = [thisExpression(this.ctx.ectx.type.ofExpression(left.expression)), node.right];
|
|
64321
64362
|
const expression = callExpression(
|
|
64322
64363
|
callMethodAccess,
|
|
64323
64364
|
false,
|
|
@@ -64341,23 +64382,14 @@ var TextTranslationsLowering = class {
|
|
|
64341
64382
|
}
|
|
64342
64383
|
lower() {
|
|
64343
64384
|
for (const pkg2 of this.ctx.packages) {
|
|
64344
|
-
const
|
|
64345
|
-
const textTranslationLocale =
|
|
64346
|
-
if (
|
|
64347
|
-
const
|
|
64348
|
-
|
|
64349
|
-
EmitPhaseName.ofPackageConstructor(packageEntity.locale),
|
|
64350
|
-
[],
|
|
64351
|
-
this.ctx.ectx.standardTypes.nullType,
|
|
64352
|
-
packageEntity
|
|
64353
|
-
);
|
|
64354
|
-
packageConstructorEntity.details.isPackageConstructor = true;
|
|
64355
|
-
packageConstructorEntity.isPackageMember = true;
|
|
64356
|
-
packageEntity.members = packageEntity.members.concat(packageConstructorEntity);
|
|
64357
|
-
const dictionaryVariableEntity = new IntrinsicVariableEntity(
|
|
64358
|
-
EmitPhaseName.ofDictionaryLocalVariable(packageEntity.locale),
|
|
64385
|
+
const packageEntity2 = pkg2.ir.entity;
|
|
64386
|
+
const textTranslationLocale = packageEntity2.details.textTranslationLocale;
|
|
64387
|
+
if (packageEntity2.details.isTextTranslationPackage && textTranslationLocale !== void 0 && packageEntity2.details.translationTarget !== void 0) {
|
|
64388
|
+
const dictionaryVariableEntity = localVariableEntity(
|
|
64389
|
+
EmitPhaseName.ofDictionaryLocalVariable(packageEntity2.locale),
|
|
64359
64390
|
this.ctx.ectx.createIdentitySubstitutedType(this.ctx.dictionaryType),
|
|
64360
|
-
|
|
64391
|
+
packageEntity2,
|
|
64392
|
+
false
|
|
64361
64393
|
);
|
|
64362
64394
|
const dictionaryConstructorCall = constructorCallExpression(
|
|
64363
64395
|
this.ctx.ectx,
|
|
@@ -64376,7 +64408,7 @@ var TextTranslationsLowering = class {
|
|
|
64376
64408
|
textOrTranslationFunction = this.createTranslationFunctionLiteral(
|
|
64377
64409
|
translation.translatedTextOrFunctionBlock,
|
|
64378
64410
|
translation.sourceTextTemplate,
|
|
64379
|
-
|
|
64411
|
+
packageEntity2
|
|
64380
64412
|
);
|
|
64381
64413
|
} else {
|
|
64382
64414
|
textOrTranslationFunction = translation.translatedTextOrFunctionBlock;
|
|
@@ -64393,28 +64425,25 @@ var TextTranslationsLowering = class {
|
|
|
64393
64425
|
const translatorAddTranslationCall = staticMethodCallExpression(
|
|
64394
64426
|
this.ctx.translatorAddTranslationToLocaleMethod,
|
|
64395
64427
|
[
|
|
64396
|
-
|
|
64397
|
-
|
|
64398
|
-
|
|
64428
|
+
textLiteral(packageEntity2.details.translationTarget.name),
|
|
64429
|
+
textLiteral(localeToString(textTranslationLocale)),
|
|
64430
|
+
variableGetAccess(dictionaryVariableEntity)
|
|
64399
64431
|
]
|
|
64400
64432
|
);
|
|
64401
64433
|
const translatorAddTranslationStatement = expressionStatement(translatorAddTranslationCall);
|
|
64402
64434
|
statements.push(translatorAddTranslationStatement);
|
|
64403
|
-
const packageConstructorDeclaration =
|
|
64404
|
-
|
|
64405
|
-
[],
|
|
64406
|
-
blockStatement(statements),
|
|
64407
|
-
false
|
|
64408
|
-
);
|
|
64435
|
+
const packageConstructorDeclaration = this.ctx.findOrCreatePackageConstructor(pkg2.ir);
|
|
64436
|
+
packageConstructorDeclaration.body.statements = statements.concat(packageConstructorDeclaration.body.statements);
|
|
64409
64437
|
pkg2.ir.declarations = pkg2.ir.declarations.concat(packageConstructorDeclaration);
|
|
64410
64438
|
}
|
|
64411
64439
|
}
|
|
64412
64440
|
}
|
|
64413
|
-
createTranslationFunctionLiteral(block, sourceTextTemplate,
|
|
64414
|
-
const valuesParameterEntity =
|
|
64415
|
-
EmitPhaseName.ofTranslationFunctionValuesParameter(
|
|
64441
|
+
createTranslationFunctionLiteral(block, sourceTextTemplate, packageEntity2) {
|
|
64442
|
+
const valuesParameterEntity = parameterEntity(
|
|
64443
|
+
EmitPhaseName.ofTranslationFunctionValuesParameter(packageEntity2.locale),
|
|
64416
64444
|
this.ctx.ectx.standardTypes.array,
|
|
64417
|
-
|
|
64445
|
+
packageEntity2,
|
|
64446
|
+
false
|
|
64418
64447
|
);
|
|
64419
64448
|
const localVariableDeclarationStatements = sourceTextTemplate?.parameters.map((p, i) => localVariableDeclarationStatement(
|
|
64420
64449
|
p,
|
|
@@ -64425,7 +64454,7 @@ var TextTranslationsLowering = class {
|
|
|
64425
64454
|
p.type
|
|
64426
64455
|
)
|
|
64427
64456
|
)) ?? [];
|
|
64428
|
-
const valuesParameterDeclaration =
|
|
64457
|
+
const valuesParameterDeclaration = parameterDeclaration(valuesParameterEntity, void 0, false);
|
|
64429
64458
|
block.statements = localVariableDeclarationStatements.concat(block.statements);
|
|
64430
64459
|
return functionLiteral([valuesParameterDeclaration], block, false, this.ctx.ectx.standardTypes.text);
|
|
64431
64460
|
}
|
|
@@ -64483,10 +64512,10 @@ var IrBuilder = class {
|
|
|
64483
64512
|
const sourceFileTranslations = this.buildTextTranslationDeclarationList(sourceFileNode.declarationList);
|
|
64484
64513
|
translations.push(...sourceFileTranslations);
|
|
64485
64514
|
}
|
|
64486
|
-
const
|
|
64515
|
+
const packageEntity2 = this.entityMap.getPackageEntity(this.analyzer.entity.ofPackage(pkg2));
|
|
64487
64516
|
const entities = declarations.map((d) => d.entity);
|
|
64488
|
-
|
|
64489
|
-
return pkg(
|
|
64517
|
+
packageEntity2.members = Array.from(new Set(Array.from(packageEntity2.members).concat(entities)));
|
|
64518
|
+
return pkg(packageEntity2, [], declarations, translations, [], void 0);
|
|
64490
64519
|
}
|
|
64491
64520
|
buildPackageMemberDeclarationList(declarationList, sourceFileMembers) {
|
|
64492
64521
|
const result = [];
|
|
@@ -64584,16 +64613,15 @@ var IrBuilder = class {
|
|
|
64584
64613
|
buildPackageConstructorDeclaration(declaration) {
|
|
64585
64614
|
const originalContainingPackage = TreeQuery.getPackageEntity(declaration, this.analyzer);
|
|
64586
64615
|
const containingPackage = this.entityMap.getPackageEntity(originalContainingPackage);
|
|
64587
|
-
const entity =
|
|
64588
|
-
0 /* RegularFunction */,
|
|
64616
|
+
const entity = packageFunctionEntity(
|
|
64589
64617
|
EmitPhaseName.ofPackageConstructor(containingPackage.locale),
|
|
64590
64618
|
[],
|
|
64591
64619
|
this.entityMap.getType(this.analyzer.originalStandardTypes.nullType),
|
|
64592
|
-
containingPackage
|
|
64620
|
+
containingPackage,
|
|
64621
|
+
this.analyzer.checkBlockCallsAsyncMethods(declaration.block),
|
|
64622
|
+
true,
|
|
64623
|
+
false
|
|
64593
64624
|
);
|
|
64594
|
-
entity.details.isAsync = this.analyzer.checkBlockCallsAsyncMethods(declaration.block);
|
|
64595
|
-
entity.details.isPackageConstructor = true;
|
|
64596
|
-
entity.isPackageMember = true;
|
|
64597
64625
|
const body = this.buildFunctionBlockOfFunctionWithoutResult(declaration.block);
|
|
64598
64626
|
return packageFunctionDeclaration(entity, [], body, false, this.getSourceLocation(declaration));
|
|
64599
64627
|
}
|
|
@@ -64622,7 +64650,7 @@ var IrBuilder = class {
|
|
|
64622
64650
|
mappedResultLocalVariable,
|
|
64623
64651
|
void 0
|
|
64624
64652
|
);
|
|
64625
|
-
const returnStatement3 = returnStatement(
|
|
64653
|
+
const returnStatement3 = returnStatement(variableGetAccess(mappedResultLocalVariable));
|
|
64626
64654
|
statements = [
|
|
64627
64655
|
resultVariableDeclarationStatement,
|
|
64628
64656
|
...node.expressionOrStatementList.statements.map((s) => this.buildStatement(s)),
|
|
@@ -64755,16 +64783,15 @@ var IrBuilder = class {
|
|
|
64755
64783
|
buildPackageEntryPointDeclaration(declaration) {
|
|
64756
64784
|
const originalContainingPackage = TreeQuery.getPackageEntity(declaration, this.analyzer);
|
|
64757
64785
|
const containingPackage = this.entityMap.getPackageEntity(originalContainingPackage);
|
|
64758
|
-
const entity =
|
|
64759
|
-
0 /* RegularFunction */,
|
|
64786
|
+
const entity = packageFunctionEntity(
|
|
64760
64787
|
EmitPhaseName.ofPackageRunFunction(containingPackage.locale),
|
|
64761
64788
|
[],
|
|
64762
64789
|
this.entityMap.getType(this.analyzer.originalStandardTypes.nullType),
|
|
64763
|
-
containingPackage
|
|
64790
|
+
containingPackage,
|
|
64791
|
+
this.analyzer.checkBlockCallsAsyncMethods(declaration.block),
|
|
64792
|
+
false,
|
|
64793
|
+
true
|
|
64764
64794
|
);
|
|
64765
|
-
entity.details.isAsync = this.analyzer.checkBlockCallsAsyncMethods(declaration.block);
|
|
64766
|
-
entity.details.isPackageEntryPoint = true;
|
|
64767
|
-
entity.isPackageMember = true;
|
|
64768
64795
|
const body = this.buildFunctionBlockOfFunctionWithoutResult(declaration.block);
|
|
64769
64796
|
return packageFunctionDeclaration(entity, [], body, false, this.getSourceLocation(declaration));
|
|
64770
64797
|
}
|
|
@@ -65022,23 +65049,18 @@ var IrBuilder = class {
|
|
|
65022
65049
|
}
|
|
65023
65050
|
}
|
|
65024
65051
|
}
|
|
65025
|
-
return
|
|
65026
|
-
decorators,
|
|
65027
|
-
parameters,
|
|
65028
|
-
body,
|
|
65029
|
-
entity,
|
|
65030
|
-
this.getSourceLocation(declaration)
|
|
65031
|
-
);
|
|
65052
|
+
return constructorDeclaration(entity, parameters, body, this.getSourceLocation(declaration)).withDecorators(decorators);
|
|
65032
65053
|
}
|
|
65033
65054
|
createDefaultStructuredTypeConstructor(entity, info) {
|
|
65055
|
+
const mappedEntity = this.entityMap.getConstructorEntity(entity);
|
|
65034
65056
|
const parameters = entity.getParameters().map((p) => {
|
|
65035
65057
|
const entity2 = this.entityMap.getVariableEntity(p);
|
|
65036
65058
|
const defaultValue = p.subkind === "parameter" && p.isOptional() ? nullLiteral() : void 0;
|
|
65037
|
-
return
|
|
65059
|
+
return parameterDeclaration(entity2, defaultValue, false);
|
|
65038
65060
|
});
|
|
65039
65061
|
const statements = [];
|
|
65040
65062
|
if (info.baseConstructor !== void 0) {
|
|
65041
|
-
const args = info.orderedParametersForBaseConstructor.map((v) =>
|
|
65063
|
+
const args = info.orderedParametersForBaseConstructor.map((v) => variableGetAccess(this.entityMap.getVariableEntity(v.parameter)));
|
|
65042
65064
|
const baseConstructorEntity = info.baseConstructor.getEntity();
|
|
65043
65065
|
const containingEntity = baseConstructorEntity.getContainingEntity();
|
|
65044
65066
|
if (containingEntity.kind === 2 /* Type */) {
|
|
@@ -65055,14 +65077,8 @@ var IrBuilder = class {
|
|
|
65055
65077
|
const field = fieldToInitializeByOwnParameter.get(parameter);
|
|
65056
65078
|
if (field !== void 0) {
|
|
65057
65079
|
const receiver = this.createExplicitReceiver(field);
|
|
65058
|
-
const memberAccess =
|
|
65059
|
-
|
|
65060
|
-
false,
|
|
65061
|
-
AccessedVariable.fromEntity(this.entityMap.getVariableEntity(field))
|
|
65062
|
-
);
|
|
65063
|
-
const parameterAccess = VariableAccessExpression.get(
|
|
65064
|
-
this.entityMap.getVariableEntity(parameter)
|
|
65065
|
-
);
|
|
65080
|
+
const memberAccess = instanceFieldSetAccess(receiver, this.entityMap.getVariableEntity(field), false);
|
|
65081
|
+
const parameterAccess = variableGetAccess(this.entityMap.getVariableEntity(parameter));
|
|
65066
65082
|
const assignmentStatement2 = assignmentStatement(memberAccess, parameterAccess);
|
|
65067
65083
|
if (parameter.subkind === "parameter" && parameter.isOptional()) {
|
|
65068
65084
|
const notEmptyCheck = binaryExpression(
|
|
@@ -65080,8 +65096,7 @@ var IrBuilder = class {
|
|
|
65080
65096
|
}
|
|
65081
65097
|
}
|
|
65082
65098
|
const body = blockStatement(statements);
|
|
65083
|
-
|
|
65084
|
-
return new ConstructorDeclaration2([], parameters, body, mappedEntity, void 0);
|
|
65099
|
+
return constructorDeclaration(mappedEntity, parameters, body, void 0);
|
|
65085
65100
|
}
|
|
65086
65101
|
buildDestructorDeclaration(declaration) {
|
|
65087
65102
|
if (declaration.block === void 0) {
|
|
@@ -65092,60 +65107,41 @@ var IrBuilder = class {
|
|
|
65092
65107
|
const decorators = this.buildDecorators(declaration.tagList);
|
|
65093
65108
|
const parameters = this.buildParameterList(declaration.parameterClause.parameterList);
|
|
65094
65109
|
const body = this.buildFunctionBlockOfFunctionWithoutResult(declaration.block);
|
|
65095
|
-
return
|
|
65096
|
-
decorators,
|
|
65097
|
-
parameters,
|
|
65098
|
-
body,
|
|
65099
|
-
entity,
|
|
65100
|
-
this.getSourceLocation(declaration)
|
|
65101
|
-
);
|
|
65110
|
+
return destructorDeclaration(entity, parameters, body, this.getSourceLocation(declaration)).withDecorators(decorators);
|
|
65102
65111
|
}
|
|
65103
65112
|
buildIndexedElementGetterDeclaration(declaration) {
|
|
65104
65113
|
if (declaration.block === void 0) {
|
|
65105
65114
|
return void 0;
|
|
65106
65115
|
}
|
|
65107
|
-
const indexerEntity = this.analyzer.entity.ofIndexerDeclaration(declaration);
|
|
65108
65116
|
const originalEntity = this.analyzer.entity.ofIndexedElementGetterDeclaration(declaration);
|
|
65109
65117
|
const entity = this.entityMap.getGetterEntity(originalEntity);
|
|
65110
65118
|
const decorators = this.buildDecorators(declaration.tagList);
|
|
65111
|
-
const modifiers = new Modifiers().setStatic(indexerEntity.isStatic());
|
|
65112
65119
|
const body = this.buildFunctionBlockOfFunction(
|
|
65113
65120
|
declaration.block,
|
|
65114
65121
|
this.analyzer.resultLocalVariableEntity.ofIndexedElementGetterDeclaration(declaration)
|
|
65115
65122
|
);
|
|
65116
65123
|
const parameters = this.buildParameterList(declaration.parameterClause.parameterList);
|
|
65117
65124
|
this.buildAndSaveTypeIfIsAnonymousTypeSpecifier(declaration.typeAnnotation.typeSpecifier);
|
|
65118
|
-
return
|
|
65119
|
-
entity,
|
|
65120
|
-
decorators,
|
|
65121
|
-
modifiers,
|
|
65122
|
-
parameters,
|
|
65123
|
-
body,
|
|
65124
|
-
this.getSourceLocation(declaration)
|
|
65125
|
-
);
|
|
65125
|
+
return indexedElementGetterDeclaration(entity, parameters, body, this.getSourceLocation(declaration)).withDecorators(decorators);
|
|
65126
65126
|
}
|
|
65127
65127
|
buildIndexedElementSetterDeclaration(declaration) {
|
|
65128
65128
|
if (declaration.block === void 0) {
|
|
65129
65129
|
return void 0;
|
|
65130
65130
|
}
|
|
65131
|
-
const indexerEntity = this.analyzer.entity.ofIndexerDeclaration(declaration);
|
|
65132
65131
|
const originalEntity = this.analyzer.entity.ofIndexedElementSetterDeclaration(declaration);
|
|
65133
65132
|
const entity = this.entityMap.getSetterEntity(originalEntity);
|
|
65134
65133
|
const decorators = this.buildDecorators(declaration.tagList);
|
|
65135
|
-
const modifiers = new Modifiers().setStatic(indexerEntity.isStatic());
|
|
65136
65134
|
const body = this.buildFunctionBlockOfFunctionWithoutResult(declaration.block);
|
|
65137
65135
|
const originalValueLocalVariable = this.analyzer.valueLocalVariableEntity.ofIndexedElementSetterDeclaration(declaration);
|
|
65138
65136
|
const valueLocalVariable = this.entityMap.getVariableEntity(originalValueLocalVariable);
|
|
65139
65137
|
const parameters = this.buildParameterList(declaration.parameterClause.parameterList);
|
|
65140
|
-
return
|
|
65138
|
+
return indexedElementSetterDeclaration(
|
|
65141
65139
|
entity,
|
|
65142
|
-
decorators,
|
|
65143
|
-
modifiers,
|
|
65144
65140
|
parameters,
|
|
65145
65141
|
body,
|
|
65146
65142
|
valueLocalVariable,
|
|
65147
65143
|
this.getSourceLocation(declaration)
|
|
65148
|
-
);
|
|
65144
|
+
).withDecorators(decorators);
|
|
65149
65145
|
}
|
|
65150
65146
|
buildDereferencedVariableGetterDeclaration(declaration) {
|
|
65151
65147
|
if (declaration.block === void 0) {
|
|
@@ -65155,41 +65151,30 @@ var IrBuilder = class {
|
|
|
65155
65151
|
const originalEntity = this.analyzer.entity.ofDereferencedVariableGetterDeclaration(declaration);
|
|
65156
65152
|
const entity = this.entityMap.getGetterEntity(originalEntity);
|
|
65157
65153
|
const decorators = this.buildDecorators(declaration.tagList);
|
|
65158
|
-
const modifiers = new Modifiers().setStatic(operatorEntity.isStatic());
|
|
65159
65154
|
const body = this.buildFunctionBlockOfFunction(
|
|
65160
65155
|
declaration.block,
|
|
65161
65156
|
this.analyzer.resultLocalVariableEntity.ofDereferencedVariableGetterDeclaration(declaration)
|
|
65162
65157
|
);
|
|
65163
65158
|
this.buildAndSaveTypeIfIsAnonymousTypeSpecifier(declaration.typeAnnotation.typeSpecifier);
|
|
65164
|
-
return
|
|
65165
|
-
entity,
|
|
65166
|
-
decorators,
|
|
65167
|
-
modifiers,
|
|
65168
|
-
body,
|
|
65169
|
-
this.getSourceLocation(declaration)
|
|
65170
|
-
);
|
|
65159
|
+
return dereferencedVariableGetterDeclaration(entity, body, this.getSourceLocation(declaration)).withDecorators(decorators);
|
|
65171
65160
|
}
|
|
65172
65161
|
buildDereferencedVariableSetterDeclaration(declaration) {
|
|
65173
65162
|
if (declaration.block === void 0) {
|
|
65174
65163
|
return void 0;
|
|
65175
65164
|
}
|
|
65176
|
-
const operatorEntity = this.analyzer.entity.ofDereferenceOperatorDeclaration(declaration);
|
|
65177
65165
|
const originalEntity = this.analyzer.entity.ofDereferencedVariableSetterDeclaration(declaration);
|
|
65178
65166
|
const entity = this.entityMap.getSetterEntity(originalEntity);
|
|
65179
65167
|
const decorators = this.buildDecorators(declaration.tagList);
|
|
65180
|
-
const modifiers = new Modifiers().setStatic(operatorEntity.isStatic());
|
|
65181
65168
|
const body = this.buildFunctionBlockOfFunctionWithoutResult(declaration.block);
|
|
65182
65169
|
const originalValueLocalVariable = this.analyzer.valueLocalVariableEntity.ofDereferencedVariableSetterDeclaration(declaration);
|
|
65183
65170
|
Debug.assertNotNull(originalValueLocalVariable, "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043F\u0438\u0441\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C.");
|
|
65184
65171
|
const valueLocalVariable = this.entityMap.getVariableEntity(originalValueLocalVariable);
|
|
65185
|
-
return
|
|
65172
|
+
return dereferencedVariableSetterDeclaration(
|
|
65186
65173
|
entity,
|
|
65187
|
-
decorators,
|
|
65188
|
-
modifiers,
|
|
65189
65174
|
body,
|
|
65190
65175
|
valueLocalVariable,
|
|
65191
65176
|
this.getSourceLocation(declaration)
|
|
65192
|
-
);
|
|
65177
|
+
).withDecorators(decorators);
|
|
65193
65178
|
}
|
|
65194
65179
|
buildMethodDeclaration(declaration) {
|
|
65195
65180
|
if (declaration.block === void 0) {
|
|
@@ -65198,23 +65183,19 @@ var IrBuilder = class {
|
|
|
65198
65183
|
const originalEntity = this.analyzer.entity.ofMethodDeclaration(declaration);
|
|
65199
65184
|
const entity = this.entityMap.getFunctionEntity(originalEntity);
|
|
65200
65185
|
const decorators = this.buildDecorators(declaration.tagList);
|
|
65201
|
-
const modifiers = new Modifiers().setStatic(originalEntity.isStatic()).setAsync(originalEntity.isAsync());
|
|
65202
65186
|
const parameters = this.buildParameterList(declaration.parameterClause.parameterList);
|
|
65203
65187
|
const body = this.buildFunctionBlockOfFunction(
|
|
65204
65188
|
declaration.block,
|
|
65205
65189
|
this.analyzer.resultLocalVariableEntity.ofMethodDeclaration(declaration)
|
|
65206
65190
|
);
|
|
65207
65191
|
this.buildAndSaveTypeIfIsAnonymousTypeSpecifier(declaration.returnTypeAnnotation?.typeSpecifier);
|
|
65208
|
-
return
|
|
65209
|
-
|
|
65210
|
-
modifiers,
|
|
65192
|
+
return methodDeclaration(
|
|
65193
|
+
entity,
|
|
65211
65194
|
parameters,
|
|
65212
65195
|
body,
|
|
65213
|
-
entity,
|
|
65214
65196
|
this.analyzer.isFunctionGenerator(declaration),
|
|
65215
|
-
void 0,
|
|
65216
65197
|
this.getSourceLocation(declaration)
|
|
65217
|
-
);
|
|
65198
|
+
).withDecorators(decorators);
|
|
65218
65199
|
}
|
|
65219
65200
|
buildOperatorDeclaration(declaration) {
|
|
65220
65201
|
if (declaration.block === void 0) {
|
|
@@ -65223,23 +65204,13 @@ var IrBuilder = class {
|
|
|
65223
65204
|
const originalEntity = this.analyzer.entity.ofOperatorDeclaration(declaration);
|
|
65224
65205
|
const entity = this.entityMap.getOperatorEntity(originalEntity);
|
|
65225
65206
|
const decorators = this.buildDecorators(declaration.tagList);
|
|
65226
|
-
const modifiers = new Modifiers().setStatic(originalEntity.isStatic());
|
|
65227
65207
|
const parameters = this.buildParameterList(declaration.parameterClause.parameterList);
|
|
65228
65208
|
const body = this.buildFunctionBlockOfFunction(
|
|
65229
65209
|
declaration.block,
|
|
65230
65210
|
this.analyzer.resultLocalVariableEntity.ofOperatorDeclaration(declaration)
|
|
65231
65211
|
);
|
|
65232
65212
|
this.buildAndSaveTypeIfIsAnonymousTypeSpecifier(declaration.returnTypeAnnotation?.typeSpecifier);
|
|
65233
|
-
return
|
|
65234
|
-
decorators,
|
|
65235
|
-
modifiers,
|
|
65236
|
-
parameters,
|
|
65237
|
-
body,
|
|
65238
|
-
entity,
|
|
65239
|
-
false,
|
|
65240
|
-
void 0,
|
|
65241
|
-
this.getSourceLocation(declaration)
|
|
65242
|
-
);
|
|
65213
|
+
return methodDeclaration(entity, parameters, body, false, this.getSourceLocation(declaration)).withDecorators(decorators);
|
|
65243
65214
|
}
|
|
65244
65215
|
buildFieldDeclaration(declaration) {
|
|
65245
65216
|
const originalEntity = this.analyzer.entity.ofFieldDeclaration(declaration);
|
|
@@ -65248,17 +65219,9 @@ var IrBuilder = class {
|
|
|
65248
65219
|
}
|
|
65249
65220
|
const entity = this.entityMap.getVariableEntity(originalEntity);
|
|
65250
65221
|
const decorators = this.buildDecorators(declaration.tagList);
|
|
65251
|
-
const modifiers = new Modifiers().setStatic(originalEntity.isStatic());
|
|
65252
65222
|
const initializer = declaration.initializer !== void 0 ? this.buildExpression(declaration.initializer) : void 0;
|
|
65253
65223
|
this.buildAndSaveTypeIfIsAnonymousTypeSpecifier(declaration.typeAnnotation?.typeSpecifier);
|
|
65254
|
-
return
|
|
65255
|
-
decorators,
|
|
65256
|
-
modifiers,
|
|
65257
|
-
initializer,
|
|
65258
|
-
entity,
|
|
65259
|
-
void 0,
|
|
65260
|
-
this.getSourceLocation(declaration)
|
|
65261
|
-
);
|
|
65224
|
+
return fieldDeclaration(entity, initializer, this.getSourceLocation(declaration)).withDecorators(decorators);
|
|
65262
65225
|
}
|
|
65263
65226
|
buildComputedFieldDeclaration(getterDeclaration, setterDeclaration) {
|
|
65264
65227
|
if (getterDeclaration.block === void 0 || setterDeclaration !== void 0 && setterDeclaration.block === void 0) {
|
|
@@ -65266,10 +65229,9 @@ var IrBuilder = class {
|
|
|
65266
65229
|
}
|
|
65267
65230
|
const originalEntity = this.analyzer.entity.ofComputedFieldDeclaration(getterDeclaration);
|
|
65268
65231
|
const entity = this.entityMap.getVariableEntity(originalEntity);
|
|
65269
|
-
const modifiers = new Modifiers().setStatic(originalEntity.isStatic());
|
|
65270
65232
|
const getter = this.buildFieldGetterDeclarationRequired(getterDeclaration);
|
|
65271
65233
|
const setter = setterDeclaration !== void 0 ? this.buildFieldSetterDeclaration(setterDeclaration) : void 0;
|
|
65272
|
-
return
|
|
65234
|
+
return computedFieldDeclaration(entity, getter, setter);
|
|
65273
65235
|
}
|
|
65274
65236
|
buildFieldGetterDeclarationRequired(declaration) {
|
|
65275
65237
|
Debug.assertNotNull(declaration.block);
|
|
@@ -65281,7 +65243,7 @@ var IrBuilder = class {
|
|
|
65281
65243
|
this.analyzer.resultLocalVariableEntity.ofFieldGetterDeclaration(declaration)
|
|
65282
65244
|
);
|
|
65283
65245
|
this.buildAndSaveTypeIfIsAnonymousTypeSpecifier(declaration.typeAnnotation.typeSpecifier);
|
|
65284
|
-
return
|
|
65246
|
+
return fieldGetterDeclaration(entity, body, this.getSourceLocation(declaration)).withDecorators(decorators);
|
|
65285
65247
|
}
|
|
65286
65248
|
buildFieldSetterDeclaration(declaration) {
|
|
65287
65249
|
if (declaration.block === void 0) {
|
|
@@ -65294,13 +65256,7 @@ var IrBuilder = class {
|
|
|
65294
65256
|
const originalValueLocalVariable = this.analyzer.valueLocalVariableEntity.ofFieldSetterDeclaration(declaration);
|
|
65295
65257
|
Debug.assertNotNull(originalValueLocalVariable, "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043F\u0438\u0441\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C.");
|
|
65296
65258
|
const valueLocalVariable = this.entityMap.getVariableEntity(originalValueLocalVariable);
|
|
65297
|
-
return
|
|
65298
|
-
entity,
|
|
65299
|
-
decorators,
|
|
65300
|
-
body,
|
|
65301
|
-
valueLocalVariable,
|
|
65302
|
-
this.getSourceLocation(declaration)
|
|
65303
|
-
);
|
|
65259
|
+
return fieldSetterDeclaration(entity, body, valueLocalVariable, this.getSourceLocation(declaration)).withDecorators(decorators);
|
|
65304
65260
|
}
|
|
65305
65261
|
buildBackingField(entity) {
|
|
65306
65262
|
Debug.assertNotNull(this.declarationsUsageInfoOfPackageSourceFiles);
|
|
@@ -65308,8 +65264,7 @@ var IrBuilder = class {
|
|
|
65308
65264
|
return void 0;
|
|
65309
65265
|
}
|
|
65310
65266
|
const mappedEntity = this.entityMap.getVariableEntity(entity);
|
|
65311
|
-
|
|
65312
|
-
return new FieldDeclaration2([], modifiers, void 0, mappedEntity, void 0, void 0);
|
|
65267
|
+
return fieldDeclaration(mappedEntity, void 0);
|
|
65313
65268
|
}
|
|
65314
65269
|
buildDisposeStatement(statement) {
|
|
65315
65270
|
Logger.errorAtNode("Dispose statement is not supported by code generator.", statement);
|
|
@@ -65376,7 +65331,7 @@ var IrBuilder = class {
|
|
|
65376
65331
|
let ifExpressionIsNotEnumerableThenEnumeratorMethod;
|
|
65377
65332
|
if (checkResult.kind === "ok" && checkResult.value.ifTypeDoesNotImplementEnumerableThenEnumeratorMethod !== void 0) {
|
|
65378
65333
|
const method = checkResult.value.ifTypeDoesNotImplementEnumerableThenEnumeratorMethod;
|
|
65379
|
-
ifExpressionIsNotEnumerableThenEnumeratorMethod =
|
|
65334
|
+
ifExpressionIsNotEnumerableThenEnumeratorMethod = accessedFunction(
|
|
65380
65335
|
this.entityMap.getFunctionEntity(method.getEntity()),
|
|
65381
65336
|
this.entityMap.getType(method.getReturnType())
|
|
65382
65337
|
);
|
|
@@ -65447,7 +65402,7 @@ var IrBuilder = class {
|
|
|
65447
65402
|
const entity = this.entityMap.getVariableEntity(this.analyzer.entity.ofParameterDeclaration(p));
|
|
65448
65403
|
const defaultValue = p.defaultValue !== void 0 ? this.buildExpression(p.defaultValue) : void 0;
|
|
65449
65404
|
this.buildAndSaveTypeIfIsAnonymousTypeSpecifier(p.typeAnnotation?.typeSpecifier);
|
|
65450
|
-
return
|
|
65405
|
+
return parameterDeclaration(entity, defaultValue, false, this.getSourceLocation(p));
|
|
65451
65406
|
}).toArray();
|
|
65452
65407
|
}
|
|
65453
65408
|
buildLocalVariableDeclarationStatement(statement) {
|
|
@@ -65499,10 +65454,10 @@ var IrBuilder = class {
|
|
|
65499
65454
|
const condition = this.buildExpression(statement.condition);
|
|
65500
65455
|
const body = this.buildStatementBlock(statement.block);
|
|
65501
65456
|
this.currentLoopLabel = saveLoopLabel;
|
|
65502
|
-
return
|
|
65457
|
+
return whileStatement(loopLabel, condition, body, this.getSourceLocation(statement));
|
|
65503
65458
|
}
|
|
65504
65459
|
buildYieldStatement(statement) {
|
|
65505
|
-
return
|
|
65460
|
+
return yieldStatement(this.buildExpression(statement.expression), this.getSourceLocation(statement));
|
|
65506
65461
|
}
|
|
65507
65462
|
buildExpression(expression) {
|
|
65508
65463
|
let result;
|
|
@@ -65533,7 +65488,7 @@ var IrBuilder = class {
|
|
|
65533
65488
|
break;
|
|
65534
65489
|
case 71 /* MissingExpression */:
|
|
65535
65490
|
Logger.errorAtNode("Unexpected invalid expression.", expression);
|
|
65536
|
-
result =
|
|
65491
|
+
result = textLiteral("Unexpected invalid expression.");
|
|
65537
65492
|
break;
|
|
65538
65493
|
case 72 /* IsExpression */:
|
|
65539
65494
|
result = this.buildIsExpression(expression);
|
|
@@ -65777,11 +65732,11 @@ var IrBuilder = class {
|
|
|
65777
65732
|
switch (meaning.kind) {
|
|
65778
65733
|
case "unresolved":
|
|
65779
65734
|
Logger.errorAtNode("Unexpected unresolved call expression.", expression);
|
|
65780
|
-
return
|
|
65735
|
+
return textLiteral("Unexpected unresolved call expression.");
|
|
65781
65736
|
case "function-call": {
|
|
65782
65737
|
if (meaning.suitableFunctions.length === 0) {
|
|
65783
65738
|
Logger.errorAtNode("Zero suitable functions.", expression);
|
|
65784
|
-
return
|
|
65739
|
+
return textLiteral("Zero suitable functions.");
|
|
65785
65740
|
} else if (meaning.suitableFunctions.length > 1) {
|
|
65786
65741
|
Logger.errorAtNode("Ambiguous function call.", expression);
|
|
65787
65742
|
}
|
|
@@ -65792,12 +65747,11 @@ var IrBuilder = class {
|
|
|
65792
65747
|
if (meaning2.kind === "overridden-method-access") {
|
|
65793
65748
|
const entity = this.entityMap.getFunctionEntity(meaning2.method.getEntity());
|
|
65794
65749
|
const returnType2 = this.entityMap.getType(meaning2.method.getReturnType());
|
|
65795
|
-
receiver =
|
|
65750
|
+
receiver = methodAccessExpression(
|
|
65796
65751
|
baseExpression(),
|
|
65797
65752
|
false,
|
|
65798
|
-
|
|
65753
|
+
accessedFunction(entity, returnType2),
|
|
65799
65754
|
true,
|
|
65800
|
-
void 0,
|
|
65801
65755
|
this.getSourceLocation(expression.expression)
|
|
65802
65756
|
);
|
|
65803
65757
|
}
|
|
@@ -65821,7 +65775,7 @@ var IrBuilder = class {
|
|
|
65821
65775
|
case "operator-call": {
|
|
65822
65776
|
if (meaning.suitableOperators.length === 0) {
|
|
65823
65777
|
Logger.errorAtNode("Zero suitable operators.", expression);
|
|
65824
|
-
return
|
|
65778
|
+
return textLiteral("Zero suitable operators.");
|
|
65825
65779
|
} else if (meaning.suitableOperators.length > 1) {
|
|
65826
65780
|
Logger.errorAtNode("Ambiguous operator call.", expression);
|
|
65827
65781
|
}
|
|
@@ -65832,12 +65786,11 @@ var IrBuilder = class {
|
|
|
65832
65786
|
if (meaning2.kind === "overridden-operator-access") {
|
|
65833
65787
|
const entity = this.entityMap.getOperatorEntity(meaning2.operator.getEntity());
|
|
65834
65788
|
const returnType2 = this.entityMap.getType(meaning2.operator.getReturnType());
|
|
65835
|
-
receiver =
|
|
65789
|
+
receiver = methodAccessExpression(
|
|
65836
65790
|
baseExpression(),
|
|
65837
65791
|
false,
|
|
65838
|
-
|
|
65792
|
+
accessedFunction(entity, returnType2),
|
|
65839
65793
|
true,
|
|
65840
|
-
void 0,
|
|
65841
65794
|
this.getSourceLocation(expression.expression)
|
|
65842
65795
|
);
|
|
65843
65796
|
}
|
|
@@ -65877,12 +65830,11 @@ var IrBuilder = class {
|
|
|
65877
65830
|
case "constructor-call": {
|
|
65878
65831
|
if (meaning.suitableConstructors.length === 0) {
|
|
65879
65832
|
Logger.errorAtNode("Zero suitable constructors.", expression);
|
|
65880
|
-
return
|
|
65833
|
+
return textLiteral("Zero suitable constructors.");
|
|
65881
65834
|
} else if (meaning.suitableConstructors.length > 1) {
|
|
65882
65835
|
Logger.errorAtNode("Ambiguous constructor call.", expression);
|
|
65883
65836
|
}
|
|
65884
65837
|
const originalEntity = meaning.suitableConstructors[0].getEntity();
|
|
65885
|
-
const originalContainingEntity = originalEntity.getContainingEntity();
|
|
65886
65838
|
const entity = this.entityMap.getConstructorEntity(originalEntity);
|
|
65887
65839
|
const args = this.buildArgumentList(
|
|
65888
65840
|
expression.argumentList,
|
|
@@ -65893,13 +65845,9 @@ var IrBuilder = class {
|
|
|
65893
65845
|
} else if (expression.expression.kind === 88 /* BaseExpression */) {
|
|
65894
65846
|
return baseConstructorCallExpression(entity, args, this.getSourceLocation(expression));
|
|
65895
65847
|
} else {
|
|
65896
|
-
const containingEntity = this.entityMap.getTypeOrExtensionEntity(originalContainingEntity);
|
|
65897
|
-
const typeAccess = new TypeAccessExpression(containingEntity, void 0);
|
|
65898
65848
|
const returnType = this.entityMap.getType(this.analyzer.type.ofExpression(expression));
|
|
65899
|
-
return
|
|
65849
|
+
return constructorCallExpressionWithResultType(
|
|
65900
65850
|
entity,
|
|
65901
|
-
containingEntity,
|
|
65902
|
-
typeAccess,
|
|
65903
65851
|
args,
|
|
65904
65852
|
returnType,
|
|
65905
65853
|
this.getSourceLocation(expression)
|
|
@@ -65916,32 +65864,22 @@ var IrBuilder = class {
|
|
|
65916
65864
|
case "constructor-call": {
|
|
65917
65865
|
if (meaning.suitableConstructors.length === 0) {
|
|
65918
65866
|
Logger.errorAtNode("Zero suitable constructors.", expression);
|
|
65919
|
-
return
|
|
65867
|
+
return textLiteral("Zero suitable constructors.");
|
|
65920
65868
|
} else if (meaning.suitableConstructors.length > 1) {
|
|
65921
65869
|
Logger.errorAtNode("Ambiguous constructor call.", expression);
|
|
65922
65870
|
}
|
|
65923
65871
|
const originalEntity = meaning.suitableConstructors[0].getEntity();
|
|
65924
|
-
const originalContainingEntity = originalEntity.getContainingEntity();
|
|
65925
65872
|
const entity = this.entityMap.getConstructorEntity(originalEntity);
|
|
65926
|
-
const containingEntity = this.entityMap.getTypeOrExtensionEntity(originalContainingEntity);
|
|
65927
|
-
const typeAccess = new TypeAccessExpression(containingEntity, void 0);
|
|
65928
65873
|
const args = this.buildArgumentList(
|
|
65929
65874
|
expression.argumentList,
|
|
65930
65875
|
originalEntity.getParameters()
|
|
65931
65876
|
);
|
|
65932
65877
|
const returnType = this.entityMap.getType(this.analyzer.type.ofExpression(expression));
|
|
65933
|
-
return
|
|
65934
|
-
entity,
|
|
65935
|
-
containingEntity,
|
|
65936
|
-
typeAccess,
|
|
65937
|
-
args,
|
|
65938
|
-
returnType,
|
|
65939
|
-
this.getSourceLocation(expression)
|
|
65940
|
-
);
|
|
65878
|
+
return constructorCallExpressionWithResultType(entity, args, returnType, this.getSourceLocation(expression));
|
|
65941
65879
|
}
|
|
65942
65880
|
case "unresolved":
|
|
65943
65881
|
Logger.errorAtNode("Unexpected unresolved implicit constructor call expression.", expression);
|
|
65944
|
-
return
|
|
65882
|
+
return textLiteral("Unexpected unresolved implicit constructor call expression.");
|
|
65945
65883
|
default:
|
|
65946
65884
|
Debug.never(meaning);
|
|
65947
65885
|
}
|
|
@@ -65952,7 +65890,7 @@ var IrBuilder = class {
|
|
|
65952
65890
|
case "resolved": {
|
|
65953
65891
|
if (meaning.singleSuitableIndexer === void 0) {
|
|
65954
65892
|
Logger.errorAtNode("\u041D\u0435\u043E\u0434\u043D\u043E\u0437\u043D\u0430\u0447\u043D\u044B\u0439 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043F\u043E \u0438\u043D\u0434\u0435\u043A\u0441\u0443.", expression);
|
|
65955
|
-
return
|
|
65893
|
+
return textLiteral("\u041D\u0435\u043E\u0434\u043D\u043E\u0437\u043D\u0430\u0447\u043D\u044B\u0439 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043F\u043E \u0438\u043D\u0434\u0435\u043A\u0441\u0443.");
|
|
65956
65894
|
}
|
|
65957
65895
|
const irExpression = this.buildExpression(expression.expression);
|
|
65958
65896
|
const isOptionalAccess = expression.expression.kind === 62 /* AssumptionExpression */;
|
|
@@ -65961,7 +65899,7 @@ var IrBuilder = class {
|
|
|
65961
65899
|
meaning.singleSuitableIndexer.getEntity().getParameters()
|
|
65962
65900
|
);
|
|
65963
65901
|
const access = this.convertIndexedAccess(meaning.accessKind, meaning.singleSuitableIndexer);
|
|
65964
|
-
return
|
|
65902
|
+
return indexedAccessExpression(
|
|
65965
65903
|
irExpression,
|
|
65966
65904
|
isOptionalAccess,
|
|
65967
65905
|
args,
|
|
@@ -65971,7 +65909,7 @@ var IrBuilder = class {
|
|
|
65971
65909
|
}
|
|
65972
65910
|
case "unresolved":
|
|
65973
65911
|
Logger.errorAtNode("Unexpected unresolved indexed access expression.", expression);
|
|
65974
|
-
return
|
|
65912
|
+
return textLiteral("Unexpected unresolved indexed access expression.");
|
|
65975
65913
|
default:
|
|
65976
65914
|
Debug.never(meaning);
|
|
65977
65915
|
}
|
|
@@ -65995,12 +65933,7 @@ var IrBuilder = class {
|
|
|
65995
65933
|
return functionLiteral(parameters, body, isAsync, returnType, this.getSourceLocation(expression));
|
|
65996
65934
|
}
|
|
65997
65935
|
buildFunctionBlockLiteral(expression) {
|
|
65998
|
-
const parameters = this.analyzer.getFunctionBlockLiteralParameters(expression).map((p) =>
|
|
65999
|
-
this.entityMap.getVariableEntity(p),
|
|
66000
|
-
void 0,
|
|
66001
|
-
false,
|
|
66002
|
-
void 0
|
|
66003
|
-
));
|
|
65936
|
+
const parameters = this.analyzer.getFunctionBlockLiteralParameters(expression).map((p) => parameterDeclaration(this.entityMap.getVariableEntity(p), void 0, false));
|
|
66004
65937
|
const body = this.buildFunctionBlockOfFunction(
|
|
66005
65938
|
expression.block,
|
|
66006
65939
|
this.analyzer.resultLocalVariableEntity.ofFunctionBlockLiteral(expression)
|
|
@@ -66052,29 +65985,25 @@ var IrBuilder = class {
|
|
|
66052
65985
|
case "mixed-ambiguous-access":
|
|
66053
65986
|
case "constructor-access":
|
|
66054
65987
|
Logger.errorAtNode("Unresolved property access expression meaning.", expression);
|
|
66055
|
-
return
|
|
65988
|
+
return textLiteral("Unresolved property access expression meaning.");
|
|
66056
65989
|
case "package-name-segment-access":
|
|
66057
65990
|
Logger.errorAtNode("Unexpected property access expression meaning.", expression);
|
|
66058
|
-
return
|
|
65991
|
+
return textLiteral("Unexpected property access expression meaning.");
|
|
66059
65992
|
case "package-variable-access": {
|
|
66060
65993
|
const entity = this.entityMap.getVariableEntity(meaning.variable);
|
|
66061
|
-
return
|
|
66062
|
-
AccessedVariable.fromEntity(entity),
|
|
66063
|
-
meaning.accessKind,
|
|
66064
|
-
this.getSourceLocation(expression)
|
|
66065
|
-
);
|
|
65994
|
+
return variableAccessExpressions(entity, meaning.accessKind, this.getSourceLocation(expression));
|
|
66066
65995
|
}
|
|
66067
65996
|
case "package-function-access": {
|
|
66068
65997
|
const func = meaning.singleSuitableFunction;
|
|
66069
65998
|
if (func === void 0) {
|
|
66070
65999
|
Logger.errorAtNode("Ambiguous method access.", expression);
|
|
66071
|
-
return
|
|
66000
|
+
return textLiteral("Ambiguous method access.");
|
|
66072
66001
|
}
|
|
66073
66002
|
const entity = this.entityMap.getFunctionEntity(func.getEntity());
|
|
66074
66003
|
const returnType = this.entityMap.getType(func.getReturnType());
|
|
66075
66004
|
const isCallee = this.expressionIsCallee(expression);
|
|
66076
66005
|
return functionAccessExpression(
|
|
66077
|
-
|
|
66006
|
+
accessedFunction(entity, returnType),
|
|
66078
66007
|
isCallee,
|
|
66079
66008
|
this.getSourceLocation(expression)
|
|
66080
66009
|
);
|
|
@@ -66083,21 +66012,20 @@ var IrBuilder = class {
|
|
|
66083
66012
|
const type = meaning.singleSuitableType;
|
|
66084
66013
|
if (type === void 0) {
|
|
66085
66014
|
Logger.errorAtNode("Ambiguous type access.", expression);
|
|
66086
|
-
return
|
|
66015
|
+
return textLiteral("Ambiguous type access.");
|
|
66087
66016
|
}
|
|
66088
|
-
return
|
|
66017
|
+
return typeAccessExpression(this.getEntityFromType(type), this.getSourceLocation(expression));
|
|
66089
66018
|
}
|
|
66090
66019
|
case "static-field-access": {
|
|
66091
66020
|
const typeEntity = this.getEntityFromType(meaning.type);
|
|
66092
|
-
const typeAccess =
|
|
66021
|
+
const typeAccess = typeAccessExpression(typeEntity);
|
|
66093
66022
|
const entity = this.entityMap.getVariableEntity(meaning.field.getEntity());
|
|
66094
66023
|
const type = this.entityMap.getType(meaning.field.getType());
|
|
66095
|
-
return
|
|
66024
|
+
return fieldAccessExpression(
|
|
66096
66025
|
typeAccess,
|
|
66097
66026
|
false,
|
|
66098
|
-
|
|
66027
|
+
accessedVariable(entity, type),
|
|
66099
66028
|
meaning.accessKind,
|
|
66100
|
-
void 0,
|
|
66101
66029
|
this.getSourceLocation(expression)
|
|
66102
66030
|
);
|
|
66103
66031
|
}
|
|
@@ -66105,19 +66033,18 @@ var IrBuilder = class {
|
|
|
66105
66033
|
const method = meaning.singleSuitableFunction;
|
|
66106
66034
|
if (method === void 0) {
|
|
66107
66035
|
Logger.errorAtNode("Ambiguous method access.", expression);
|
|
66108
|
-
return
|
|
66036
|
+
return textLiteral("Ambiguous method access.");
|
|
66109
66037
|
}
|
|
66110
66038
|
const typeEntity = this.getEntityFromType(meaning.type);
|
|
66111
|
-
const typeAccess =
|
|
66039
|
+
const typeAccess = typeAccessExpression(typeEntity);
|
|
66112
66040
|
const isCallee = this.expressionIsCallee(expression);
|
|
66113
66041
|
const entity = this.entityMap.getFunctionEntity(method.getEntity());
|
|
66114
66042
|
const returnType = this.entityMap.getType(method.getReturnType());
|
|
66115
|
-
return
|
|
66043
|
+
return methodAccessExpression(
|
|
66116
66044
|
typeAccess,
|
|
66117
66045
|
false,
|
|
66118
|
-
|
|
66046
|
+
accessedFunction(entity, returnType),
|
|
66119
66047
|
isCallee,
|
|
66120
|
-
void 0,
|
|
66121
66048
|
this.getSourceLocation(expression)
|
|
66122
66049
|
);
|
|
66123
66050
|
}
|
|
@@ -66127,12 +66054,11 @@ var IrBuilder = class {
|
|
|
66127
66054
|
const isOptionalAccess = expression.expression.kind === 62 /* AssumptionExpression */;
|
|
66128
66055
|
const entity = this.entityMap.getVariableEntity(originalEntity);
|
|
66129
66056
|
const type = this.entityMap.getType(meaning.field.getType());
|
|
66130
|
-
return
|
|
66057
|
+
return fieldAccessExpression(
|
|
66131
66058
|
expressionIr,
|
|
66132
66059
|
isOptionalAccess,
|
|
66133
|
-
|
|
66060
|
+
accessedVariable(entity, type),
|
|
66134
66061
|
meaning.accessKind,
|
|
66135
|
-
void 0,
|
|
66136
66062
|
this.getSourceLocation(expression)
|
|
66137
66063
|
);
|
|
66138
66064
|
}
|
|
@@ -66140,7 +66066,7 @@ var IrBuilder = class {
|
|
|
66140
66066
|
const method = meaning.singleSuitableFunction;
|
|
66141
66067
|
if (method === void 0) {
|
|
66142
66068
|
Logger.errorAtNode("Ambiguous method access.", expression);
|
|
66143
|
-
return
|
|
66069
|
+
return textLiteral("Ambiguous method access.");
|
|
66144
66070
|
}
|
|
66145
66071
|
const originalFunctionEntity = method.getEntity();
|
|
66146
66072
|
if (originalFunctionEntity.subkind === "method" && originalFunctionEntity.isFunctionTypeInvokeMethod()) {
|
|
@@ -66157,12 +66083,11 @@ var IrBuilder = class {
|
|
|
66157
66083
|
const isCallee = this.expressionIsCallee(expression);
|
|
66158
66084
|
const entity = this.entityMap.getFunctionEntity(originalFunctionEntity);
|
|
66159
66085
|
const returnType = this.entityMap.getType(method.getReturnType());
|
|
66160
|
-
return
|
|
66086
|
+
return methodAccessExpression(
|
|
66161
66087
|
expressionIr,
|
|
66162
66088
|
isOptionalAccess,
|
|
66163
|
-
|
|
66089
|
+
accessedFunction(entity, returnType),
|
|
66164
66090
|
isCallee,
|
|
66165
|
-
void 0,
|
|
66166
66091
|
this.getSourceLocation(expression)
|
|
66167
66092
|
);
|
|
66168
66093
|
}
|
|
@@ -66171,19 +66096,18 @@ var IrBuilder = class {
|
|
|
66171
66096
|
const operator = meaning.singleSuitableOperator;
|
|
66172
66097
|
if (operator === void 0) {
|
|
66173
66098
|
Logger.errorAtNode("Ambiguous operator access.", expression);
|
|
66174
|
-
return
|
|
66099
|
+
return textLiteral("Ambiguous operator access.");
|
|
66175
66100
|
}
|
|
66176
66101
|
const expressionIr = this.buildExpression(expression.expression);
|
|
66177
66102
|
const isOptionalAccess = expression.expression.kind === 62 /* AssumptionExpression */;
|
|
66178
66103
|
const isCallee = this.expressionIsCallee(expression);
|
|
66179
66104
|
const entity = this.entityMap.getOperatorEntity(operator.getEntity());
|
|
66180
66105
|
const returnType = this.entityMap.getType(operator.getReturnType());
|
|
66181
|
-
return
|
|
66106
|
+
return methodAccessExpression(
|
|
66182
66107
|
expressionIr,
|
|
66183
66108
|
isOptionalAccess,
|
|
66184
|
-
|
|
66109
|
+
accessedFunction(entity, returnType),
|
|
66185
66110
|
isCallee,
|
|
66186
|
-
void 0,
|
|
66187
66111
|
this.getSourceLocation(expression)
|
|
66188
66112
|
);
|
|
66189
66113
|
}
|
|
@@ -66196,7 +66120,7 @@ var IrBuilder = class {
|
|
|
66196
66120
|
case 0 /* Get */: {
|
|
66197
66121
|
const originalGetter = indexer.getEntity().getGetter();
|
|
66198
66122
|
Debug.assertNotNull(originalGetter);
|
|
66199
|
-
const getAccessor =
|
|
66123
|
+
const getAccessor = accessedFunction(
|
|
66200
66124
|
this.entityMap.getGetterEntity(originalGetter),
|
|
66201
66125
|
this.entityMap.getType(indexer.getType())
|
|
66202
66126
|
);
|
|
@@ -66205,7 +66129,7 @@ var IrBuilder = class {
|
|
|
66205
66129
|
case 1 /* Set */: {
|
|
66206
66130
|
const originalSetter = indexer.getEntity().getSetter();
|
|
66207
66131
|
Debug.assertNotNull(originalSetter);
|
|
66208
|
-
const setAccessor =
|
|
66132
|
+
const setAccessor = accessedFunction(
|
|
66209
66133
|
this.entityMap.getSetterEntity(originalSetter),
|
|
66210
66134
|
this.entityMap.getType(this.analyzer.originalStandardTypes.nullType)
|
|
66211
66135
|
);
|
|
@@ -66216,11 +66140,11 @@ var IrBuilder = class {
|
|
|
66216
66140
|
Debug.assertNotNull(originalGetter);
|
|
66217
66141
|
const originalSetter = indexer.getEntity().getSetter();
|
|
66218
66142
|
Debug.assertNotNull(originalSetter);
|
|
66219
|
-
const getAccessor =
|
|
66143
|
+
const getAccessor = accessedFunction(
|
|
66220
66144
|
this.entityMap.getGetterEntity(originalGetter),
|
|
66221
66145
|
this.entityMap.getType(this.analyzer.originalStandardTypes.nullType)
|
|
66222
66146
|
);
|
|
66223
|
-
const setAccessor =
|
|
66147
|
+
const setAccessor = accessedFunction(
|
|
66224
66148
|
this.entityMap.getSetterEntity(originalSetter),
|
|
66225
66149
|
this.entityMap.getType(indexer.getType())
|
|
66226
66150
|
);
|
|
@@ -66235,7 +66159,7 @@ var IrBuilder = class {
|
|
|
66235
66159
|
case 0 /* Get */: {
|
|
66236
66160
|
const originalGetter = operator.getEntity().getGetter();
|
|
66237
66161
|
Debug.assertNotNull(originalGetter);
|
|
66238
|
-
const getAccessor =
|
|
66162
|
+
const getAccessor = accessedFunction(
|
|
66239
66163
|
this.entityMap.getGetterEntity(originalGetter),
|
|
66240
66164
|
this.entityMap.getType(operator.getType())
|
|
66241
66165
|
);
|
|
@@ -66244,7 +66168,7 @@ var IrBuilder = class {
|
|
|
66244
66168
|
case 1 /* Set */: {
|
|
66245
66169
|
const originalSetter = operator.getEntity().getSetter();
|
|
66246
66170
|
Debug.assertNotNull(originalSetter);
|
|
66247
|
-
const setAccessor =
|
|
66171
|
+
const setAccessor = accessedFunction(
|
|
66248
66172
|
this.entityMap.getSetterEntity(originalSetter),
|
|
66249
66173
|
this.entityMap.getType(this.analyzer.originalStandardTypes.nullType)
|
|
66250
66174
|
);
|
|
@@ -66255,11 +66179,11 @@ var IrBuilder = class {
|
|
|
66255
66179
|
Debug.assertNotNull(originalGetter);
|
|
66256
66180
|
const originalSetter = operator.getEntity().getSetter();
|
|
66257
66181
|
Debug.assertNotNull(originalSetter);
|
|
66258
|
-
const getAccessor =
|
|
66182
|
+
const getAccessor = accessedFunction(
|
|
66259
66183
|
this.entityMap.getGetterEntity(originalGetter),
|
|
66260
66184
|
this.entityMap.getType(this.analyzer.originalStandardTypes.nullType)
|
|
66261
66185
|
);
|
|
66262
|
-
const setAccessor =
|
|
66186
|
+
const setAccessor = accessedFunction(
|
|
66263
66187
|
this.entityMap.getSetterEntity(originalSetter),
|
|
66264
66188
|
this.entityMap.getType(operator.getType())
|
|
66265
66189
|
);
|
|
@@ -66281,24 +66205,17 @@ var IrBuilder = class {
|
|
|
66281
66205
|
} else {
|
|
66282
66206
|
secondExpression = nullLiteral();
|
|
66283
66207
|
}
|
|
66284
|
-
|
|
66285
|
-
return new TernaryExpression(
|
|
66286
|
-
condition,
|
|
66287
|
-
firstExpression,
|
|
66288
|
-
secondExpression,
|
|
66289
|
-
type,
|
|
66290
|
-
this.getSourceLocation(expression)
|
|
66291
|
-
);
|
|
66208
|
+
return ternaryExpression(condition, firstExpression, secondExpression, this.getSourceLocation(expression));
|
|
66292
66209
|
}
|
|
66293
66210
|
buildTextLiteral(expression) {
|
|
66294
|
-
return
|
|
66211
|
+
return textLiteral(
|
|
66295
66212
|
unescapeText(withoutQuotes(expression.text.value)),
|
|
66296
66213
|
this.getSourceLocation(expression)
|
|
66297
66214
|
);
|
|
66298
66215
|
}
|
|
66299
66216
|
buildLocalizableTextLiteral(expression) {
|
|
66300
66217
|
const code = expression.code !== void 0 ? parseIntegerLiteral(expression.code.value) : void 0;
|
|
66301
|
-
return
|
|
66218
|
+
return localizableTextLiteral(
|
|
66302
66219
|
unescapeText(withoutQuotes(expression.text.value)),
|
|
66303
66220
|
code,
|
|
66304
66221
|
this.getSourceLocation(expression)
|
|
@@ -66311,7 +66228,7 @@ var IrBuilder = class {
|
|
|
66311
66228
|
textFragments.push(unescapeText(withoutTemplateQuotes(span.text.value)));
|
|
66312
66229
|
expressions.push(this.buildExpression(span.expression));
|
|
66313
66230
|
}
|
|
66314
|
-
return
|
|
66231
|
+
return textTemplateLiteral(textFragments, expressions, this.getSourceLocation(expression));
|
|
66315
66232
|
}
|
|
66316
66233
|
buildLocalizableTextTemplateLiteral(expression) {
|
|
66317
66234
|
const textFragments = [unescapeText(withoutTemplateQuotes(expression.head.value))];
|
|
@@ -66321,7 +66238,7 @@ var IrBuilder = class {
|
|
|
66321
66238
|
expressions.push(this.buildExpression(span.expression));
|
|
66322
66239
|
}
|
|
66323
66240
|
const code = expression.code !== void 0 ? parseIntegerLiteral(expression.code.value) : void 0;
|
|
66324
|
-
return
|
|
66241
|
+
return localizableTextTemplateLiteral(textFragments, expressions, code, this.getSourceLocation(expression));
|
|
66325
66242
|
}
|
|
66326
66243
|
buildTokenExpression(expression) {
|
|
66327
66244
|
switch (expression.token.tokenKind) {
|
|
@@ -66354,7 +66271,7 @@ var IrBuilder = class {
|
|
|
66354
66271
|
}
|
|
66355
66272
|
buildObjectExpression(expression) {
|
|
66356
66273
|
const type = this.entityMap.getType(this.analyzer.type.ofExpression(expression));
|
|
66357
|
-
return
|
|
66274
|
+
return thisExpression(type, this.getSourceLocation(expression));
|
|
66358
66275
|
}
|
|
66359
66276
|
buildBaseExpression(expression) {
|
|
66360
66277
|
return baseExpression(this.getSourceLocation(expression));
|
|
@@ -66368,7 +66285,7 @@ var IrBuilder = class {
|
|
|
66368
66285
|
meaning.diagnostic?.data.message ?? "Unexpected unresolved dereference expression meaning.",
|
|
66369
66286
|
expression
|
|
66370
66287
|
);
|
|
66371
|
-
return
|
|
66288
|
+
return textLiteral("Unexpected unresolved dereference expression meaning.");
|
|
66372
66289
|
}
|
|
66373
66290
|
const access = this.convertDereferencedVariableAccess(meaning.accessKind, meaning.operator);
|
|
66374
66291
|
return dereferenceExpression(irExpression, isOptionalAccess, access, this.getSourceLocation(expression));
|
|
@@ -66381,9 +66298,8 @@ var IrBuilder = class {
|
|
|
66381
66298
|
"Default match expression must be handled as part of switch statement and must not be converted separately.",
|
|
66382
66299
|
expression
|
|
66383
66300
|
);
|
|
66384
|
-
return
|
|
66385
|
-
"Default match expression must be handled as part of switch statement and must not be converted separately."
|
|
66386
|
-
void 0
|
|
66301
|
+
return textLiteral(
|
|
66302
|
+
"Default match expression must be handled as part of switch statement and must not be converted separately."
|
|
66387
66303
|
);
|
|
66388
66304
|
}
|
|
66389
66305
|
buildIdentifierExpression(expression) {
|
|
@@ -66391,29 +66307,26 @@ var IrBuilder = class {
|
|
|
66391
66307
|
switch (meaning.kind) {
|
|
66392
66308
|
case "unresolved":
|
|
66393
66309
|
Logger.errorAtNode("Unexpected identifier expression meaning.", expression);
|
|
66394
|
-
return
|
|
66310
|
+
return textLiteral("Unexpected identifier expression meaning.");
|
|
66395
66311
|
case "mixed-ambiguous-access":
|
|
66396
66312
|
Logger.errorAtNode("Unexpected identifier expression meaning.", expression);
|
|
66397
|
-
return
|
|
66313
|
+
return textLiteral("Unexpected identifier expression meaning.");
|
|
66398
66314
|
case "package-alias-access":
|
|
66399
66315
|
Logger.errorAtNode("Unexpected identifier expression meaning.", expression);
|
|
66400
|
-
return
|
|
66316
|
+
return textLiteral("Unexpected identifier expression meaning.");
|
|
66401
66317
|
case "package-name-segment-access":
|
|
66402
66318
|
Logger.errorAtNode("Unexpected identifier expression meaning.", expression);
|
|
66403
|
-
return
|
|
66319
|
+
return textLiteral("Unexpected identifier expression meaning.");
|
|
66404
66320
|
case "constructor-access":
|
|
66405
66321
|
Logger.errorAtNode("Unexpected identifier expression meaning.", expression);
|
|
66406
|
-
return
|
|
66322
|
+
return textLiteral("Unexpected identifier expression meaning.");
|
|
66407
66323
|
case "type-access": {
|
|
66408
66324
|
const suitableType = meaning.singleSuitableType;
|
|
66409
66325
|
if (suitableType === void 0) {
|
|
66410
66326
|
Logger.errorAtNode("Ambiguous type access.", expression);
|
|
66411
|
-
return
|
|
66327
|
+
return textLiteral("Ambiguous type access.");
|
|
66412
66328
|
}
|
|
66413
|
-
return
|
|
66414
|
-
this.getEntityFromType(suitableType),
|
|
66415
|
-
this.getSourceLocation(expression)
|
|
66416
|
-
);
|
|
66329
|
+
return typeAccessExpression(this.getEntityFromType(suitableType), this.getSourceLocation(expression));
|
|
66417
66330
|
}
|
|
66418
66331
|
case "variable-access": {
|
|
66419
66332
|
const originalEntity = meaning.variable.getEntity();
|
|
@@ -66423,15 +66336,14 @@ var IrBuilder = class {
|
|
|
66423
66336
|
}
|
|
66424
66337
|
const entity = this.entityMap.getVariableEntity(originalEntity);
|
|
66425
66338
|
const type = this.entityMap.getType(meaning.variable.value.getType());
|
|
66426
|
-
return receiver !== void 0 ?
|
|
66339
|
+
return receiver !== void 0 ? fieldAccessExpression(
|
|
66427
66340
|
receiver,
|
|
66428
66341
|
false,
|
|
66429
|
-
|
|
66342
|
+
accessedVariable(entity, type),
|
|
66430
66343
|
meaning.accessKind,
|
|
66431
|
-
void 0,
|
|
66432
66344
|
this.getSourceLocation(expression)
|
|
66433
|
-
) :
|
|
66434
|
-
|
|
66345
|
+
) : variableAccessExpressions(
|
|
66346
|
+
accessedVariable(entity, type),
|
|
66435
66347
|
meaning.accessKind,
|
|
66436
66348
|
this.getSourceLocation(expression)
|
|
66437
66349
|
);
|
|
@@ -66440,7 +66352,7 @@ var IrBuilder = class {
|
|
|
66440
66352
|
const suitableFunction = meaning.singleSuitableFunction;
|
|
66441
66353
|
if (suitableFunction === void 0) {
|
|
66442
66354
|
Logger.errorAtNode("Ambiguous function access.", expression);
|
|
66443
|
-
return
|
|
66355
|
+
return textLiteral("Ambiguous function access.");
|
|
66444
66356
|
}
|
|
66445
66357
|
const originalEntity = suitableFunction.getEntity();
|
|
66446
66358
|
let receiver;
|
|
@@ -66450,15 +66362,14 @@ var IrBuilder = class {
|
|
|
66450
66362
|
const isCallee = this.expressionIsCallee(expression);
|
|
66451
66363
|
const entity = this.entityMap.getFunctionEntity(originalEntity);
|
|
66452
66364
|
const returnType = this.entityMap.getType(suitableFunction.getReturnType());
|
|
66453
|
-
return receiver !== void 0 ?
|
|
66365
|
+
return receiver !== void 0 ? methodAccessExpression(
|
|
66454
66366
|
receiver,
|
|
66455
66367
|
false,
|
|
66456
|
-
|
|
66368
|
+
accessedFunction(entity, returnType),
|
|
66457
66369
|
isCallee,
|
|
66458
|
-
void 0,
|
|
66459
66370
|
this.getSourceLocation(expression)
|
|
66460
66371
|
) : functionAccessExpression(
|
|
66461
|
-
|
|
66372
|
+
accessedFunction(entity, returnType),
|
|
66462
66373
|
isCallee,
|
|
66463
66374
|
this.getSourceLocation(expression)
|
|
66464
66375
|
);
|
|
@@ -66467,22 +66378,21 @@ var IrBuilder = class {
|
|
|
66467
66378
|
const suitableOperator = meaning.singleSuitableOperator;
|
|
66468
66379
|
if (suitableOperator === void 0) {
|
|
66469
66380
|
Logger.errorAtNode("Ambiguous operator access.", expression);
|
|
66470
|
-
return
|
|
66381
|
+
return textLiteral("Ambiguous operator access.");
|
|
66471
66382
|
}
|
|
66472
66383
|
const originalEntity = suitableOperator.getEntity();
|
|
66473
66384
|
const receiver = this.createExplicitReceiver(originalEntity);
|
|
66474
66385
|
const isCallee = this.expressionIsCallee(expression);
|
|
66475
66386
|
const entity = this.entityMap.getOperatorEntity(originalEntity);
|
|
66476
66387
|
const returnType = this.entityMap.getType(suitableOperator.getReturnType());
|
|
66477
|
-
return receiver !== void 0 ?
|
|
66388
|
+
return receiver !== void 0 ? methodAccessExpression(
|
|
66478
66389
|
receiver,
|
|
66479
66390
|
false,
|
|
66480
|
-
|
|
66391
|
+
accessedFunction(entity, returnType),
|
|
66481
66392
|
isCallee,
|
|
66482
|
-
void 0,
|
|
66483
66393
|
this.getSourceLocation(expression)
|
|
66484
66394
|
) : functionAccessExpression(
|
|
66485
|
-
|
|
66395
|
+
accessedFunction(entity, returnType),
|
|
66486
66396
|
isCallee,
|
|
66487
66397
|
this.getSourceLocation(expression)
|
|
66488
66398
|
);
|
|
@@ -66495,14 +66405,14 @@ var IrBuilder = class {
|
|
|
66495
66405
|
let result;
|
|
66496
66406
|
if (entity.isStatic()) {
|
|
66497
66407
|
const typeOrExtensionEntity = this.entityMap.getTypeOrExtensionEntity(entity.getContainingEntity());
|
|
66498
|
-
result =
|
|
66408
|
+
result = typeAccessExpression(typeOrExtensionEntity);
|
|
66499
66409
|
} else {
|
|
66500
66410
|
const contextualType = TypeWithMembersOrExtensionEntity15.getContextualTypeEntity(
|
|
66501
66411
|
entity.getContainingEntity()
|
|
66502
66412
|
);
|
|
66503
66413
|
Debug.assertNotNull(contextualType, "\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430 \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0451\u043D.");
|
|
66504
66414
|
const type = this.entityMap.getType(this.analyzer.instantiateTypeByIdentitySubstitution(contextualType));
|
|
66505
|
-
result =
|
|
66415
|
+
result = thisExpression(type);
|
|
66506
66416
|
}
|
|
66507
66417
|
return result;
|
|
66508
66418
|
}
|
|
@@ -66568,7 +66478,7 @@ var IrBuilder = class {
|
|
|
66568
66478
|
const entity = this.entityMap.getFunctionEntity(func.getEntity());
|
|
66569
66479
|
const returnType = this.entityMap.getType(func.getReturnType());
|
|
66570
66480
|
const functionCall = functionCallExpression(
|
|
66571
|
-
|
|
66481
|
+
accessedFunction(entity, returnType),
|
|
66572
66482
|
args,
|
|
66573
66483
|
this.getSourceLocation(tag)
|
|
66574
66484
|
);
|
|
@@ -66654,7 +66564,7 @@ var IrBuilder = class {
|
|
|
66654
66564
|
createAccessedFunctionFromOperator(operator) {
|
|
66655
66565
|
const entity = this.entityMap.getOperatorEntity(operator.getEntity());
|
|
66656
66566
|
const type = this.entityMap.getType(operator.getReturnType());
|
|
66657
|
-
return
|
|
66567
|
+
return accessedFunction(entity, type);
|
|
66658
66568
|
}
|
|
66659
66569
|
expressionIsCallee(expression) {
|
|
66660
66570
|
return this.analyzer.ifCalleeThenCallExpression(expression) !== void 0;
|
|
@@ -66683,11 +66593,8 @@ var IrBuilder = class {
|
|
|
66683
66593
|
const entity = this.analyzer.entity.ofTextTranslationDeclaration(translation.sourceText);
|
|
66684
66594
|
if (translation.sourceText.kind === 144 /* TranslationTextLiteral */ && translation.targetText.kind === 84 /* TextLiteral */) {
|
|
66685
66595
|
const translatedText = unescapeText(withoutQuotes(translation.targetText.text.value));
|
|
66686
|
-
const translatedTextNode =
|
|
66687
|
-
|
|
66688
|
-
this.getSourceLocation(translation.targetText)
|
|
66689
|
-
);
|
|
66690
|
-
return new TextTranslationDeclaration2(
|
|
66596
|
+
const translatedTextNode = textLiteral(translatedText, this.getSourceLocation(translation.targetText));
|
|
66597
|
+
return textTranslationDeclaration(
|
|
66691
66598
|
entity.getKey(),
|
|
66692
66599
|
void 0,
|
|
66693
66600
|
translatedTextNode,
|
|
@@ -66695,16 +66602,16 @@ var IrBuilder = class {
|
|
|
66695
66602
|
);
|
|
66696
66603
|
}
|
|
66697
66604
|
const parameters = entity.getParameters().map((p) => this.entityMap.getVariableEntity(p));
|
|
66698
|
-
const
|
|
66605
|
+
const translationTextTemplate2 = translationTextTemplate(
|
|
66699
66606
|
entity.getTextFragments(),
|
|
66700
66607
|
parameters,
|
|
66701
66608
|
this.getSourceLocation(translation.sourceText)
|
|
66702
66609
|
);
|
|
66703
66610
|
const returnExpression = this.buildExpression(translation.targetText);
|
|
66704
66611
|
const block = blockStatement([returnStatement(returnExpression)]);
|
|
66705
|
-
return
|
|
66612
|
+
return textTranslationDeclaration(
|
|
66706
66613
|
entity.getKey(),
|
|
66707
|
-
|
|
66614
|
+
translationTextTemplate2,
|
|
66708
66615
|
block,
|
|
66709
66616
|
this.getSourceLocation(translation)
|
|
66710
66617
|
);
|
|
@@ -66712,7 +66619,7 @@ var IrBuilder = class {
|
|
|
66712
66619
|
buildTextTranslationFunctionDeclaration(translation) {
|
|
66713
66620
|
const entity = this.analyzer.entity.ofTextTranslationDeclaration(translation.sourceText);
|
|
66714
66621
|
const parameters = entity.getParameters().map((p) => this.entityMap.getVariableEntity(p));
|
|
66715
|
-
const
|
|
66622
|
+
const translationTextTemplate2 = translationTextTemplate(
|
|
66716
66623
|
entity.getTextFragments(),
|
|
66717
66624
|
parameters,
|
|
66718
66625
|
this.getSourceLocation(translation.sourceText)
|
|
@@ -66721,9 +66628,9 @@ var IrBuilder = class {
|
|
|
66721
66628
|
translation.block,
|
|
66722
66629
|
this.analyzer.resultLocalVariableEntity.ofTextTranslationFunctionDeclaration(translation)
|
|
66723
66630
|
);
|
|
66724
|
-
return
|
|
66631
|
+
return textTranslationDeclaration(
|
|
66725
66632
|
entity.getKey(),
|
|
66726
|
-
|
|
66633
|
+
translationTextTemplate2,
|
|
66727
66634
|
block,
|
|
66728
66635
|
this.getSourceLocation(translation)
|
|
66729
66636
|
);
|
|
@@ -68195,8 +68102,7 @@ var Emitter = class _Emitter {
|
|
|
68195
68102
|
return Query.from(packageGraph.enumeratePackages(this.targetPlatform)).filter((p) => p.kind === "program" && !p.configuration.isInterfacePackage() || p.kind === "text-translation");
|
|
68196
68103
|
}
|
|
68197
68104
|
createPackageWithMainFunction(packages, mainSourcePackage) {
|
|
68198
|
-
const entity =
|
|
68199
|
-
entity.details.isPackageWithMainFunction = true;
|
|
68105
|
+
const entity = packageEntity("Launch", mainSourcePackage.locale, true, false);
|
|
68200
68106
|
const packageConstructors = packages.flatMap((p) => p.ir.declarations).filter((d) => d.kind === 22 /* PackageFunctionDeclaration */ && d.entity.details.isPackageConstructor);
|
|
68201
68107
|
const packageEntryPoints = packages.flatMap((p) => p.ir.declarations).filter((d) => d.kind === 22 /* PackageFunctionDeclaration */ && d.entity.details.isPackageEntryPoint);
|
|
68202
68108
|
const mainFunction = this.createMainFunction(packageConstructors, packageEntryPoints, entity);
|
|
@@ -68209,14 +68115,15 @@ var Emitter = class _Emitter {
|
|
|
68209
68115
|
const body = blockStatement(functionCallStatements);
|
|
68210
68116
|
const isAsyncFunction = packageConstructors.some((o) => o.modifiers.isAsync()) || packageEntryPoints.some((o) => o.modifiers.isAsync());
|
|
68211
68117
|
const mainFunctionName = EmitPhaseName.ofMainFunction(containingPackage.locale);
|
|
68212
|
-
const entity =
|
|
68213
|
-
0 /* RegularFunction */,
|
|
68118
|
+
const entity = packageFunctionEntity(
|
|
68214
68119
|
mainFunctionName,
|
|
68215
68120
|
[],
|
|
68216
68121
|
this.ectx.standardTypes.nullType,
|
|
68217
|
-
containingPackage
|
|
68122
|
+
containingPackage,
|
|
68123
|
+
isAsyncFunction,
|
|
68124
|
+
false,
|
|
68125
|
+
false
|
|
68218
68126
|
);
|
|
68219
|
-
entity.details.isAsync = isAsyncFunction;
|
|
68220
68127
|
return packageFunctionDeclaration(entity, [], body, false);
|
|
68221
68128
|
}
|
|
68222
68129
|
createUniqueNamesForPackageMembers(packages) {
|
|
@@ -68567,11 +68474,10 @@ var DeclarationRenamer = class _DeclarationRenamer {
|
|
|
68567
68474
|
case 95 /* ComputedFieldDeclaration */:
|
|
68568
68475
|
this.renameParametersAndLocals([], member.getter.body, packageMemberNames);
|
|
68569
68476
|
if (member.setter !== void 0) {
|
|
68570
|
-
this.renameParametersAndLocals([
|
|
68477
|
+
this.renameParametersAndLocals([parameterDeclaration(
|
|
68571
68478
|
member.setter.valueLocalVariableEntity,
|
|
68572
68479
|
void 0,
|
|
68573
|
-
false
|
|
68574
|
-
void 0
|
|
68480
|
+
false
|
|
68575
68481
|
)], member.setter.body, packageMemberNames);
|
|
68576
68482
|
}
|
|
68577
68483
|
break;
|