Skip to content

Commit 72037a9

Browse files
authored
Skip resolving files directly inside node_modules (#52809)
1 parent d1b040d commit 72037a9

File tree

41 files changed

+894
-52
lines changed

Some content is hidden

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

41 files changed

+894
-52
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4917,6 +4917,10 @@
49174917
"category": "Message",
49184918
"code": 6163
49194919
},
4920+
"Skipping module '{0}' that looks like an absolute URI, target file types: {1}.": {
4921+
"category": "Message",
4922+
"code": 6164
4923+
},
49204924
"Do not truncate error messages.": {
49214925
"category": "Message",
49224926
"code": 6165

src/compiler/moduleNameResolver.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,12 @@ function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleNa
17931793
resolved = loadModuleFromSelfNameReference(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
17941794
}
17951795
if (!resolved) {
1796+
if (moduleName.indexOf(":") > -1) {
1797+
if (traceEnabled) {
1798+
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions));
1799+
}
1800+
return undefined;
1801+
}
17961802
if (traceEnabled) {
17971803
trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions));
17981804
}
@@ -2894,7 +2900,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions: Extensions, modu
28942900

28952901
const loader: ResolutionKindSpecificLoader = (extensions, candidate, onlyRecordFailures, state) => {
28962902
let pathAndExtension =
2897-
loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
2903+
(rest || !(state.features & NodeResolutionFeatures.EsmMode)) && loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
28982904
loadNodeModuleFromDirectoryWorker(
28992905
extensions,
29002906
candidate,
@@ -2935,7 +2941,6 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions: Extensions, modu
29352941
return fromPaths.value;
29362942
}
29372943
}
2938-
29392944
return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
29402945
}
29412946

src/testRunner/unittests/tsserver/configuredProjects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,4 +1139,4 @@ describe("unittests:: tsserver:: ConfiguredProjects:: when reading tsconfig file
11391139

11401140
baselineTsserverLogs("configuredProjects", "should be tolerated without crashing the server when reading tsconfig file fails", session);
11411141
});
1142-
});
1142+
});

tests/baselines/reference/cachedModuleResolution1.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export declare let x: number
77
import {x} from "foo";
88

99
//// [lib.ts]
10-
import {x} from "foo";
10+
import {x} from "foo";
11+
1112

1213
//// [app.js]
1314
"use strict";

tests/baselines/reference/cachedModuleResolution5.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export declare let x: number
77
import {x} from "foo";
88

99
//// [lib.ts]
10-
import {x} from "foo";
10+
import {x} from "foo";
11+
1112

1213
//// [app.js]
1314
"use strict";
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//// [tests/cases/compiler/nodeColonModuleResolution.ts] ////
2+
3+
//// [ph.d.ts]
4+
declare module 'ph' {
5+
namespace constants {
6+
const NODE_PERFORMANCE_GC_MAJOR: number;
7+
const NODE_PERFORMANCE_GC_MINOR: number;
8+
const NODE_PERFORMANCE_GC_INCREMENTAL: number;
9+
const NODE_PERFORMANCE_GC_WEAKCB: number;
10+
const NODE_PERFORMANCE_GC_FLAGS_NO: number;
11+
const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
12+
const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
13+
const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
14+
const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
15+
const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
16+
const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
17+
}
18+
}
19+
declare module 'node:ph' {
20+
export * from 'ph';
21+
}
22+
//// [main.ts]
23+
import * as ph from 'node:ph'
24+
console.log(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE)
25+
26+
27+
//// [main.js]
28+
"use strict";
29+
Object.defineProperty(exports, "__esModule", { value: true });
30+
var ph = require("node:ph");
31+
console.log(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE);
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
=== /a/b/node_modules/@types/node/ph.d.ts ===
2+
declare module 'ph' {
3+
>'ph' : Symbol("ph", Decl(ph.d.ts, 0, 0))
4+
5+
namespace constants {
6+
>constants : Symbol(constants, Decl(ph.d.ts, 0, 21))
7+
8+
const NODE_PERFORMANCE_GC_MAJOR: number;
9+
>NODE_PERFORMANCE_GC_MAJOR : Symbol(NODE_PERFORMANCE_GC_MAJOR, Decl(ph.d.ts, 2, 13))
10+
11+
const NODE_PERFORMANCE_GC_MINOR: number;
12+
>NODE_PERFORMANCE_GC_MINOR : Symbol(NODE_PERFORMANCE_GC_MINOR, Decl(ph.d.ts, 3, 13))
13+
14+
const NODE_PERFORMANCE_GC_INCREMENTAL: number;
15+
>NODE_PERFORMANCE_GC_INCREMENTAL : Symbol(NODE_PERFORMANCE_GC_INCREMENTAL, Decl(ph.d.ts, 4, 13))
16+
17+
const NODE_PERFORMANCE_GC_WEAKCB: number;
18+
>NODE_PERFORMANCE_GC_WEAKCB : Symbol(NODE_PERFORMANCE_GC_WEAKCB, Decl(ph.d.ts, 5, 13))
19+
20+
const NODE_PERFORMANCE_GC_FLAGS_NO: number;
21+
>NODE_PERFORMANCE_GC_FLAGS_NO : Symbol(NODE_PERFORMANCE_GC_FLAGS_NO, Decl(ph.d.ts, 6, 13))
22+
23+
const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
24+
>NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED : Symbol(NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED, Decl(ph.d.ts, 7, 13))
25+
26+
const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
27+
>NODE_PERFORMANCE_GC_FLAGS_FORCED : Symbol(NODE_PERFORMANCE_GC_FLAGS_FORCED, Decl(ph.d.ts, 8, 13))
28+
29+
const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
30+
>NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING : Symbol(NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING, Decl(ph.d.ts, 9, 13))
31+
32+
const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
33+
>NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : Symbol(NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE, Decl(ph.d.ts, 10, 13))
34+
35+
const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
36+
>NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY : Symbol(NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY, Decl(ph.d.ts, 11, 13))
37+
38+
const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
39+
>NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE : Symbol(NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE, Decl(ph.d.ts, 12, 13))
40+
}
41+
}
42+
declare module 'node:ph' {
43+
>'node:ph' : Symbol("node:ph", Decl(ph.d.ts, 14, 1))
44+
45+
export * from 'ph';
46+
}
47+
=== /a/b/main.ts ===
48+
import * as ph from 'node:ph'
49+
>ph : Symbol(ph, Decl(main.ts, 0, 6))
50+
51+
console.log(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE)
52+
>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
53+
>console : Symbol(console, Decl(lib.dom.d.ts, --, --))
54+
>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
55+
>ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : Symbol(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE, Decl(ph.d.ts, 10, 13))
56+
>ph.constants : Symbol(ph.constants, Decl(ph.d.ts, 0, 21))
57+
>ph : Symbol(ph, Decl(main.ts, 0, 6))
58+
>constants : Symbol(ph.constants, Decl(ph.d.ts, 0, 21))
59+
>NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : Symbol(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE, Decl(ph.d.ts, 10, 13))
60+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
[
2+
"======== Resolving module 'node:ph' from '/a/b/main.ts'. ========",
3+
"Explicitly specified module resolution kind: 'Node10'.",
4+
"Skipping module 'node:ph' that looks like an absolute URI, target file types: TypeScript, Declaration.",
5+
"Skipping module 'node:ph' that looks like an absolute URI, target file types: JavaScript.",
6+
"======== Module name 'node:ph' was not resolved. ========",
7+
"======== Resolving module '@typescript/lib-es5' from '__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========",
8+
"Explicitly specified module resolution kind: 'Node10'.",
9+
"Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.",
10+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
11+
"Scoped package detected, looking in 'typescript__lib-es5'",
12+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
13+
"Scoped package detected, looking in 'typescript__lib-es5'",
14+
"Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.",
15+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
16+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
17+
"======== Module name '@typescript/lib-es5' was not resolved. ========",
18+
"======== Resolving module '@typescript/lib-decorators' from '__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========",
19+
"Explicitly specified module resolution kind: 'Node10'.",
20+
"Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.",
21+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
22+
"Scoped package detected, looking in 'typescript__lib-decorators'",
23+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
24+
"Scoped package detected, looking in 'typescript__lib-decorators'",
25+
"Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.",
26+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
27+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
28+
"======== Module name '@typescript/lib-decorators' was not resolved. ========",
29+
"======== Resolving module '@typescript/lib-decorators/legacy' from '__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========",
30+
"Explicitly specified module resolution kind: 'Node10'.",
31+
"Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.",
32+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
33+
"Scoped package detected, looking in 'typescript__lib-decorators/legacy'",
34+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
35+
"Scoped package detected, looking in 'typescript__lib-decorators/legacy'",
36+
"Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.",
37+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
38+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
39+
"======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========",
40+
"======== Resolving module '@typescript/lib-dom' from '__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========",
41+
"Explicitly specified module resolution kind: 'Node10'.",
42+
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.",
43+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
44+
"Scoped package detected, looking in 'typescript__lib-dom'",
45+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
46+
"Scoped package detected, looking in 'typescript__lib-dom'",
47+
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.",
48+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
49+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
50+
"======== Module name '@typescript/lib-dom' was not resolved. ========",
51+
"======== Resolving module '@typescript/lib-webworker/importscripts' from '__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========",
52+
"Explicitly specified module resolution kind: 'Node10'.",
53+
"Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.",
54+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
55+
"Scoped package detected, looking in 'typescript__lib-webworker/importscripts'",
56+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
57+
"Scoped package detected, looking in 'typescript__lib-webworker/importscripts'",
58+
"Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.",
59+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
60+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
61+
"======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========",
62+
"======== Resolving module '@typescript/lib-scripthost' from '__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========",
63+
"Explicitly specified module resolution kind: 'Node10'.",
64+
"Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.",
65+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
66+
"Scoped package detected, looking in 'typescript__lib-scripthost'",
67+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
68+
"Scoped package detected, looking in 'typescript__lib-scripthost'",
69+
"Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.",
70+
"Directory 'node_modules' does not exist, skipping all lookups in it.",
71+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
72+
"======== Module name '@typescript/lib-scripthost' was not resolved. ========"
73+
]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
=== /a/b/node_modules/@types/node/ph.d.ts ===
2+
declare module 'ph' {
3+
>'ph' : typeof import("ph")
4+
5+
namespace constants {
6+
>constants : typeof constants
7+
8+
const NODE_PERFORMANCE_GC_MAJOR: number;
9+
>NODE_PERFORMANCE_GC_MAJOR : number
10+
11+
const NODE_PERFORMANCE_GC_MINOR: number;
12+
>NODE_PERFORMANCE_GC_MINOR : number
13+
14+
const NODE_PERFORMANCE_GC_INCREMENTAL: number;
15+
>NODE_PERFORMANCE_GC_INCREMENTAL : number
16+
17+
const NODE_PERFORMANCE_GC_WEAKCB: number;
18+
>NODE_PERFORMANCE_GC_WEAKCB : number
19+
20+
const NODE_PERFORMANCE_GC_FLAGS_NO: number;
21+
>NODE_PERFORMANCE_GC_FLAGS_NO : number
22+
23+
const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
24+
>NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED : number
25+
26+
const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
27+
>NODE_PERFORMANCE_GC_FLAGS_FORCED : number
28+
29+
const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
30+
>NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING : number
31+
32+
const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
33+
>NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : number
34+
35+
const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
36+
>NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY : number
37+
38+
const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
39+
>NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE : number
40+
}
41+
}
42+
declare module 'node:ph' {
43+
>'node:ph' : typeof import("node:ph")
44+
45+
export * from 'ph';
46+
}
47+
=== /a/b/main.ts ===
48+
import * as ph from 'node:ph'
49+
>ph : typeof ph
50+
51+
console.log(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE)
52+
>console.log(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE) : void
53+
>console.log : (...data: any[]) => void
54+
>console : Console
55+
>log : (...data: any[]) => void
56+
>ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : number
57+
>ph.constants : typeof ph.constants
58+
>ph : typeof ph
59+
>constants : typeof ph.constants
60+
>NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : number
61+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//// [tests/cases/compiler/nodeColonModuleResolution2.ts] ////
2+
3+
//// [index.d.ts]
4+
export namespace constants {
5+
const NODE_PERFORMANCE_GC_MAJOR: number;
6+
const NODE_PERFORMANCE_GC_MINOR: number;
7+
const NODE_PERFORMANCE_GC_INCREMENTAL: number;
8+
const NODE_PERFORMANCE_GC_WEAKCB: number;
9+
const NODE_PERFORMANCE_GC_FLAGS_NO: number;
10+
const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
11+
const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
12+
const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
13+
const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
14+
const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
15+
const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
16+
}
17+
//// [main.ts]
18+
import * as ph from 'fake:thing'
19+
console.log(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE)
20+
21+
22+
//// [main.js]
23+
"use strict";
24+
Object.defineProperty(exports, "__esModule", { value: true });
25+
var ph = require("fake:thing");
26+
console.log(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE);
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
=== /a/b/node_modules/fake/thing/index.d.ts ===
2+
export namespace constants {
3+
>constants : Symbol(constants, Decl(index.d.ts, 0, 0))
4+
5+
const NODE_PERFORMANCE_GC_MAJOR: number;
6+
>NODE_PERFORMANCE_GC_MAJOR : Symbol(NODE_PERFORMANCE_GC_MAJOR, Decl(index.d.ts, 1, 9))
7+
8+
const NODE_PERFORMANCE_GC_MINOR: number;
9+
>NODE_PERFORMANCE_GC_MINOR : Symbol(NODE_PERFORMANCE_GC_MINOR, Decl(index.d.ts, 2, 9))
10+
11+
const NODE_PERFORMANCE_GC_INCREMENTAL: number;
12+
>NODE_PERFORMANCE_GC_INCREMENTAL : Symbol(NODE_PERFORMANCE_GC_INCREMENTAL, Decl(index.d.ts, 3, 9))
13+
14+
const NODE_PERFORMANCE_GC_WEAKCB: number;
15+
>NODE_PERFORMANCE_GC_WEAKCB : Symbol(NODE_PERFORMANCE_GC_WEAKCB, Decl(index.d.ts, 4, 9))
16+
17+
const NODE_PERFORMANCE_GC_FLAGS_NO: number;
18+
>NODE_PERFORMANCE_GC_FLAGS_NO : Symbol(NODE_PERFORMANCE_GC_FLAGS_NO, Decl(index.d.ts, 5, 9))
19+
20+
const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
21+
>NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED : Symbol(NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED, Decl(index.d.ts, 6, 9))
22+
23+
const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
24+
>NODE_PERFORMANCE_GC_FLAGS_FORCED : Symbol(NODE_PERFORMANCE_GC_FLAGS_FORCED, Decl(index.d.ts, 7, 9))
25+
26+
const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
27+
>NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING : Symbol(NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING, Decl(index.d.ts, 8, 9))
28+
29+
const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
30+
>NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : Symbol(NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE, Decl(index.d.ts, 9, 9))
31+
32+
const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
33+
>NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY : Symbol(NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY, Decl(index.d.ts, 10, 9))
34+
35+
const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
36+
>NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE : Symbol(NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE, Decl(index.d.ts, 11, 9))
37+
}
38+
=== /a/b/main.ts ===
39+
import * as ph from 'fake:thing'
40+
>ph : Symbol(ph, Decl(main.ts, 0, 6))
41+
42+
console.log(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE)
43+
>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
44+
>console : Symbol(console, Decl(lib.dom.d.ts, --, --))
45+
>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
46+
>ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : Symbol(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE, Decl(index.d.ts, 9, 9))
47+
>ph.constants : Symbol(ph.constants, Decl(index.d.ts, 0, 0))
48+
>ph : Symbol(ph, Decl(main.ts, 0, 6))
49+
>constants : Symbol(ph.constants, Decl(index.d.ts, 0, 0))
50+
>NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE : Symbol(ph.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE, Decl(index.d.ts, 9, 9))
51+

0 commit comments

Comments
 (0)