@@ -13647,9 +13647,6 @@ namespace ts {
13647
13647
}
13648
13648
}
13649
13649
13650
- checkCollisionWithCapturedSuperVariable(node, node);
13651
- checkCollisionWithCapturedThisVariable(node, node);
13652
- checkCollisionWithCapturedNewTargetVariable(node, node);
13653
13650
checkNestedBlockScopedBinding(node, symbol);
13654
13651
13655
13652
const type = getConstraintForLocation(getTypeOfSymbol(localOrExportSymbol), node);
@@ -18852,12 +18849,6 @@ namespace ts {
18852
18849
}
18853
18850
}
18854
18851
18855
- if (produceDiagnostics && node.kind !== SyntaxKind.MethodDeclaration) {
18856
- checkCollisionWithCapturedSuperVariable(node, node.name);
18857
- checkCollisionWithCapturedThisVariable(node, node.name);
18858
- checkCollisionWithCapturedNewTargetVariable(node, node.name);
18859
- }
18860
-
18861
18852
return type;
18862
18853
}
18863
18854
@@ -21585,9 +21576,6 @@ namespace ts {
21585
21576
if (produceDiagnostics) {
21586
21577
checkFunctionOrMethodDeclaration(node);
21587
21578
checkGrammarForGenerator(node);
21588
- checkCollisionWithCapturedSuperVariable(node, node.name);
21589
- checkCollisionWithCapturedThisVariable(node, node.name);
21590
- checkCollisionWithCapturedNewTargetVariable(node, node.name);
21591
21579
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
21592
21580
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
21593
21581
}
@@ -22012,18 +22000,6 @@ namespace ts {
22012
22000
return true;
22013
22001
}
22014
22002
22015
- function checkCollisionWithCapturedThisVariable(node: Node, name: Identifier): void {
22016
- if (languageVersion <= ScriptTarget.ES5 && !compilerOptions.noEmit && needCollisionCheckForIdentifier(node, name, "_this")) {
22017
- potentialThisCollisions.push(node);
22018
- }
22019
- }
22020
-
22021
- function checkCollisionWithCapturedNewTargetVariable(node: Node, name: Identifier): void {
22022
- if (languageVersion <= ScriptTarget.ES5 && !compilerOptions.noEmit && needCollisionCheckForIdentifier(node, name, "_newTarget")) {
22023
- potentialNewTargetCollisions.push(node);
22024
- }
22025
- }
22026
-
22027
22003
// this function will run after checking the source file so 'CaptureThis' is correct for all nodes
22028
22004
function checkIfThisIsCapturedInEnclosingScope(node: Node): void {
22029
22005
findAncestor(node, current => {
@@ -22055,33 +22031,6 @@ namespace ts {
22055
22031
});
22056
22032
}
22057
22033
22058
- function checkCollisionWithCapturedSuperVariable(node: Node, name: Identifier) {
22059
- if (languageVersion >= ScriptTarget.ES2015 || compilerOptions.noEmit) {
22060
- return;
22061
- }
22062
-
22063
- if (!needCollisionCheckForIdentifier(node, name, "_super")) {
22064
- return;
22065
- }
22066
-
22067
- // bubble up and find containing type
22068
- const enclosingClass = getContainingClass(node);
22069
- // if containing type was not found or it is ambient - exit (no codegen)
22070
- if (!enclosingClass || enclosingClass.flags & NodeFlags.Ambient) {
22071
- return;
22072
- }
22073
-
22074
- if (getClassExtendsHeritageClauseElement(enclosingClass)) {
22075
- const isDeclaration = node.kind !== SyntaxKind.Identifier;
22076
- if (isDeclaration) {
22077
- error(node, Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference);
22078
- }
22079
- else {
22080
- error(node, Diagnostics.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference);
22081
- }
22082
- }
22083
- }
22084
-
22085
22034
function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier) {
22086
22035
// No need to check for require or exports for ES6 modules and later
22087
22036
if (modulekind >= ModuleKind.ES2015 || compilerOptions.noEmit) {
@@ -22378,9 +22327,6 @@ namespace ts {
22378
22327
if (node.kind === SyntaxKind.VariableDeclaration || node.kind === SyntaxKind.BindingElement) {
22379
22328
checkVarDeclaredNamesNotShadowed(node);
22380
22329
}
22381
- checkCollisionWithCapturedSuperVariable(node, <Identifier>node.name);
22382
- checkCollisionWithCapturedThisVariable(node, <Identifier>node.name);
22383
- checkCollisionWithCapturedNewTargetVariable(node, <Identifier>node.name);
22384
22330
checkCollisionWithRequireExportsInGeneratedCode(node, <Identifier>node.name);
22385
22331
checkCollisionWithGlobalPromiseInGeneratedCode(node, <Identifier>node.name);
22386
22332
}
@@ -23377,8 +23323,6 @@ namespace ts {
23377
23323
checkDecorators(node);
23378
23324
if (node.name) {
23379
23325
checkTypeNameIsReserved(node.name, Diagnostics.Class_name_cannot_be_0);
23380
- checkCollisionWithCapturedThisVariable(node, node.name);
23381
- checkCollisionWithCapturedNewTargetVariable(node, node.name);
23382
23326
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
23383
23327
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
23384
23328
}
@@ -23907,8 +23851,6 @@ namespace ts {
23907
23851
checkGrammarDecoratorsAndModifiers(node);
23908
23852
23909
23853
checkTypeNameIsReserved(node.name, Diagnostics.Enum_name_cannot_be_0);
23910
- checkCollisionWithCapturedThisVariable(node, node.name);
23911
- checkCollisionWithCapturedNewTargetVariable(node, node.name);
23912
23854
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
23913
23855
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
23914
23856
checkExportsOnMergedDeclarations(node);
@@ -24014,7 +23956,6 @@ namespace ts {
24014
23956
}
24015
23957
24016
23958
if (isIdentifier(node.name)) {
24017
- checkCollisionWithCapturedThisVariable(node, node.name);
24018
23959
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
24019
23960
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
24020
23961
}
@@ -24222,7 +24163,6 @@ namespace ts {
24222
24163
}
24223
24164
24224
24165
function checkImportBinding(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportSpecifier) {
24225
- checkCollisionWithCapturedThisVariable(node, node.name);
24226
24166
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
24227
24167
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
24228
24168
checkAliasSymbol(node);
0 commit comments