@typescript-deploys/pr-build 5.5.0-pr-58364-29 → 5.5.0-pr-58702-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +139 -316
- package/lib/typescript.js +167 -316
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240529`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -1518,15 +1518,6 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1518
1518
|
);
|
|
1519
1519
|
}
|
|
1520
1520
|
Debug2.formatNodeFlags = formatNodeFlags;
|
|
1521
|
-
function formatNodeCheckFlags(flags) {
|
|
1522
|
-
return formatEnum(
|
|
1523
|
-
flags,
|
|
1524
|
-
NodeCheckFlags,
|
|
1525
|
-
/*isFlags*/
|
|
1526
|
-
true
|
|
1527
|
-
);
|
|
1528
|
-
}
|
|
1529
|
-
Debug2.formatNodeCheckFlags = formatNodeCheckFlags;
|
|
1530
1521
|
function formatModifierFlags(flags) {
|
|
1531
1522
|
return formatEnum(
|
|
1532
1523
|
flags,
|
|
@@ -3539,34 +3530,6 @@ var SymbolFlags = /* @__PURE__ */ ((SymbolFlags2) => {
|
|
|
3539
3530
|
SymbolFlags2[SymbolFlags2["LateBindingContainer"] = 6256] = "LateBindingContainer";
|
|
3540
3531
|
return SymbolFlags2;
|
|
3541
3532
|
})(SymbolFlags || {});
|
|
3542
|
-
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags3) => {
|
|
3543
|
-
NodeCheckFlags3[NodeCheckFlags3["None"] = 0] = "None";
|
|
3544
|
-
NodeCheckFlags3[NodeCheckFlags3["TypeChecked"] = 1] = "TypeChecked";
|
|
3545
|
-
NodeCheckFlags3[NodeCheckFlags3["LexicalThis"] = 2] = "LexicalThis";
|
|
3546
|
-
NodeCheckFlags3[NodeCheckFlags3["CaptureThis"] = 4] = "CaptureThis";
|
|
3547
|
-
NodeCheckFlags3[NodeCheckFlags3["CaptureNewTarget"] = 8] = "CaptureNewTarget";
|
|
3548
|
-
NodeCheckFlags3[NodeCheckFlags3["SuperInstance"] = 16] = "SuperInstance";
|
|
3549
|
-
NodeCheckFlags3[NodeCheckFlags3["SuperStatic"] = 32] = "SuperStatic";
|
|
3550
|
-
NodeCheckFlags3[NodeCheckFlags3["ContextChecked"] = 64] = "ContextChecked";
|
|
3551
|
-
NodeCheckFlags3[NodeCheckFlags3["MethodWithSuperPropertyAccessInAsync"] = 128] = "MethodWithSuperPropertyAccessInAsync";
|
|
3552
|
-
NodeCheckFlags3[NodeCheckFlags3["MethodWithSuperPropertyAssignmentInAsync"] = 256] = "MethodWithSuperPropertyAssignmentInAsync";
|
|
3553
|
-
NodeCheckFlags3[NodeCheckFlags3["CaptureArguments"] = 512] = "CaptureArguments";
|
|
3554
|
-
NodeCheckFlags3[NodeCheckFlags3["EnumValuesComputed"] = 1024] = "EnumValuesComputed";
|
|
3555
|
-
NodeCheckFlags3[NodeCheckFlags3["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass";
|
|
3556
|
-
NodeCheckFlags3[NodeCheckFlags3["LoopWithCapturedBlockScopedBinding"] = 4096] = "LoopWithCapturedBlockScopedBinding";
|
|
3557
|
-
NodeCheckFlags3[NodeCheckFlags3["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding";
|
|
3558
|
-
NodeCheckFlags3[NodeCheckFlags3["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding";
|
|
3559
|
-
NodeCheckFlags3[NodeCheckFlags3["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop";
|
|
3560
|
-
NodeCheckFlags3[NodeCheckFlags3["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter";
|
|
3561
|
-
NodeCheckFlags3[NodeCheckFlags3["AssignmentsMarked"] = 131072] = "AssignmentsMarked";
|
|
3562
|
-
NodeCheckFlags3[NodeCheckFlags3["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference";
|
|
3563
|
-
NodeCheckFlags3[NodeCheckFlags3["ConstructorReference"] = 536870912] = "ConstructorReference";
|
|
3564
|
-
NodeCheckFlags3[NodeCheckFlags3["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers";
|
|
3565
|
-
NodeCheckFlags3[NodeCheckFlags3["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer";
|
|
3566
|
-
NodeCheckFlags3[NodeCheckFlags3["InCheckIdentifier"] = 4194304] = "InCheckIdentifier";
|
|
3567
|
-
NodeCheckFlags3[NodeCheckFlags3["LazyFlags"] = 539358128] = "LazyFlags";
|
|
3568
|
-
return NodeCheckFlags3;
|
|
3569
|
-
})(NodeCheckFlags || {});
|
|
3570
3533
|
var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
3571
3534
|
TypeFlags2[TypeFlags2["Any"] = 1] = "Any";
|
|
3572
3535
|
TypeFlags2[TypeFlags2["Unknown"] = 2] = "Unknown";
|
|
@@ -35917,7 +35880,7 @@ var commandOptionsWithoutBuild = [
|
|
|
35917
35880
|
showInSimplifiedHelpView: false,
|
|
35918
35881
|
category: Diagnostics.Compiler_Diagnostics,
|
|
35919
35882
|
description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
|
|
35920
|
-
transpileOptionValue:
|
|
35883
|
+
transpileOptionValue: void 0,
|
|
35921
35884
|
defaultValueDescription: false,
|
|
35922
35885
|
affectsSemanticDiagnostics: true,
|
|
35923
35886
|
affectsBuildInfo: true,
|
|
@@ -45069,9 +45032,6 @@ function createTypeChecker(host) {
|
|
|
45069
45032
|
deferredDiagnosticsCallbacks.push(arg);
|
|
45070
45033
|
};
|
|
45071
45034
|
var cancellationToken;
|
|
45072
|
-
var requestedExternalEmitHelperNames = /* @__PURE__ */ new Set();
|
|
45073
|
-
var requestedExternalEmitHelpers;
|
|
45074
|
-
var externalHelpersModule;
|
|
45075
45035
|
var scanner;
|
|
45076
45036
|
var Symbol12 = objectAllocator.getSymbolConstructor();
|
|
45077
45037
|
var Type7 = objectAllocator.getTypeConstructor();
|
|
@@ -47714,22 +47674,10 @@ function createTypeChecker(host) {
|
|
|
47714
47674
|
return !!aliasDeclarationLinks.typeOnlyDeclaration;
|
|
47715
47675
|
}
|
|
47716
47676
|
function getTypeOnlyAliasDeclaration(symbol, include) {
|
|
47717
|
-
var _a;
|
|
47718
47677
|
if (!(symbol.flags & 2097152 /* Alias */)) {
|
|
47719
47678
|
return void 0;
|
|
47720
47679
|
}
|
|
47721
47680
|
const links = getSymbolLinks(symbol);
|
|
47722
|
-
if (links.typeOnlyDeclaration === void 0) {
|
|
47723
|
-
links.typeOnlyDeclaration = false;
|
|
47724
|
-
const resolved = resolveSymbol(symbol);
|
|
47725
|
-
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
47726
|
-
(_a = symbol.declarations) == null ? void 0 : _a[0],
|
|
47727
|
-
getDeclarationOfAliasSymbol(symbol) && getImmediateAliasedSymbol(symbol),
|
|
47728
|
-
resolved,
|
|
47729
|
-
/*overwriteEmpty*/
|
|
47730
|
-
true
|
|
47731
|
-
);
|
|
47732
|
-
}
|
|
47733
47681
|
if (include === void 0) {
|
|
47734
47682
|
return links.typeOnlyDeclaration || void 0;
|
|
47735
47683
|
}
|
|
@@ -59731,7 +59679,6 @@ function createTypeChecker(host) {
|
|
|
59731
59679
|
return links.resolvedType;
|
|
59732
59680
|
}
|
|
59733
59681
|
function getTemplateLiteralType(texts, types) {
|
|
59734
|
-
var _a, _b;
|
|
59735
59682
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
59736
59683
|
if (unionIndex >= 0) {
|
|
59737
59684
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -59739,9 +59686,6 @@ function createTypeChecker(host) {
|
|
|
59739
59686
|
if (contains(types, wildcardType)) {
|
|
59740
59687
|
return wildcardType;
|
|
59741
59688
|
}
|
|
59742
|
-
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
59743
|
-
return types[0];
|
|
59744
|
-
}
|
|
59745
59689
|
const newTypes = [];
|
|
59746
59690
|
const newTexts = [];
|
|
59747
59691
|
let text = texts[0];
|
|
@@ -65796,12 +65740,17 @@ function createTypeChecker(host) {
|
|
|
65796
65740
|
}
|
|
65797
65741
|
}
|
|
65798
65742
|
function applyToReturnTypes(source, target, callback) {
|
|
65799
|
-
const sourceTypePredicate = getTypePredicateOfSignature(source);
|
|
65800
65743
|
const targetTypePredicate = getTypePredicateOfSignature(target);
|
|
65801
|
-
if (
|
|
65802
|
-
|
|
65803
|
-
|
|
65804
|
-
|
|
65744
|
+
if (targetTypePredicate) {
|
|
65745
|
+
const sourceTypePredicate = getTypePredicateOfSignature(source);
|
|
65746
|
+
if (sourceTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {
|
|
65747
|
+
callback(sourceTypePredicate.type, targetTypePredicate.type);
|
|
65748
|
+
return;
|
|
65749
|
+
}
|
|
65750
|
+
}
|
|
65751
|
+
const targetReturnType = getReturnTypeOfSignature(target);
|
|
65752
|
+
if (couldContainTypeVariables(targetReturnType)) {
|
|
65753
|
+
callback(getReturnTypeOfSignature(source), targetReturnType);
|
|
65805
65754
|
}
|
|
65806
65755
|
}
|
|
65807
65756
|
function createInferenceContext(typeParameters, signature, flags, compareTypes) {
|
|
@@ -69226,6 +69175,9 @@ function createTypeChecker(host) {
|
|
|
69226
69175
|
if (isJsxOpeningLikeElement(location) || isJsxOpeningFragment(location)) {
|
|
69227
69176
|
return markJsxAliasReferenced(location);
|
|
69228
69177
|
}
|
|
69178
|
+
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
|
|
69179
|
+
return markAsyncFunctionAliasReferenced(location);
|
|
69180
|
+
}
|
|
69229
69181
|
if (isImportEqualsDeclaration(location)) {
|
|
69230
69182
|
if (isInternalModuleImportEqualsDeclaration(location) || checkExternalImportOrExportDeclaration(location)) {
|
|
69231
69183
|
return markImportEqualsAliasReferenced(location);
|
|
@@ -69235,9 +69187,6 @@ function createTypeChecker(host) {
|
|
|
69235
69187
|
if (isExportSpecifier(location)) {
|
|
69236
69188
|
return markExportSpecifierAliasReferenced(location);
|
|
69237
69189
|
}
|
|
69238
|
-
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
|
|
69239
|
-
markAsyncFunctionAliasReferenced(location);
|
|
69240
|
-
}
|
|
69241
69190
|
if (!compilerOptions.emitDecoratorMetadata) {
|
|
69242
69191
|
return;
|
|
69243
69192
|
}
|
|
@@ -69575,12 +69524,18 @@ function createTypeChecker(host) {
|
|
|
69575
69524
|
}
|
|
69576
69525
|
return type;
|
|
69577
69526
|
}
|
|
69578
|
-
function
|
|
69579
|
-
if (isThisInTypeQuery(node))
|
|
69527
|
+
function checkIdentifier(node, checkMode) {
|
|
69528
|
+
if (isThisInTypeQuery(node)) {
|
|
69529
|
+
return checkThisExpression(node);
|
|
69530
|
+
}
|
|
69531
|
+
const symbol = getResolvedSymbol(node);
|
|
69532
|
+
if (symbol === unknownSymbol) {
|
|
69533
|
+
return errorType;
|
|
69534
|
+
}
|
|
69580
69535
|
if (symbol === argumentsSymbol) {
|
|
69581
69536
|
if (isInPropertyInitializerOrClassStaticBlock(node)) {
|
|
69582
69537
|
error(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers);
|
|
69583
|
-
return;
|
|
69538
|
+
return errorType;
|
|
69584
69539
|
}
|
|
69585
69540
|
let container = getContainingFunction(node);
|
|
69586
69541
|
if (container) {
|
|
@@ -69599,14 +69554,17 @@ function createTypeChecker(host) {
|
|
|
69599
69554
|
}
|
|
69600
69555
|
}
|
|
69601
69556
|
}
|
|
69602
|
-
return;
|
|
69557
|
+
return getTypeOfSymbol(symbol);
|
|
69558
|
+
}
|
|
69559
|
+
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
69560
|
+
markLinkedReferences(node, 1 /* Identifier */);
|
|
69603
69561
|
}
|
|
69604
69562
|
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
69605
69563
|
const targetSymbol = resolveAliasWithDeprecationCheck(localOrExportSymbol, node);
|
|
69606
69564
|
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
69607
69565
|
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
69608
69566
|
}
|
|
69609
|
-
|
|
69567
|
+
let declaration = localOrExportSymbol.valueDeclaration;
|
|
69610
69568
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
69611
69569
|
if (isClassLike(declaration) && declaration.name !== node) {
|
|
69612
69570
|
let container = getThisContainer(
|
|
@@ -69633,27 +69591,6 @@ function createTypeChecker(host) {
|
|
|
69633
69591
|
}
|
|
69634
69592
|
}
|
|
69635
69593
|
checkNestedBlockScopedBinding(node, symbol);
|
|
69636
|
-
}
|
|
69637
|
-
function checkIdentifier(node, checkMode) {
|
|
69638
|
-
if (isThisInTypeQuery(node)) {
|
|
69639
|
-
return checkThisExpression(node);
|
|
69640
|
-
}
|
|
69641
|
-
const symbol = getResolvedSymbol(node);
|
|
69642
|
-
if (symbol === unknownSymbol) {
|
|
69643
|
-
return errorType;
|
|
69644
|
-
}
|
|
69645
|
-
checkIdentifierCalculateNodeCheckFlags(node, symbol);
|
|
69646
|
-
if (symbol === argumentsSymbol) {
|
|
69647
|
-
if (isInPropertyInitializerOrClassStaticBlock(node)) {
|
|
69648
|
-
return errorType;
|
|
69649
|
-
}
|
|
69650
|
-
return getTypeOfSymbol(symbol);
|
|
69651
|
-
}
|
|
69652
|
-
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
69653
|
-
markLinkedReferences(node, 1 /* Identifier */);
|
|
69654
|
-
}
|
|
69655
|
-
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
69656
|
-
let declaration = localOrExportSymbol.valueDeclaration;
|
|
69657
69594
|
let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node, checkMode);
|
|
69658
69595
|
const assignmentKind = getAssignmentTargetKind(node);
|
|
69659
69596
|
if (assignmentKind) {
|
|
@@ -84640,6 +84577,7 @@ function createTypeChecker(host) {
|
|
|
84640
84577
|
if (links.isDeclarationWithCollidingName === void 0) {
|
|
84641
84578
|
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
|
|
84642
84579
|
if (isStatementWithLocals(container) || isSymbolOfDestructuredElementOfCatchBinding(symbol)) {
|
|
84580
|
+
const nodeLinks2 = getNodeLinks(symbol.valueDeclaration);
|
|
84643
84581
|
if (resolveName(
|
|
84644
84582
|
container.parent,
|
|
84645
84583
|
symbol.escapedName,
|
|
@@ -84650,8 +84588,8 @@ function createTypeChecker(host) {
|
|
|
84650
84588
|
false
|
|
84651
84589
|
)) {
|
|
84652
84590
|
links.isDeclarationWithCollidingName = true;
|
|
84653
|
-
} else if (
|
|
84654
|
-
const isDeclaredInLoop =
|
|
84591
|
+
} else if (nodeLinks2.flags & 16384 /* CapturedBlockScopedBinding */) {
|
|
84592
|
+
const isDeclaredInLoop = nodeLinks2.flags & 32768 /* BlockScopedBindingInLoop */;
|
|
84655
84593
|
const inLoopInitializer = isIterationStatement(
|
|
84656
84594
|
container,
|
|
84657
84595
|
/*lookInLabeledStatements*/
|
|
@@ -84733,9 +84671,6 @@ function createTypeChecker(host) {
|
|
|
84733
84671
|
if (!symbol) {
|
|
84734
84672
|
return false;
|
|
84735
84673
|
}
|
|
84736
|
-
const container = getSourceFileOfNode(symbol.valueDeclaration);
|
|
84737
|
-
const fileSymbol = container && getSymbolOfDeclaration(container);
|
|
84738
|
-
void resolveExternalModuleSymbol(fileSymbol);
|
|
84739
84674
|
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
|
|
84740
84675
|
if (target === unknownSymbol) {
|
|
84741
84676
|
return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -84834,108 +84769,6 @@ function createTypeChecker(host) {
|
|
|
84834
84769
|
if (nodeId < 0 || nodeId >= nodeLinks.length) return 0;
|
|
84835
84770
|
return ((_a = nodeLinks[nodeId]) == null ? void 0 : _a.flags) || 0;
|
|
84836
84771
|
}
|
|
84837
|
-
function hasNodeCheckFlag(node, flag) {
|
|
84838
|
-
calculateNodeCheckFlagWorker(node, flag);
|
|
84839
|
-
return !!(getNodeCheckFlags(node) & flag);
|
|
84840
|
-
}
|
|
84841
|
-
function calculateNodeCheckFlagWorker(node, flag) {
|
|
84842
|
-
if (!compilerOptions.noCheck) {
|
|
84843
|
-
return;
|
|
84844
|
-
}
|
|
84845
|
-
const links = getNodeLinks(node);
|
|
84846
|
-
if (links.calculatedFlags & flag) {
|
|
84847
|
-
return;
|
|
84848
|
-
}
|
|
84849
|
-
switch (flag) {
|
|
84850
|
-
case 16 /* SuperInstance */:
|
|
84851
|
-
case 32 /* SuperStatic */:
|
|
84852
|
-
return checkSingleSuperExpression(node);
|
|
84853
|
-
case 128 /* MethodWithSuperPropertyAccessInAsync */:
|
|
84854
|
-
case 256 /* MethodWithSuperPropertyAssignmentInAsync */:
|
|
84855
|
-
case 2097152 /* ContainsSuperPropertyInStaticInitializer */:
|
|
84856
|
-
return checkChildSuperExpressions(node);
|
|
84857
|
-
case 512 /* CaptureArguments */:
|
|
84858
|
-
case 8192 /* ContainsCapturedBlockScopeBinding */:
|
|
84859
|
-
case 65536 /* NeedsLoopOutParameter */:
|
|
84860
|
-
case 262144 /* ContainsConstructorReference */:
|
|
84861
|
-
return checkChildIdentifiers(node);
|
|
84862
|
-
case 536870912 /* ConstructorReference */:
|
|
84863
|
-
return checkSingleIdentifier(node);
|
|
84864
|
-
case 4096 /* LoopWithCapturedBlockScopedBinding */:
|
|
84865
|
-
case 32768 /* BlockScopedBindingInLoop */:
|
|
84866
|
-
case 16384 /* CapturedBlockScopedBinding */:
|
|
84867
|
-
return checkContainingBlockScopeBindingUses(node);
|
|
84868
|
-
default:
|
|
84869
|
-
return Debug.assertNever(flag, `Unhandled node check flag calculation: ${Debug.formatNodeCheckFlags(flag)}`);
|
|
84870
|
-
}
|
|
84871
|
-
function forEachNodeRecursively(root, cb) {
|
|
84872
|
-
const rootResult = cb(root, root.parent);
|
|
84873
|
-
if (rootResult === "skip") return void 0;
|
|
84874
|
-
if (rootResult) return rootResult;
|
|
84875
|
-
return forEachChildRecursively(root, cb);
|
|
84876
|
-
}
|
|
84877
|
-
function checkSuperExpressions(node2) {
|
|
84878
|
-
const links2 = getNodeLinks(node2);
|
|
84879
|
-
if (links2.calculatedFlags & flag) return "skip";
|
|
84880
|
-
links2.calculatedFlags |= 128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */ | 2097152 /* ContainsSuperPropertyInStaticInitializer */;
|
|
84881
|
-
checkSingleSuperExpression(node2);
|
|
84882
|
-
return void 0;
|
|
84883
|
-
}
|
|
84884
|
-
function checkChildSuperExpressions(node2) {
|
|
84885
|
-
forEachNodeRecursively(node2, checkSuperExpressions);
|
|
84886
|
-
}
|
|
84887
|
-
function checkSingleSuperExpression(node2) {
|
|
84888
|
-
const nodeLinks2 = getNodeLinks(node2);
|
|
84889
|
-
nodeLinks2.calculatedFlags |= 16 /* SuperInstance */ | 32 /* SuperStatic */;
|
|
84890
|
-
if (node2.kind === 108 /* SuperKeyword */) {
|
|
84891
|
-
checkSuperExpression(node2);
|
|
84892
|
-
}
|
|
84893
|
-
}
|
|
84894
|
-
function checkIdentifiers(node2) {
|
|
84895
|
-
const links2 = getNodeLinks(node2);
|
|
84896
|
-
if (links2.calculatedFlags & flag) return "skip";
|
|
84897
|
-
links2.calculatedFlags |= 512 /* CaptureArguments */ | 8192 /* ContainsCapturedBlockScopeBinding */ | 65536 /* NeedsLoopOutParameter */ | 262144 /* ContainsConstructorReference */;
|
|
84898
|
-
checkSingleIdentifier(node2);
|
|
84899
|
-
return void 0;
|
|
84900
|
-
}
|
|
84901
|
-
function checkChildIdentifiers(node2) {
|
|
84902
|
-
forEachNodeRecursively(node2, checkIdentifiers);
|
|
84903
|
-
}
|
|
84904
|
-
function checkSingleIdentifier(node2) {
|
|
84905
|
-
const nodeLinks2 = getNodeLinks(node2);
|
|
84906
|
-
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */ | 16384 /* CapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */;
|
|
84907
|
-
if (isIdentifier(node2) && isExpressionNode(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
84908
|
-
const s = getSymbolAtLocation(
|
|
84909
|
-
node2,
|
|
84910
|
-
/*ignoreErrors*/
|
|
84911
|
-
true
|
|
84912
|
-
);
|
|
84913
|
-
if (s && s !== unknownSymbol) {
|
|
84914
|
-
checkIdentifierCalculateNodeCheckFlags(node2, s);
|
|
84915
|
-
}
|
|
84916
|
-
}
|
|
84917
|
-
}
|
|
84918
|
-
function checkBlockScopeBindings(node2) {
|
|
84919
|
-
const links2 = getNodeLinks(node2);
|
|
84920
|
-
if (links2.calculatedFlags & flag) return "skip";
|
|
84921
|
-
links2.calculatedFlags |= 4096 /* LoopWithCapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */ | 16384 /* CapturedBlockScopedBinding */;
|
|
84922
|
-
checkSingleBlockScopeBinding(node2);
|
|
84923
|
-
return void 0;
|
|
84924
|
-
}
|
|
84925
|
-
function checkContainingBlockScopeBindingUses(node2) {
|
|
84926
|
-
const scope = getEnclosingBlockScopeContainer(isDeclarationName(node2) ? node2.parent : node2);
|
|
84927
|
-
forEachNodeRecursively(scope, checkBlockScopeBindings);
|
|
84928
|
-
}
|
|
84929
|
-
function checkSingleBlockScopeBinding(node2) {
|
|
84930
|
-
checkSingleIdentifier(node2);
|
|
84931
|
-
if (isComputedPropertyName(node2)) {
|
|
84932
|
-
checkComputedPropertyName(node2);
|
|
84933
|
-
}
|
|
84934
|
-
if (isPrivateIdentifier(node2) && isClassElement(node2.parent)) {
|
|
84935
|
-
setNodeLinksForPrivateIdentifierScope(node2.parent);
|
|
84936
|
-
}
|
|
84937
|
-
}
|
|
84938
|
-
}
|
|
84939
84772
|
function getEnumMemberValue(node) {
|
|
84940
84773
|
computeEnumMemberValues(node.parent);
|
|
84941
84774
|
return getNodeLinks(node).enumMemberValue ?? evaluatorResult(
|
|
@@ -84956,15 +84789,7 @@ function createTypeChecker(host) {
|
|
|
84956
84789
|
if (node.kind === 306 /* EnumMember */) {
|
|
84957
84790
|
return getEnumMemberValue(node).value;
|
|
84958
84791
|
}
|
|
84959
|
-
|
|
84960
|
-
void checkExpressionCached(node);
|
|
84961
|
-
}
|
|
84962
|
-
const symbol = getNodeLinks(node).resolvedSymbol || (isEntityNameExpression(node) ? resolveEntityName(
|
|
84963
|
-
node,
|
|
84964
|
-
111551 /* Value */,
|
|
84965
|
-
/*ignoreErrors*/
|
|
84966
|
-
true
|
|
84967
|
-
) : void 0);
|
|
84792
|
+
const symbol = getNodeLinks(node).resolvedSymbol;
|
|
84968
84793
|
if (symbol && symbol.flags & 8 /* EnumMember */) {
|
|
84969
84794
|
const member = symbol.valueDeclaration;
|
|
84970
84795
|
if (isEnumConst(member.parent)) {
|
|
@@ -85315,10 +85140,9 @@ function createTypeChecker(host) {
|
|
|
85315
85140
|
const node = getParseTreeNode(nodeIn);
|
|
85316
85141
|
return node && canCollectSymbolAliasAccessabilityData ? isReferencedAliasDeclaration(node, checkChildren) : true;
|
|
85317
85142
|
},
|
|
85318
|
-
|
|
85143
|
+
getNodeCheckFlags: (nodeIn) => {
|
|
85319
85144
|
const node = getParseTreeNode(nodeIn);
|
|
85320
|
-
|
|
85321
|
-
return hasNodeCheckFlag(node, flag);
|
|
85145
|
+
return node ? getNodeCheckFlags(node) : 0;
|
|
85322
85146
|
},
|
|
85323
85147
|
isTopLevelValueImportEqualsWithEntityName,
|
|
85324
85148
|
isDeclarationVisible,
|
|
@@ -85341,10 +85165,6 @@ function createTypeChecker(host) {
|
|
|
85341
85165
|
return node ? getEnumMemberValue(node) : void 0;
|
|
85342
85166
|
},
|
|
85343
85167
|
collectLinkedAliases,
|
|
85344
|
-
markLinkedReferences: (nodeIn) => {
|
|
85345
|
-
const node = getParseTreeNode(nodeIn);
|
|
85346
|
-
return node && markLinkedReferences(node, 0 /* Unspecified */);
|
|
85347
|
-
},
|
|
85348
85168
|
getReferencedValueDeclaration,
|
|
85349
85169
|
getReferencedValueDeclarations,
|
|
85350
85170
|
getTypeReferenceSerializationKind,
|
|
@@ -85591,38 +85411,40 @@ function createTypeChecker(host) {
|
|
|
85591
85411
|
amalgamatedDuplicates = void 0;
|
|
85592
85412
|
}
|
|
85593
85413
|
function checkExternalEmitHelpers(location, helpers) {
|
|
85594
|
-
if (
|
|
85414
|
+
if (compilerOptions.importHelpers) {
|
|
85595
85415
|
const sourceFile = getSourceFileOfNode(location);
|
|
85596
85416
|
if (isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 33554432 /* Ambient */)) {
|
|
85597
85417
|
const helpersModule = resolveHelpersModule(sourceFile, location);
|
|
85598
85418
|
if (helpersModule !== unknownSymbol) {
|
|
85599
|
-
const
|
|
85600
|
-
|
|
85601
|
-
|
|
85602
|
-
|
|
85603
|
-
|
|
85604
|
-
|
|
85605
|
-
const
|
|
85606
|
-
|
|
85607
|
-
|
|
85608
|
-
|
|
85609
|
-
if (
|
|
85610
|
-
|
|
85611
|
-
|
|
85612
|
-
|
|
85613
|
-
if (
|
|
85614
|
-
|
|
85615
|
-
|
|
85616
|
-
|
|
85617
|
-
if (
|
|
85618
|
-
|
|
85419
|
+
const links = getSymbolLinks(helpersModule);
|
|
85420
|
+
links.requestedExternalEmitHelpers ?? (links.requestedExternalEmitHelpers = 0);
|
|
85421
|
+
if ((links.requestedExternalEmitHelpers & helpers) !== helpers) {
|
|
85422
|
+
const uncheckedHelpers = helpers & ~links.requestedExternalEmitHelpers;
|
|
85423
|
+
for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) {
|
|
85424
|
+
if (uncheckedHelpers & helper) {
|
|
85425
|
+
for (const name of getHelperNames(helper)) {
|
|
85426
|
+
const symbol = resolveSymbol(getSymbol(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */));
|
|
85427
|
+
if (!symbol) {
|
|
85428
|
+
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
|
|
85429
|
+
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|
|
85430
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) {
|
|
85431
|
+
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4);
|
|
85432
|
+
}
|
|
85433
|
+
} else if (helper & 1048576 /* ClassPrivateFieldSet */) {
|
|
85434
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) {
|
|
85435
|
+
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5);
|
|
85436
|
+
}
|
|
85437
|
+
} else if (helper & 1024 /* SpreadArray */) {
|
|
85438
|
+
if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) {
|
|
85439
|
+
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3);
|
|
85440
|
+
}
|
|
85619
85441
|
}
|
|
85620
85442
|
}
|
|
85621
85443
|
}
|
|
85622
85444
|
}
|
|
85623
85445
|
}
|
|
85446
|
+
links.requestedExternalEmitHelpers |= helpers;
|
|
85624
85447
|
}
|
|
85625
|
-
requestedExternalEmitHelpers |= helpers;
|
|
85626
85448
|
}
|
|
85627
85449
|
}
|
|
85628
85450
|
}
|
|
@@ -85683,10 +85505,11 @@ function createTypeChecker(host) {
|
|
|
85683
85505
|
}
|
|
85684
85506
|
}
|
|
85685
85507
|
function resolveHelpersModule(file, errorNode) {
|
|
85686
|
-
|
|
85687
|
-
|
|
85508
|
+
const links = getNodeLinks(file);
|
|
85509
|
+
if (!links.externalHelpersModule) {
|
|
85510
|
+
links.externalHelpersModule = resolveExternalModule(getImportHelpersImportSpecifier(file), externalHelpersModuleNameText, Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol;
|
|
85688
85511
|
}
|
|
85689
|
-
return externalHelpersModule;
|
|
85512
|
+
return links.externalHelpersModule;
|
|
85690
85513
|
}
|
|
85691
85514
|
function checkGrammarModifiers(node) {
|
|
85692
85515
|
var _a;
|
|
@@ -89076,8 +88899,8 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89076
88899
|
const exportSpecifiers = new IdentifierNameMultiMap();
|
|
89077
88900
|
const exportedBindings = [];
|
|
89078
88901
|
const uniqueExports = /* @__PURE__ */ new Map();
|
|
88902
|
+
const exportedFunctions = /* @__PURE__ */ new Set();
|
|
89079
88903
|
let exportedNames;
|
|
89080
|
-
let exportedFunctions;
|
|
89081
88904
|
let hasExportDefault = false;
|
|
89082
88905
|
let exportEquals;
|
|
89083
88906
|
let hasExportStarsToExportValues = false;
|
|
@@ -89137,19 +88960,12 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89137
88960
|
break;
|
|
89138
88961
|
case 262 /* FunctionDeclaration */:
|
|
89139
88962
|
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
89140
|
-
|
|
89141
|
-
|
|
89142
|
-
|
|
89143
|
-
|
|
89144
|
-
|
|
89145
|
-
|
|
89146
|
-
} else {
|
|
89147
|
-
const name = node.name;
|
|
89148
|
-
if (!uniqueExports.get(idText(name))) {
|
|
89149
|
-
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
89150
|
-
uniqueExports.set(idText(name), true);
|
|
89151
|
-
}
|
|
89152
|
-
}
|
|
88963
|
+
addExportedFunctionDeclaration(
|
|
88964
|
+
node,
|
|
88965
|
+
/*name*/
|
|
88966
|
+
void 0,
|
|
88967
|
+
hasSyntacticModifier(node, 2048 /* Default */)
|
|
88968
|
+
);
|
|
89153
88969
|
}
|
|
89154
88970
|
break;
|
|
89155
88971
|
case 263 /* ClassDeclaration */:
|
|
@@ -89185,6 +89001,10 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89185
89001
|
}
|
|
89186
89002
|
const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
|
|
89187
89003
|
if (decl) {
|
|
89004
|
+
if (decl.kind === 262 /* FunctionDeclaration */) {
|
|
89005
|
+
addExportedFunctionDeclaration(decl, specifier.name, specifier.name.escapedText === "default" /* Default */);
|
|
89006
|
+
continue;
|
|
89007
|
+
}
|
|
89188
89008
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
|
|
89189
89009
|
}
|
|
89190
89010
|
uniqueExports.set(idText(specifier.name), true);
|
|
@@ -89192,6 +89012,21 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89192
89012
|
}
|
|
89193
89013
|
}
|
|
89194
89014
|
}
|
|
89015
|
+
function addExportedFunctionDeclaration(node, name, isDefault) {
|
|
89016
|
+
exportedFunctions.add(node);
|
|
89017
|
+
if (isDefault) {
|
|
89018
|
+
if (!hasExportDefault) {
|
|
89019
|
+
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name ?? context.factory.getDeclarationName(node));
|
|
89020
|
+
hasExportDefault = true;
|
|
89021
|
+
}
|
|
89022
|
+
} else {
|
|
89023
|
+
name ?? (name = node.name);
|
|
89024
|
+
if (!uniqueExports.get(idText(name))) {
|
|
89025
|
+
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
89026
|
+
uniqueExports.set(idText(name), true);
|
|
89027
|
+
}
|
|
89028
|
+
}
|
|
89029
|
+
}
|
|
89195
89030
|
}
|
|
89196
89031
|
function collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings) {
|
|
89197
89032
|
if (isBindingPattern(decl.name)) {
|
|
@@ -93136,7 +92971,7 @@ function transformClassFields(context) {
|
|
|
93136
92971
|
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
|
|
93137
92972
|
} else if (isPrivateIdentifierClassElementDeclaration(member)) {
|
|
93138
92973
|
containsInstancePrivateElements = true;
|
|
93139
|
-
if (resolver.
|
|
92974
|
+
if (resolver.getNodeCheckFlags(member) & 262144 /* ContainsConstructorReference */) {
|
|
93140
92975
|
facts |= 2 /* NeedsClassConstructorReference */;
|
|
93141
92976
|
}
|
|
93142
92977
|
} else if (isPropertyDeclaration(member)) {
|
|
@@ -93243,7 +93078,7 @@ function transformClassFields(context) {
|
|
|
93243
93078
|
if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
|
|
93244
93079
|
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
93245
93080
|
}
|
|
93246
|
-
const isClassWithConstructorReference = resolver.
|
|
93081
|
+
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
|
|
93247
93082
|
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
93248
93083
|
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
93249
93084
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
@@ -93305,14 +93140,15 @@ function transformClassFields(context) {
|
|
|
93305
93140
|
var _a, _b, _c;
|
|
93306
93141
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
93307
93142
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
93308
|
-
const
|
|
93309
|
-
const
|
|
93143
|
+
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
93144
|
+
const isClassWithConstructorReference = classCheckFlags & 262144 /* ContainsConstructorReference */;
|
|
93310
93145
|
let temp;
|
|
93311
93146
|
function createClassTempVar() {
|
|
93312
93147
|
var _a2;
|
|
93313
93148
|
if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) {
|
|
93314
93149
|
return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
|
|
93315
93150
|
}
|
|
93151
|
+
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
93316
93152
|
const temp2 = factory2.createTempVariable(
|
|
93317
93153
|
requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
|
|
93318
93154
|
/*reservedInNestedScopes*/
|
|
@@ -93880,7 +93716,7 @@ function transformClassFields(context) {
|
|
|
93880
93716
|
const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left);
|
|
93881
93717
|
if (!alreadyTransformed && !inlinable && shouldHoist) {
|
|
93882
93718
|
const generatedName = factory2.getGeneratedNameForNode(name);
|
|
93883
|
-
if (resolver.
|
|
93719
|
+
if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) {
|
|
93884
93720
|
addBlockScopedVariable(generatedName);
|
|
93885
93721
|
} else {
|
|
93886
93722
|
hoistVariableDeclaration(generatedName);
|
|
@@ -94034,7 +93870,7 @@ function transformClassFields(context) {
|
|
|
94034
93870
|
prefix,
|
|
94035
93871
|
suffix
|
|
94036
93872
|
);
|
|
94037
|
-
if (resolver.
|
|
93873
|
+
if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) {
|
|
94038
93874
|
addBlockScopedVariable(identifier);
|
|
94039
93875
|
} else {
|
|
94040
93876
|
hoistVariableDeclaration(identifier);
|
|
@@ -94273,7 +94109,7 @@ function transformClassFields(context) {
|
|
|
94273
94109
|
}
|
|
94274
94110
|
function trySubstituteClassAlias(node) {
|
|
94275
94111
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
94276
|
-
if (resolver.
|
|
94112
|
+
if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
|
|
94277
94113
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
94278
94114
|
if (declaration) {
|
|
94279
94115
|
const classAlias = classAliases[declaration.id];
|
|
@@ -95140,7 +94976,7 @@ function transformLegacyDecorators(context) {
|
|
|
95140
94976
|
}
|
|
95141
94977
|
}
|
|
95142
94978
|
function getClassAliasIfNeeded(node) {
|
|
95143
|
-
if (resolver.
|
|
94979
|
+
if (resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */) {
|
|
95144
94980
|
enableSubstitutionForClassAliases();
|
|
95145
94981
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
95146
94982
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -95173,7 +95009,7 @@ function transformLegacyDecorators(context) {
|
|
|
95173
95009
|
}
|
|
95174
95010
|
function trySubstituteClassAlias(node) {
|
|
95175
95011
|
if (classAliases) {
|
|
95176
|
-
if (resolver.
|
|
95012
|
+
if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
|
|
95177
95013
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
95178
95014
|
if (declaration) {
|
|
95179
95015
|
const classAlias = classAliases[declaration.id];
|
|
@@ -97482,7 +97318,7 @@ function transformES2017(context) {
|
|
|
97482
97318
|
hasSuperElementAccess = false;
|
|
97483
97319
|
let updated = visitFunctionBody(node.body, visitor, context);
|
|
97484
97320
|
const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration);
|
|
97485
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ &&
|
|
97321
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
|
|
97486
97322
|
if (emitSuperHelpers) {
|
|
97487
97323
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
97488
97324
|
if (capturedSuperProperties.size) {
|
|
@@ -97493,9 +97329,9 @@ function transformES2017(context) {
|
|
|
97493
97329
|
updated = factory2.updateBlock(updated, statements);
|
|
97494
97330
|
}
|
|
97495
97331
|
if (hasSuperElementAccess) {
|
|
97496
|
-
if (resolver.
|
|
97332
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
97497
97333
|
addEmitHelper(updated, advancedAsyncSuperHelper);
|
|
97498
|
-
} else if (resolver.
|
|
97334
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
97499
97335
|
addEmitHelper(updated, asyncSuperHelper);
|
|
97500
97336
|
}
|
|
97501
97337
|
}
|
|
@@ -97562,7 +97398,7 @@ function transformES2017(context) {
|
|
|
97562
97398
|
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
|
|
97563
97399
|
const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
|
|
97564
97400
|
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
97565
|
-
const hasLexicalArguments = resolver.
|
|
97401
|
+
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
|
|
97566
97402
|
const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding;
|
|
97567
97403
|
if (captureLexicalArguments) {
|
|
97568
97404
|
lexicalArgumentsBinding = factory2.createUniqueName("arguments");
|
|
@@ -97617,7 +97453,7 @@ function transformES2017(context) {
|
|
|
97617
97453
|
)
|
|
97618
97454
|
)
|
|
97619
97455
|
);
|
|
97620
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ &&
|
|
97456
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
97621
97457
|
if (emitSuperHelpers) {
|
|
97622
97458
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
97623
97459
|
if (capturedSuperProperties.size) {
|
|
@@ -97636,9 +97472,9 @@ function transformES2017(context) {
|
|
|
97636
97472
|
);
|
|
97637
97473
|
setTextRange(block, node.body);
|
|
97638
97474
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
97639
|
-
if (resolver.
|
|
97475
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
97640
97476
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
97641
|
-
} else if (resolver.
|
|
97477
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
97642
97478
|
addEmitHelper(block, asyncSuperHelper);
|
|
97643
97479
|
}
|
|
97644
97480
|
}
|
|
@@ -97697,7 +97533,7 @@ function transformES2017(context) {
|
|
|
97697
97533
|
}
|
|
97698
97534
|
function onEmitNode(hint, node, emitCallback) {
|
|
97699
97535
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
97700
|
-
const superContainerFlags =
|
|
97536
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
97701
97537
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
97702
97538
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
97703
97539
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -97801,7 +97637,7 @@ function transformES2017(context) {
|
|
|
97801
97637
|
}
|
|
97802
97638
|
}
|
|
97803
97639
|
function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
97804
|
-
const hasBinding = resolver.
|
|
97640
|
+
const hasBinding = (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) !== 0;
|
|
97805
97641
|
const accessors = [];
|
|
97806
97642
|
names.forEach((_, key) => {
|
|
97807
97643
|
const name = unescapeLeadingUnderscores(key);
|
|
@@ -98896,7 +98732,7 @@ function transformES2018(context) {
|
|
|
98896
98732
|
!!(hierarchyFacts & 1 /* HasLexicalThis */)
|
|
98897
98733
|
)
|
|
98898
98734
|
);
|
|
98899
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ &&
|
|
98735
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
98900
98736
|
if (emitSuperHelpers) {
|
|
98901
98737
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
98902
98738
|
const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
|
|
@@ -98906,9 +98742,9 @@ function transformES2018(context) {
|
|
|
98906
98742
|
outerStatements.push(returnStatement);
|
|
98907
98743
|
const block = factory2.updateBlock(node.body, outerStatements);
|
|
98908
98744
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
98909
|
-
if (resolver.
|
|
98745
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
98910
98746
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
98911
|
-
} else if (resolver.
|
|
98747
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
98912
98748
|
addEmitHelper(block, asyncSuperHelper);
|
|
98913
98749
|
}
|
|
98914
98750
|
}
|
|
@@ -99041,7 +98877,7 @@ function transformES2018(context) {
|
|
|
99041
98877
|
}
|
|
99042
98878
|
function onEmitNode(hint, node, emitCallback) {
|
|
99043
98879
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
99044
|
-
const superContainerFlags =
|
|
98880
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
99045
98881
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
99046
98882
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
99047
98883
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -102746,8 +102582,9 @@ function transformES2015(context) {
|
|
|
102746
102582
|
return createRange(pos, end);
|
|
102747
102583
|
}
|
|
102748
102584
|
function shouldEmitExplicitInitializerForLetDeclaration(node) {
|
|
102749
|
-
const
|
|
102750
|
-
const
|
|
102585
|
+
const flags = resolver.getNodeCheckFlags(node);
|
|
102586
|
+
const isCapturedInFunction = flags & 16384 /* CapturedBlockScopedBinding */;
|
|
102587
|
+
const isDeclaredInLoop = flags & 32768 /* BlockScopedBindingInLoop */;
|
|
102751
102588
|
const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0;
|
|
102752
102589
|
const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0);
|
|
102753
102590
|
return emitExplicitInitializer;
|
|
@@ -103198,7 +103035,7 @@ function transformES2015(context) {
|
|
|
103198
103035
|
return factory2.inlineExpressions(expressions);
|
|
103199
103036
|
}
|
|
103200
103037
|
function shouldConvertPartOfIterationStatement(node) {
|
|
103201
|
-
return resolver.
|
|
103038
|
+
return (resolver.getNodeCheckFlags(node) & 8192 /* ContainsCapturedBlockScopeBinding */) !== 0;
|
|
103202
103039
|
}
|
|
103203
103040
|
function shouldConvertInitializerOfForStatement(node) {
|
|
103204
103041
|
return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);
|
|
@@ -103213,7 +103050,7 @@ function transformES2015(context) {
|
|
|
103213
103050
|
return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node);
|
|
103214
103051
|
}
|
|
103215
103052
|
function shouldConvertBodyOfIterationStatement(node) {
|
|
103216
|
-
return resolver.
|
|
103053
|
+
return (resolver.getNodeCheckFlags(node) & 4096 /* LoopWithCapturedBlockScopedBinding */) !== 0;
|
|
103217
103054
|
}
|
|
103218
103055
|
function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
|
|
103219
103056
|
if (!state.hoistedLocalVariables) {
|
|
@@ -103762,11 +103599,11 @@ function transformES2015(context) {
|
|
|
103762
103599
|
void 0,
|
|
103763
103600
|
name
|
|
103764
103601
|
));
|
|
103765
|
-
const
|
|
103766
|
-
if (
|
|
103602
|
+
const checkFlags = resolver.getNodeCheckFlags(decl);
|
|
103603
|
+
if (checkFlags & 65536 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
|
|
103767
103604
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
103768
103605
|
let flags = 0 /* None */;
|
|
103769
|
-
if (
|
|
103606
|
+
if (checkFlags & 65536 /* NeedsLoopOutParameter */) {
|
|
103770
103607
|
flags |= 1 /* Body */;
|
|
103771
103608
|
}
|
|
103772
103609
|
if (isForStatement(container)) {
|
|
@@ -106472,10 +106309,8 @@ function transformModule(context) {
|
|
|
106472
106309
|
);
|
|
106473
106310
|
}
|
|
106474
106311
|
}
|
|
106475
|
-
|
|
106476
|
-
|
|
106477
|
-
appendExportsOfHoistedDeclaration(statements, f);
|
|
106478
|
-
}
|
|
106312
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
106313
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
106479
106314
|
}
|
|
106480
106315
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
106481
106316
|
addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset));
|
|
@@ -106792,10 +106627,8 @@ function transformModule(context) {
|
|
|
106792
106627
|
if (some(currentModuleInfo.exportedNames)) {
|
|
106793
106628
|
append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
|
|
106794
106629
|
}
|
|
106795
|
-
|
|
106796
|
-
|
|
106797
|
-
appendExportsOfHoistedDeclaration(statements, f);
|
|
106798
|
-
}
|
|
106630
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
106631
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
106799
106632
|
}
|
|
106800
106633
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
106801
106634
|
if (moduleKind === 2 /* AMD */) {
|
|
@@ -108509,7 +108342,7 @@ function transformSystemModule(context) {
|
|
|
108509
108342
|
if (!moduleInfo.hasExportStarsToExportValues) {
|
|
108510
108343
|
return;
|
|
108511
108344
|
}
|
|
108512
|
-
if (!some(moduleInfo.exportedNames) &&
|
|
108345
|
+
if (!some(moduleInfo.exportedNames) && moduleInfo.exportedFunctions.size === 0 && moduleInfo.exportSpecifiers.size === 0) {
|
|
108513
108346
|
let hasExportDeclarationWithExportClause = false;
|
|
108514
108347
|
for (const externalImport of moduleInfo.externalImports) {
|
|
108515
108348
|
if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) {
|
|
@@ -108540,19 +108373,17 @@ function transformSystemModule(context) {
|
|
|
108540
108373
|
);
|
|
108541
108374
|
}
|
|
108542
108375
|
}
|
|
108543
|
-
|
|
108544
|
-
|
|
108545
|
-
|
|
108546
|
-
continue;
|
|
108547
|
-
}
|
|
108548
|
-
Debug.assert(!!f.name);
|
|
108549
|
-
exportedNames.push(
|
|
108550
|
-
factory2.createPropertyAssignment(
|
|
108551
|
-
factory2.createStringLiteralFromNode(f.name),
|
|
108552
|
-
factory2.createTrue()
|
|
108553
|
-
)
|
|
108554
|
-
);
|
|
108376
|
+
for (const f of moduleInfo.exportedFunctions) {
|
|
108377
|
+
if (hasSyntacticModifier(f, 2048 /* Default */)) {
|
|
108378
|
+
continue;
|
|
108555
108379
|
}
|
|
108380
|
+
Debug.assert(!!f.name);
|
|
108381
|
+
exportedNames.push(
|
|
108382
|
+
factory2.createPropertyAssignment(
|
|
108383
|
+
factory2.createStringLiteralFromNode(f.name),
|
|
108384
|
+
factory2.createTrue()
|
|
108385
|
+
)
|
|
108386
|
+
);
|
|
108556
108387
|
}
|
|
108557
108388
|
const exportedNamesStorageRef = factory2.createUniqueName("exportedNames");
|
|
108558
108389
|
statements.push(
|
|
@@ -112795,9 +112626,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
112795
112626
|
emitSkipped = true;
|
|
112796
112627
|
return;
|
|
112797
112628
|
}
|
|
112798
|
-
if (compilerOptions.noCheck) {
|
|
112799
|
-
(isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : filter(sourceFileOrBundle.sourceFiles, isSourceFileNotJson)).forEach(markLinkedReferences);
|
|
112800
|
-
}
|
|
112801
112629
|
const transform = transformNodes(
|
|
112802
112630
|
resolver,
|
|
112803
112631
|
host,
|
|
@@ -112932,13 +112760,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
112932
112760
|
}
|
|
112933
112761
|
forEachChild(node, collectLinkedAliases);
|
|
112934
112762
|
}
|
|
112935
|
-
function markLinkedReferences(file) {
|
|
112936
|
-
forEachChildRecursively(file, (n) => {
|
|
112937
|
-
if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip";
|
|
112938
|
-
if (isImportDeclaration(n)) return "skip";
|
|
112939
|
-
resolver.markLinkedReferences(n);
|
|
112940
|
-
});
|
|
112941
|
-
}
|
|
112942
112763
|
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform, printer, mapOptions) {
|
|
112943
112764
|
const sourceFileOrBundle = transform.transformed[0];
|
|
112944
112765
|
const bundle = sourceFileOrBundle.kind === 308 /* Bundle */ ? sourceFileOrBundle : void 0;
|
|
@@ -113070,11 +112891,10 @@ var notImplementedResolver = {
|
|
|
113070
112891
|
isValueAliasDeclaration: notImplemented,
|
|
113071
112892
|
isReferencedAliasDeclaration: notImplemented,
|
|
113072
112893
|
isTopLevelValueImportEqualsWithEntityName: notImplemented,
|
|
113073
|
-
|
|
112894
|
+
getNodeCheckFlags: notImplemented,
|
|
113074
112895
|
isDeclarationVisible: notImplemented,
|
|
113075
112896
|
isLateBound: (_node) => false,
|
|
113076
112897
|
collectLinkedAliases: notImplemented,
|
|
113077
|
-
markLinkedReferences: notImplemented,
|
|
113078
112898
|
isImplementationOfOverload: notImplemented,
|
|
113079
112899
|
requiresAddingImplicitUndefined: notImplemented,
|
|
113080
112900
|
isExpandoFunctionDeclaration: notImplemented,
|
|
@@ -121164,6 +120984,9 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121164
120984
|
if (options.noEmit) {
|
|
121165
120985
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noCheck", "noEmit");
|
|
121166
120986
|
}
|
|
120987
|
+
if (!options.emitDeclarationOnly) {
|
|
120988
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "noCheck", "emitDeclarationOnly");
|
|
120989
|
+
}
|
|
121167
120990
|
}
|
|
121168
120991
|
if (options.emitDecoratorMetadata && !options.experimentalDecorators) {
|
|
121169
120992
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators");
|