Skip to content

Commit 89722f1

Browse files
committed
More fixups
1 parent e71b7ce commit 89722f1

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/compiler/debug.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
ObjectFlags, ObjectType, RelationComparisonResult, Signature, SignatureCheckMode,
1515
SignatureFlags, SnippetKind, SortedReadonlyArray, stableSort, Symbol, SymbolFlags, symbolName, SyntaxKind,
1616
TransformFlags, Type, TypeFacts, TypeFlags, TypeMapKind, TypeMapper, unescapeLeadingUnderscores, VarianceFlags,
17-
version, Version, zipWith,
17+
zipWith,
1818
} from "./_namespaces/ts";
1919

2020
/** @internal */
@@ -33,20 +33,14 @@ export interface LoggingHost {
3333

3434
/** @internal */
3535
export namespace Debug {
36-
let typeScriptVersion: Version | undefined;
37-
3836
/* eslint-disable prefer-const */
3937
let currentAssertionLevel = AssertionLevel.None;
4038
export let currentLogLevel = LogLevel.Warning;
4139
export let isDebugging = false;
4240
export let loggingHost: LoggingHost | undefined;
43-
export let enableDeprecationWarnings = true;
4441
/* eslint-enable prefer-const */
4542

4643
type AssertionKeys = MatchingKeys<typeof Debug, AnyFunction>;
47-
export function getTypeScriptVersion() {
48-
return typeScriptVersion ?? (typeScriptVersion = new Version(version));
49-
}
5044

5145
export function shouldLog(level: LogLevel): boolean {
5246
return currentLogLevel <= level;

src/deprecatedCompat/deprecate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function setEnableDeprecationWarnings(value: boolean) {
88

99
let typeScriptVersion: Version | undefined;
1010

11-
export function getTypeScriptVersion() {
11+
function getTypeScriptVersion() {
1212
return typeScriptVersion ?? (typeScriptVersion = new Version(version));
1313
}
1414

src/testRunner/unittests/factory.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as ts from "../_namespaces/ts";
2+
import { setEnableDeprecationWarnings } from "../../deprecatedCompat/deprecate";
23

34
describe("unittests:: FactoryAPI", () => {
45
function assertSyntaxKind(node: ts.Node, expected: ts.SyntaxKind) {
@@ -85,11 +86,11 @@ describe("unittests:: FactoryAPI", () => {
8586

8687
describe("deprecations", () => {
8788
beforeEach(() => {
88-
ts.Debug.enableDeprecationWarnings = false;
89+
setEnableDeprecationWarnings(false);
8990
});
9091

9192
afterEach(() => {
92-
ts.Debug.enableDeprecationWarnings = true;
93+
setEnableDeprecationWarnings(true);
9394
});
9495

9596
// https://github.com/microsoft/TypeScript/issues/50259

0 commit comments

Comments
 (0)