Skip to content
Permalink
Browse files
Fix assert in addIndirectUser in FAR (#50905)
  • Loading branch information
jakebailey committed Sep 22, 2022
1 parent bbec17d commit 645d1cd7c1ee1d65a87b2183b173611467256a09
Show file tree
Hide file tree
Showing 3 changed files with 314 additions and 1 deletion.
@@ -137,7 +137,7 @@ namespace ts.FindAllReferences {

case SyntaxKind.ImportType:
// Only check for typeof import('xyz')
if (direct.isTypeOf && !direct.qualifier && isExported(direct)) {
if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported(direct)) {
addIndirectUser(direct.getSourceFile(), /** addTransitiveDependencies */ true);
}
directImports.push(direct);
@@ -0,0 +1,293 @@
// === /packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts ===
// declare var [|debug|]: [|debug|].Debug & { debug: [|debug|].Debug; default: [|debug|].Debug };
// [|export|] = [|debug|];
// export as namespace debug;
// declare namespace [|debug|] {
// interface Debug {
// coerce: (val: any) => any;
// }
// }

// === /packages/playwright-core/src/index.ts ===
// export const debug: typeof import('[|../bundles/utils/node_modules//*FIND ALL REFS*/@types/debug|]') = require('./utilsBundleImpl').debug;

[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"kind": "module",
"name": "module \"/packages/playwright-core/bundles/utils/node_modules/@types/debug/index\"",
"textSpan": {
"start": 0,
"length": 211
},
"displayParts": [
{
"text": "module",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "\"/packages/playwright-core/bundles/utils/node_modules/@types/debug/index\"",
"kind": "stringLiteral"
}
]
},
"references": [
{
"textSpan": {
"start": 79,
"length": 6
},
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"contextSpan": {
"start": 79,
"length": 15
},
"isWriteAccess": false
}
]
},
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"kind": "var",
"name": "namespace debug\nvar debug: debug.Debug & {\n debug: debug.Debug;\n default: debug.Debug;\n}",
"textSpan": {
"start": 12,
"length": 5
},
"displayParts": [
{
"text": "namespace",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "debug",
"kind": "localName"
},
{
"text": "\n",
"kind": "lineBreak"
},
{
"text": "var",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "debug",
"kind": "localName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "debug",
"kind": "localName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "Debug",
"kind": "interfaceName"
},
{
"text": " ",
"kind": "space"
},
{
"text": "&",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "{",
"kind": "punctuation"
},
{
"text": "\n",
"kind": "lineBreak"
},
{
"text": " ",
"kind": "space"
},
{
"text": "debug",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "debug",
"kind": "localName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "Debug",
"kind": "text"
},
{
"text": ";",
"kind": "punctuation"
},
{
"text": "\n",
"kind": "lineBreak"
},
{
"text": " ",
"kind": "space"
},
{
"text": "default",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "debug",
"kind": "localName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "Debug",
"kind": "text"
},
{
"text": ";",
"kind": "punctuation"
},
{
"text": "\n",
"kind": "lineBreak"
},
{
"text": "}",
"kind": "punctuation"
}
],
"contextSpan": {
"start": 0,
"length": 78
}
},
"references": [
{
"textSpan": {
"start": 12,
"length": 5
},
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"contextSpan": {
"start": 0,
"length": 78
},
"isWriteAccess": true
},
{
"textSpan": {
"start": 19,
"length": 5
},
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"isWriteAccess": false
},
{
"textSpan": {
"start": 42,
"length": 5
},
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"isWriteAccess": false
},
{
"textSpan": {
"start": 64,
"length": 5
},
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"isWriteAccess": false
},
{
"textSpan": {
"start": 88,
"length": 5
},
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"contextSpan": {
"start": 79,
"length": 15
},
"isWriteAccess": false
},
{
"textSpan": {
"start": 35,
"length": 42
},
"fileName": "/packages/playwright-core/src/index.ts",
"contextSpan": {
"start": 0,
"length": 117
},
"isWriteAccess": false
},
{
"textSpan": {
"start": 140,
"length": 5
},
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
"contextSpan": {
"start": 122,
"length": 89
},
"isWriteAccess": true
}
]
}
]
@@ -0,0 +1,20 @@
/// <reference path="fourslash.ts" />

// @Filename: /packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts
//// declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };
//// export = debug;
//// export as namespace debug;
//// declare namespace debug {
//// interface Debug {
//// coerce: (val: any) => any;
//// }
//// }

// @Filename: /packages/playwright-core/bundles/utils/node_modules/@types/debug/package.json
//// { "types": "index.d.ts" }

// @Filename: /packages/playwright-core/src/index.ts
//// export const debug: typeof import('../bundles/utils/node_modules//*1*/@types/debug') = require('./utilsBundleImpl').debug;


verify.baselineFindAllReferences('1');

0 comments on commit 645d1cd

Please sign in to comment.