Skip to content

Commit e2ad372

Browse files
committed
Try reverting everything since the last working thing
1 parent 01cae69 commit e2ad372

File tree

116 files changed

+4179
-5790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+4179
-5790
lines changed

package-lock.json

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/compiler/checker.ts

Lines changed: 26 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6116,19 +6116,29 @@ namespace ts {
61166116
return parameterNode;
61176117

61186118
function cloneBindingName(node: BindingName): BindingName {
6119-
return elideInitializerAndSetEmitFlags(node) as BindingName;
6120-
function elideInitializerAndSetEmitFlags(node: Node): Node {
6119+
return elideInitializerAndPropertyRenamingAndSetEmitFlags(node) as BindingName;
6120+
function elideInitializerAndPropertyRenamingAndSetEmitFlags(node: Node): Node {
61216121
if (context.tracker.trackSymbol && isComputedPropertyName(node) && isLateBindableName(node)) {
61226122
trackComputedName(node.expression, context.enclosingDeclaration, context);
61236123
}
6124-
let visited = visitEachChild(node, elideInitializerAndSetEmitFlags, nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags)!;
6124+
let visited = visitEachChild(node, elideInitializerAndPropertyRenamingAndSetEmitFlags, nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndPropertyRenamingAndSetEmitFlags)!;
61256125
if (isBindingElement(visited)) {
6126-
visited = factory.updateBindingElement(
6127-
visited,
6128-
visited.dotDotDotToken,
6129-
visited.propertyName,
6130-
visited.name,
6131-
/*initializer*/ undefined);
6126+
if (visited.propertyName && isIdentifier(visited.propertyName) && isIdentifier(visited.name) && !isStringAKeyword(idText(visited.propertyName))) {
6127+
visited = factory.updateBindingElement(
6128+
visited,
6129+
visited.dotDotDotToken,
6130+
/* propertyName*/ undefined,
6131+
visited.propertyName,
6132+
/*initializer*/ undefined);
6133+
}
6134+
else {
6135+
visited = factory.updateBindingElement(
6136+
visited,
6137+
visited.dotDotDotToken,
6138+
visited.propertyName,
6139+
visited.name,
6140+
/*initializer*/ undefined);
6141+
}
61326142
}
61336143
if (!nodeIsSynthesized(visited)) {
61346144
visited = factory.cloneNode(visited);
@@ -29172,30 +29182,11 @@ namespace ts {
2917229182
}
2917329183

2917429184
function reportObjectPossiblyNullOrUndefinedError(node: Node, facts: TypeFacts) {
29175-
const nodeText = isEntityNameExpression(node) ? entityNameToString(node) : undefined;
29176-
if (node.kind === SyntaxKind.NullKeyword) {
29177-
error(node, Diagnostics.The_value_0_cannot_be_used_here, "null");
29178-
return;
29179-
}
29180-
if (nodeText !== undefined && nodeText.length < 100) {
29181-
if (isIdentifier(node) && nodeText === "undefined") {
29182-
error(node, Diagnostics.The_value_0_cannot_be_used_here, "undefined");
29183-
return;
29184-
}
29185-
error(node, facts & TypeFacts.IsUndefined ? facts & TypeFacts.IsNull ?
29186-
Diagnostics._0_is_possibly_null_or_undefined :
29187-
Diagnostics._0_is_possibly_undefined :
29188-
Diagnostics._0_is_possibly_null,
29189-
nodeText
29190-
);
29191-
}
29192-
else {
29193-
error(node, facts & TypeFacts.IsUndefined ? facts & TypeFacts.IsNull ?
29194-
Diagnostics.Object_is_possibly_null_or_undefined :
29195-
Diagnostics.Object_is_possibly_undefined :
29196-
Diagnostics.Object_is_possibly_null
29197-
);
29198-
}
29185+
error(node, facts & TypeFacts.IsUndefined ? facts & TypeFacts.IsNull ?
29186+
Diagnostics.Object_is_possibly_null_or_undefined :
29187+
Diagnostics.Object_is_possibly_undefined :
29188+
Diagnostics.Object_is_possibly_null
29189+
);
2919929190
}
2920029191

2920129192
function reportCannotInvokePossiblyNullOrUndefinedError(node: Node, facts: TypeFacts) {
@@ -29212,13 +29203,6 @@ namespace ts {
2921229203
reportError: (node: Node, facts: TypeFacts) => void
2921329204
): Type {
2921429205
if (strictNullChecks && type.flags & TypeFlags.Unknown) {
29215-
if (isEntityNameExpression(node)) {
29216-
const nodeText = entityNameToString(node);
29217-
if (nodeText.length < 100) {
29218-
error(node, Diagnostics._0_is_of_type_unknown, nodeText);
29219-
return errorType;
29220-
}
29221-
}
2922229206
error(node, Diagnostics.Object_is_of_type_unknown);
2922329207
return errorType;
2922429208
}
@@ -29238,17 +29222,6 @@ namespace ts {
2923829222
function checkNonNullNonVoidType(type: Type, node: Node): Type {
2923929223
const nonNullType = checkNonNullType(type, node);
2924029224
if (nonNullType.flags & TypeFlags.Void) {
29241-
if (isEntityNameExpression(node)) {
29242-
const nodeText = entityNameToString(node);
29243-
if (isIdentifier(node) && nodeText === "undefined") {
29244-
error(node, Diagnostics.The_value_0_cannot_be_used_here, nodeText);
29245-
return nonNullType;
29246-
}
29247-
if (nodeText.length < 100) {
29248-
error(node, Diagnostics._0_is_possibly_undefined, nodeText);
29249-
return nonNullType;
29250-
}
29251-
}
2925229225
error(node, Diagnostics.Object_is_possibly_undefined);
2925329226
}
2925429227
return nonNullType;
@@ -36070,8 +36043,8 @@ namespace ts {
3607036043
}
3607136044

3607236045
function getEffectiveTypeArgumentAtIndex(node: TypeReferenceNode | ExpressionWithTypeArguments, typeParameters: readonly TypeParameter[], index: number): Type {
36073-
if (node.typeArguments && index < node.typeArguments.length) {
36074-
return getTypeFromTypeNode(node.typeArguments[index]);
36046+
if (index < typeParameters.length) {
36047+
return getTypeFromTypeNode(node.typeArguments![index]);
3607536048
}
3607636049
return getEffectiveTypeArguments(node, typeParameters)[index];
3607736050
}

src/compiler/diagnosticMessages.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7497,25 +7497,5 @@
74977497
"Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.": {
74987498
"category": "Error",
74997499
"code": 18045
7500-
},
7501-
"'{0}' is of type 'unknown'.": {
7502-
"category": "Error",
7503-
"code": 18046
7504-
},
7505-
"'{0}' is possibly 'null'.": {
7506-
"category": "Error",
7507-
"code": 18047
7508-
},
7509-
"'{0}' is possibly 'undefined'.": {
7510-
"category": "Error",
7511-
"code": 18048
7512-
},
7513-
"'{0}' is possibly 'null' or 'undefined'.": {
7514-
"category": "Error",
7515-
"code": 18049
7516-
},
7517-
"The value '{0}' cannot be used here.": {
7518-
"category": "Error",
7519-
"code": 18050
75207500
}
75217501
}

src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,15 +1743,6 @@
17431743
</Str>
17441744
<Disp Icon="Str" />
17451745
</Item>
1746-
<Item ItemId=";An_accessor_property_cannot_be_declared_optional_1276" ItemType="0" PsrId="306" Leaf="true">
1747-
<Str Cat="Text">
1748-
<Val><![CDATA[An 'accessor' property cannot be declared optional.]]></Val>
1749-
<Tgt Cat="Text" Stat="Loc" Orig="New">
1750-
<Val><![CDATA[無法將 'accessor' 屬性宣告為選擇性。]]></Val>
1751-
</Tgt>
1752-
</Str>
1753-
<Disp Icon="Str" />
1754-
</Item>
17551746
<Item ItemId=";An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234" ItemType="0" PsrId="306" Leaf="true">
17561747
<Str Cat="Text">
17571748
<Val><![CDATA[An ambient module declaration is only allowed at the top level in a file.]]></Val>
@@ -10329,15 +10320,6 @@
1032910320
</Str>
1033010321
<Disp Icon="Str" />
1033110322
</Item>
10332-
<Item ItemId=";Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045" ItemType="0" PsrId="306" Leaf="true">
10333-
<Str Cat="Text">
10334-
<Val><![CDATA[Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.]]></Val>
10335-
<Tgt Cat="Text" Stat="Loc" Orig="New">
10336-
<Val><![CDATA[只有以 ECMAScript 2015 及更新版本為目標時,才可使用具有 'accessor' 修飾詞的屬性。]]></Val>
10337-
</Tgt>
10338-
</Str>
10339-
<Disp Icon="Str" />
10340-
</Item>
1034110323
<Item ItemId=";Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267" ItemType="0" PsrId="306" Leaf="true">
1034210324
<Str Cat="Text">
1034310325
<Val><![CDATA[Property '{0}' cannot have an initializer because it is marked abstract.]]></Val>
@@ -16287,15 +16269,6 @@
1628716269
</Str>
1628816270
<Disp Icon="Str" />
1628916271
</Item>
16290-
<Item ItemId=";accessor_modifier_can_only_appear_on_a_property_declaration_1275" ItemType="0" PsrId="306" Leaf="true">
16291-
<Str Cat="Text">
16292-
<Val><![CDATA['accessor' modifier can only appear on a property declaration.]]></Val>
16293-
<Tgt Cat="Text" Stat="Loc" Orig="New">
16294-
<Val><![CDATA['accessor' 修飾詞只能出現在屬性宣告。]]></Val>
16295-
</Tgt>
16296-
</Str>
16297-
<Disp Icon="Str" />
16298-
</Item>
1629916272
<Item ItemId=";and_here_6204" ItemType="0" PsrId="306" Leaf="true">
1630016273
<Str Cat="Text">
1630116274
<Val><![CDATA[and here.]]></Val>

src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,15 +1752,6 @@
17521752
</Str>
17531753
<Disp Icon="Str" />
17541754
</Item>
1755-
<Item ItemId=";An_accessor_property_cannot_be_declared_optional_1276" ItemType="0" PsrId="306" Leaf="true">
1756-
<Str Cat="Text">
1757-
<Val><![CDATA[An 'accessor' property cannot be declared optional.]]></Val>
1758-
<Tgt Cat="Text" Stat="Loc" Orig="New">
1759-
<Val><![CDATA[Vlastnost accessor nejde deklarovat jako volitelnou.]]></Val>
1760-
</Tgt>
1761-
</Str>
1762-
<Disp Icon="Str" />
1763-
</Item>
17641755
<Item ItemId=";An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234" ItemType="0" PsrId="306" Leaf="true">
17651756
<Str Cat="Text">
17661757
<Val><![CDATA[An ambient module declaration is only allowed at the top level in a file.]]></Val>
@@ -10338,15 +10329,6 @@
1033810329
</Str>
1033910330
<Disp Icon="Str" />
1034010331
</Item>
10341-
<Item ItemId=";Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045" ItemType="0" PsrId="306" Leaf="true">
10342-
<Str Cat="Text">
10343-
<Val><![CDATA[Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.]]></Val>
10344-
<Tgt Cat="Text" Stat="Loc" Orig="New">
10345-
<Val><![CDATA[Vlastnosti s modifikátorem accessor jsou k dispozici jen při cílení na ECMAScript 2015 a vyšší.]]></Val>
10346-
</Tgt>
10347-
</Str>
10348-
<Disp Icon="Str" />
10349-
</Item>
1035010332
<Item ItemId=";Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267" ItemType="0" PsrId="306" Leaf="true">
1035110333
<Str Cat="Text">
1035210334
<Val><![CDATA[Property '{0}' cannot have an initializer because it is marked abstract.]]></Val>
@@ -16296,15 +16278,6 @@
1629616278
</Str>
1629716279
<Disp Icon="Str" />
1629816280
</Item>
16299-
<Item ItemId=";accessor_modifier_can_only_appear_on_a_property_declaration_1275" ItemType="0" PsrId="306" Leaf="true">
16300-
<Str Cat="Text">
16301-
<Val><![CDATA['accessor' modifier can only appear on a property declaration.]]></Val>
16302-
<Tgt Cat="Text" Stat="Loc" Orig="New">
16303-
<Val><![CDATA[Modifikátor accessor se může objevit jenom v deklaraci vlastnosti.]]></Val>
16304-
</Tgt>
16305-
</Str>
16306-
<Disp Icon="Str" />
16307-
</Item>
1630816281
<Item ItemId=";and_here_6204" ItemType="0" PsrId="306" Leaf="true">
1630916282
<Str Cat="Text">
1631016283
<Val><![CDATA[and here.]]></Val>

0 commit comments

Comments
 (0)