Skip to content

[DO NOT REVIEW] checking if perf testing is broken #50812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 26 additions & 53 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6116,19 +6116,29 @@ namespace ts {
return parameterNode;

function cloneBindingName(node: BindingName): BindingName {
return elideInitializerAndSetEmitFlags(node) as BindingName;
function elideInitializerAndSetEmitFlags(node: Node): Node {
return elideInitializerAndPropertyRenamingAndSetEmitFlags(node) as BindingName;
function elideInitializerAndPropertyRenamingAndSetEmitFlags(node: Node): Node {
if (context.tracker.trackSymbol && isComputedPropertyName(node) && isLateBindableName(node)) {
trackComputedName(node.expression, context.enclosingDeclaration, context);
}
let visited = visitEachChild(node, elideInitializerAndSetEmitFlags, nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags)!;
let visited = visitEachChild(node, elideInitializerAndPropertyRenamingAndSetEmitFlags, nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndPropertyRenamingAndSetEmitFlags)!;
if (isBindingElement(visited)) {
visited = factory.updateBindingElement(
visited,
visited.dotDotDotToken,
visited.propertyName,
visited.name,
/*initializer*/ undefined);
if (visited.propertyName && isIdentifier(visited.propertyName) && isIdentifier(visited.name) && !isStringAKeyword(idText(visited.propertyName))) {
visited = factory.updateBindingElement(
visited,
visited.dotDotDotToken,
/* propertyName*/ undefined,
visited.propertyName,
/*initializer*/ undefined);
}
else {
visited = factory.updateBindingElement(
visited,
visited.dotDotDotToken,
visited.propertyName,
visited.name,
/*initializer*/ undefined);
}
}
if (!nodeIsSynthesized(visited)) {
visited = factory.cloneNode(visited);
Expand Down Expand Up @@ -29172,30 +29182,11 @@ namespace ts {
}

function reportObjectPossiblyNullOrUndefinedError(node: Node, facts: TypeFacts) {
const nodeText = isEntityNameExpression(node) ? entityNameToString(node) : undefined;
if (node.kind === SyntaxKind.NullKeyword) {
error(node, Diagnostics.The_value_0_cannot_be_used_here, "null");
return;
}
if (nodeText !== undefined && nodeText.length < 100) {
if (isIdentifier(node) && nodeText === "undefined") {
error(node, Diagnostics.The_value_0_cannot_be_used_here, "undefined");
return;
}
error(node, facts & TypeFacts.IsUndefined ? facts & TypeFacts.IsNull ?
Diagnostics._0_is_possibly_null_or_undefined :
Diagnostics._0_is_possibly_undefined :
Diagnostics._0_is_possibly_null,
nodeText
);
}
else {
error(node, facts & TypeFacts.IsUndefined ? facts & TypeFacts.IsNull ?
Diagnostics.Object_is_possibly_null_or_undefined :
Diagnostics.Object_is_possibly_undefined :
Diagnostics.Object_is_possibly_null
);
}
error(node, facts & TypeFacts.IsUndefined ? facts & TypeFacts.IsNull ?
Diagnostics.Object_is_possibly_null_or_undefined :
Diagnostics.Object_is_possibly_undefined :
Diagnostics.Object_is_possibly_null
);
}

function reportCannotInvokePossiblyNullOrUndefinedError(node: Node, facts: TypeFacts) {
Expand All @@ -29212,13 +29203,6 @@ namespace ts {
reportError: (node: Node, facts: TypeFacts) => void
): Type {
if (strictNullChecks && type.flags & TypeFlags.Unknown) {
if (isEntityNameExpression(node)) {
const nodeText = entityNameToString(node);
if (nodeText.length < 100) {
error(node, Diagnostics._0_is_of_type_unknown, nodeText);
return errorType;
}
}
error(node, Diagnostics.Object_is_of_type_unknown);
return errorType;
}
Expand All @@ -29238,17 +29222,6 @@ namespace ts {
function checkNonNullNonVoidType(type: Type, node: Node): Type {
const nonNullType = checkNonNullType(type, node);
if (nonNullType.flags & TypeFlags.Void) {
if (isEntityNameExpression(node)) {
const nodeText = entityNameToString(node);
if (isIdentifier(node) && nodeText === "undefined") {
error(node, Diagnostics.The_value_0_cannot_be_used_here, nodeText);
return nonNullType;
}
if (nodeText.length < 100) {
error(node, Diagnostics._0_is_possibly_undefined, nodeText);
return nonNullType;
}
}
error(node, Diagnostics.Object_is_possibly_undefined);
}
return nonNullType;
Expand Down Expand Up @@ -36070,8 +36043,8 @@ namespace ts {
}

function getEffectiveTypeArgumentAtIndex(node: TypeReferenceNode | ExpressionWithTypeArguments, typeParameters: readonly TypeParameter[], index: number): Type {
if (node.typeArguments && index < node.typeArguments.length) {
return getTypeFromTypeNode(node.typeArguments[index]);
if (index < typeParameters.length) {
return getTypeFromTypeNode(node.typeArguments![index]);
}
return getEffectiveTypeArguments(node, typeParameters)[index];
}
Expand Down
20 changes: 0 additions & 20 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7497,25 +7497,5 @@
"Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.": {
"category": "Error",
"code": 18045
},
"'{0}' is of type 'unknown'.": {
"category": "Error",
"code": 18046
},
"'{0}' is possibly 'null'.": {
"category": "Error",
"code": 18047
},
"'{0}' is possibly 'undefined'.": {
"category": "Error",
"code": 18048
},
"'{0}' is possibly 'null' or 'undefined'.": {
"category": "Error",
"code": 18049
},
"The value '{0}' cannot be used here.": {
"category": "Error",
"code": 18050
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1743,15 +1743,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_accessor_property_cannot_be_declared_optional_1276" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An 'accessor' property cannot be declared optional.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[無法將 'accessor' 屬性宣告為選擇性。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An ambient module declaration is only allowed at the top level in a file.]]></Val>
Expand Down Expand Up @@ -10329,15 +10320,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[只有以 ECMAScript 2015 及更新版本為目標時,才可使用具有 'accessor' 修飾詞的屬性。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' cannot have an initializer because it is marked abstract.]]></Val>
Expand Down Expand Up @@ -16287,15 +16269,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";accessor_modifier_can_only_appear_on_a_property_declaration_1275" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['accessor' modifier can only appear on a property declaration.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['accessor' 修飾詞只能出現在屬性宣告。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";and_here_6204" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[and here.]]></Val>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1752,15 +1752,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_accessor_property_cannot_be_declared_optional_1276" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An 'accessor' property cannot be declared optional.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Vlastnost accessor nejde deklarovat jako volitelnou.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An ambient module declaration is only allowed at the top level in a file.]]></Val>
Expand Down Expand Up @@ -10338,15 +10329,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Vlastnosti s modifikátorem accessor jsou k dispozici jen při cílení na ECMAScript 2015 a vyšší.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' cannot have an initializer because it is marked abstract.]]></Val>
Expand Down Expand Up @@ -16296,15 +16278,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";accessor_modifier_can_only_appear_on_a_property_declaration_1275" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['accessor' modifier can only appear on a property declaration.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Modifikátor accessor se může objevit jenom v deklaraci vlastnosti.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";and_here_6204" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[and here.]]></Val>
Expand Down
Loading