Skip to content

Commit 8933230

Browse files
Revert "Merge branch 'microsoft:main' into 60881"
This reverts commit c88940c, reversing changes made to 95b249f.
1 parent c88940c commit 8933230

46 files changed

Lines changed: 74 additions & 1043 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
name: coverage
9696
path: coverage
9797

98-
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
98+
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
9999
with:
100100
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
101101
disable_search: true
@@ -137,7 +137,7 @@ jobs:
137137
node-version: 'lts/*'
138138
- run: npm ci
139139

140-
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
140+
- uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
141141
with:
142142
path: ~/.cache/dprint
143143
key: ${{ runner.os }}-dprint-${{ hashFiles('package-lock.json', '.dprint.jsonc') }}

src/compiler/checker.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6207,7 +6207,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
62076207
const context = syntacticContext as NodeBuilderContext;
62086208
if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) {
62096209
let name = lit.text;
6210-
const originalName = name;
62116210
const nodeSymbol = getNodeLinks(parent).resolvedSymbol;
62126211
const meaning = parent.isTypeOf ? SymbolFlags.Value : SymbolFlags.Type;
62136212
const parentSymbol = nodeSymbol
@@ -6228,9 +6227,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
62286227
context.tracker.reportLikelyUnsafeImportRequiredError(name);
62296228
}
62306229
}
6231-
if (name !== originalName) {
6232-
return name;
6233-
}
6230+
return name;
62346231
}
62356232
},
62366233
canReuseTypeNode(context, typeNode) {
@@ -8834,7 +8831,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
88348831
return setTextRange(context, setEmitFlags(name, EmitFlags.NoAsciiEscaping), node);
88358832
}
88368833
const updated = visitEachChildWorker(node, c => attachSymbolToLeftmostIdentifier(c), /*context*/ undefined);
8837-
return setTextRange(context, updated, node);
8834+
if (updated !== node) {
8835+
setTextRange(context, updated, node);
8836+
}
8837+
return updated;
88388838
}
88398839
}
88408840

@@ -37319,11 +37319,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3731937319
if (file && fileExtensionIsOneOf(file.fileName, [Extension.Cts, Extension.Mts])) {
3732037320
grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
3732137321
}
37322-
if (compilerOptions.erasableSyntaxOnly) {
37323-
const start = node.type.pos - "<".length;
37324-
const end = skipTrivia(file.text, node.type.end) + ">".length;
37325-
diagnostics.add(createFileDiagnostic(file, start, end - start, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled));
37326-
}
3732737322
}
3732837323
return checkAssertionWorker(node, checkMode);
3732937324
}

src/compiler/expressionToTypeNode.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,9 @@ export function createSyntacticTypeNodeBuilder(
435435
if (!resolver.canReuseTypeNode(context, node)) {
436436
return resolver.serializeExistingTypeNode(context, node);
437437
}
438-
const specifier = rewriteModuleSpecifier(node, node.argument.literal);
439-
const literal = specifier === node.argument.literal ? reuseNode(context, node.argument.literal) : specifier;
440438
return factory.updateImportTypeNode(
441439
node,
442-
literal === node.argument.literal ? reuseNode(context, node.argument) : factory.createLiteralTypeNode(literal),
440+
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
443441
visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes),
444442
visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName),
445443
visitNodes(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
@@ -614,7 +612,10 @@ export function createSyntacticTypeNodeBuilder(
614612

615613
function rewriteModuleSpecifier(parent: ImportTypeNode, lit: StringLiteral) {
616614
const newName = resolver.getModuleSpecifierOverride(context, parent, lit);
617-
return newName ? setOriginalNode(factory.createStringLiteral(newName), lit) : lit;
615+
if (newName) {
616+
return setOriginalNode(factory.createStringLiteral(newName), lit);
617+
}
618+
return visitNode(lit, visitExistingNodeTreeSymbols, isStringLiteral)!;
618619
}
619620
}
620621
}
@@ -1122,16 +1123,15 @@ export function createSyntacticTypeNodeBuilder(
11221123
);
11231124
}
11241125
function reuseTypeParameters(typeParameters: NodeArray<TypeParameterDeclaration> | undefined, context: SyntacticTypeNodeBuilderContext) {
1125-
return typeParameters?.map(tp => {
1126-
const { node: tpName } = resolver.trackExistingEntityName(context, tp.name);
1127-
return factory.updateTypeParameterDeclaration(
1126+
return typeParameters?.map(tp =>
1127+
factory.updateTypeParameterDeclaration(
11281128
tp,
11291129
tp.modifiers?.map(m => reuseNode(context, m)),
1130-
tpName,
1130+
reuseNode(context, tp.name),
11311131
serializeExistingTypeNodeWithFallback(tp.constraint, context),
11321132
serializeExistingTypeNodeWithFallback(tp.default, context),
1133-
);
1134-
});
1133+
)
1134+
);
11351135
}
11361136

11371137
function typeFromObjectLiteralMethod(method: MethodDeclaration, name: PropertyName, context: SyntacticTypeNodeBuilderContext, isConstContext: boolean) {

src/lib/es2017.sharedmemory.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ interface SharedArrayBuffer {
1111
* Returns a section of an SharedArrayBuffer.
1212
*/
1313
slice(begin?: number, end?: number): SharedArrayBuffer;
14+
readonly [Symbol.species]: SharedArrayBuffer;
1415
readonly [Symbol.toStringTag]: "SharedArrayBuffer";
1516
}
1617

1718
interface SharedArrayBufferConstructor {
1819
readonly prototype: SharedArrayBuffer;
1920
new (byteLength?: number): SharedArrayBuffer;
20-
readonly [Symbol.species]: SharedArrayBufferConstructor;
2121
}
2222
declare var SharedArrayBuffer: SharedArrayBufferConstructor;
2323

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15270,15 +15270,6 @@
1527015270
</Str>
1527115271
<Disp Icon="Str" />
1527215272
</Item>
15273-
<Item ItemId=";This_expression_is_never_nullish_2881" ItemType="0" PsrId="306" Leaf="true">
15274-
<Str Cat="Text">
15275-
<Val><![CDATA[This expression is never nullish.]]></Val>
15276-
<Tgt Cat="Text" Stat="Loc" Orig="New">
15277-
<Val><![CDATA[此表达式从不为 null。]]></Val>
15278-
</Tgt>
15279-
</Str>
15280-
<Disp Icon="Str" />
15281-
</Item>
1528215273
<Item ItemId=";This_expression_is_not_callable_2349" ItemType="0" PsrId="306" Leaf="true">
1528315274
<Str Cat="Text">
1528415275
<Val><![CDATA[This expression is not callable.]]></Val>

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15270,15 +15270,6 @@
1527015270
</Str>
1527115271
<Disp Icon="Str" />
1527215272
</Item>
15273-
<Item ItemId=";This_expression_is_never_nullish_2881" ItemType="0" PsrId="306" Leaf="true">
15274-
<Str Cat="Text">
15275-
<Val><![CDATA[This expression is never nullish.]]></Val>
15276-
<Tgt Cat="Text" Stat="Loc" Orig="New">
15277-
<Val><![CDATA[此運算式一律不會是 nullish。]]></Val>
15278-
</Tgt>
15279-
</Str>
15280-
<Disp Icon="Str" />
15281-
</Item>
1528215273
<Item ItemId=";This_expression_is_not_callable_2349" ItemType="0" PsrId="306" Leaf="true">
1528315274
<Str Cat="Text">
1528415275
<Val><![CDATA[This expression is not callable.]]></Val>

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15279,15 +15279,6 @@
1527915279
</Str>
1528015280
<Disp Icon="Str" />
1528115281
</Item>
15282-
<Item ItemId=";This_expression_is_never_nullish_2881" ItemType="0" PsrId="306" Leaf="true">
15283-
<Str Cat="Text">
15284-
<Val><![CDATA[This expression is never nullish.]]></Val>
15285-
<Tgt Cat="Text" Stat="Loc" Orig="New">
15286-
<Val><![CDATA[Tento výraz nikdy nemá hodnotu null.]]></Val>
15287-
</Tgt>
15288-
</Str>
15289-
<Disp Icon="Str" />
15290-
</Item>
1529115282
<Item ItemId=";This_expression_is_not_callable_2349" ItemType="0" PsrId="306" Leaf="true">
1529215283
<Str Cat="Text">
1529315284
<Val><![CDATA[This expression is not callable.]]></Val>

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15264,15 +15264,6 @@
1526415264
</Str>
1526515265
<Disp Icon="Str" />
1526615266
</Item>
15267-
<Item ItemId=";This_expression_is_never_nullish_2881" ItemType="0" PsrId="306" Leaf="true">
15268-
<Str Cat="Text">
15269-
<Val><![CDATA[This expression is never nullish.]]></Val>
15270-
<Tgt Cat="Text" Stat="Loc" Orig="New">
15271-
<Val><![CDATA[Dieser binäre Ausdruck ist nie „NULLISH“.]]></Val>
15272-
</Tgt>
15273-
</Str>
15274-
<Disp Icon="Str" />
15275-
</Item>
1527615267
<Item ItemId=";This_expression_is_not_callable_2349" ItemType="0" PsrId="306" Leaf="true">
1527715268
<Str Cat="Text">
1527815269
<Val><![CDATA[This expression is not callable.]]></Val>

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15282,15 +15282,6 @@
1528215282
</Str>
1528315283
<Disp Icon="Str" />
1528415284
</Item>
15285-
<Item ItemId=";This_expression_is_never_nullish_2881" ItemType="0" PsrId="306" Leaf="true">
15286-
<Str Cat="Text">
15287-
<Val><![CDATA[This expression is never nullish.]]></Val>
15288-
<Tgt Cat="Text" Stat="Loc" Orig="New">
15289-
<Val><![CDATA[Esta expresión nunca es nula.]]></Val>
15290-
</Tgt>
15291-
</Str>
15292-
<Disp Icon="Str" />
15293-
</Item>
1529415285
<Item ItemId=";This_expression_is_not_callable_2349" ItemType="0" PsrId="306" Leaf="true">
1529515286
<Str Cat="Text">
1529615287
<Val><![CDATA[This expression is not callable.]]></Val>

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15282,15 +15282,6 @@
1528215282
</Str>
1528315283
<Disp Icon="Str" />
1528415284
</Item>
15285-
<Item ItemId=";This_expression_is_never_nullish_2881" ItemType="0" PsrId="306" Leaf="true">
15286-
<Str Cat="Text">
15287-
<Val><![CDATA[This expression is never nullish.]]></Val>
15288-
<Tgt Cat="Text" Stat="Loc" Orig="New">
15289-
<Val><![CDATA[Cette expression n’est jamais nulle.]]></Val>
15290-
</Tgt>
15291-
</Str>
15292-
<Disp Icon="Str" />
15293-
</Item>
1529415285
<Item ItemId=";This_expression_is_not_callable_2349" ItemType="0" PsrId="306" Leaf="true">
1529515286
<Str Cat="Text">
1529615287
<Val><![CDATA[This expression is not callable.]]></Val>

0 commit comments

Comments
 (0)