Skip to content

Commit c662343

Browse files
committed
Merge branch 'main' of https://github.com/microsoft/TypeScript into 60881
2 parents a697946 + 246507f commit c662343

14 files changed

+74
-6
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "https://www.typescriptlang.org/",
5-
"version": "5.8.0",
5+
"version": "5.9.0",
66
"license": "Apache-2.0",
77
"description": "TypeScript is a language for application scale JavaScript development",
88
"keywords": [

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47981,7 +47981,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4798147981
return;
4798247982
}
4798347983

47984-
if (compilerOptions.erasableSyntaxOnly && !(node.flags & NodeFlags.Ambient)) {
47984+
if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & NodeFlags.Ambient)) {
4798547985
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
4798647986
}
4798747987
const container = node.parent.kind === SyntaxKind.SourceFile ? node.parent : node.parent.parent as ModuleDeclaration;

src/compiler/corePublic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
22
// If changing the text in this section, be sure to test `configurePrerelease` too.
3-
export const versionMajorMinor = "5.8";
3+
export const versionMajorMinor = "5.9";
44
// The following is baselined as a literal template type without intervention
55
/** The version of the TypeScript compiler release */
66
export const version: string = `${versionMajorMinor}.0-dev`;

tests/baselines/reference/api/typescript.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3634,7 +3634,7 @@ declare namespace ts {
36343634
readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
36353635
}
36363636
}
3637-
const versionMajorMinor = "5.8";
3637+
const versionMajorMinor = "5.9";
36383638
/** The version of the TypeScript compiler release */
36393639
const version: string;
36403640
/**

tests/baselines/reference/erasableSyntaxOnly.errors.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,9 @@ index.ts(28,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOn
104104
==== other.d.cts (0 errors) ====
105105
declare function foo(): void;
106106
export = foo;
107+
108+
109+
==== esm.mts (0 errors) ====
110+
const foo = 1234;
111+
export default foo;
107112

tests/baselines/reference/erasableSyntaxOnly.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ export = foo;
7474
//// [other.d.cts]
7575
declare function foo(): void;
7676
export = foo;
77+
78+
79+
//// [esm.mts]
80+
const foo = 1234;
81+
export default foo;
7782

7883

7984
//// [index.js]
@@ -119,3 +124,6 @@ var MyClassOk = /** @class */ (function () {
119124
"use strict";
120125
var foo = require("./other.cjs");
121126
module.exports = foo;
127+
//// [esm.mjs]
128+
var foo = 1234;
129+
export default foo;

tests/baselines/reference/erasableSyntaxOnly.symbols

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,11 @@ declare function foo(): void;
133133
export = foo;
134134
>foo : Symbol(foo, Decl(other.d.cts, 0, 0))
135135

136+
137+
=== esm.mts ===
138+
const foo = 1234;
139+
>foo : Symbol(foo, Decl(esm.mts, 0, 5))
140+
141+
export default foo;
142+
>foo : Symbol(foo, Decl(esm.mts, 0, 5))
143+

tests/baselines/reference/erasableSyntaxOnly.types

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,15 @@ export = foo;
179179
>foo : () => void
180180
> : ^^^^^^
181181

182+
183+
=== esm.mts ===
184+
const foo = 1234;
185+
>foo : 1234
186+
> : ^^^^
187+
>1234 : 1234
188+
> : ^^^^
189+
190+
export default foo;
191+
>foo : 1234
192+
> : ^^^^
193+

tests/baselines/reference/erasableSyntaxOnlyDeclaration.errors.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ index.d.ts(1,1): error TS1046: Top-level declarations in .d.ts files must start
6565
==== other.d.cts (0 errors) ====
6666
declare function foo(): void;
6767
export = foo;
68+
69+
70+
==== esm.d.mts (0 errors) ====
71+
declare const foo = 1234;
72+
export default foo;
6873

0 commit comments

Comments
 (0)