зеркало из https://github.com/github/codeql.git
Merge pull request #2579 from asger-semmle/typescript-trace-resolution
Approved by max-schaefer
This commit is contained in:
Коммит
dc7863ce29
|
@ -12,7 +12,9 @@ export class Project {
|
|||
}
|
||||
|
||||
public load(): void {
|
||||
this.program = ts.createProgram(this.config.fileNames, this.config.options);
|
||||
let host = ts.createCompilerHost(this.config.options, true);
|
||||
host.trace = undefined; // Disable tracing which would otherwise go to standard out
|
||||
this.program = ts.createProgram(this.config.fileNames, this.config.options, host);
|
||||
this.typeTable.setProgram(this.program);
|
||||
}
|
||||
|
||||
|
|
1
javascript/ql/test/library-tests/TypeScript/RegressionTests/TraceResolution/node_modules/@types/foo/index.d.ts
сгенерированный
поставляемый
Normal file
1
javascript/ql/test/library-tests/TypeScript/RegressionTests/TraceResolution/node_modules/@types/foo/index.d.ts
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1 @@
|
|||
export function foo();
|
|
@ -0,0 +1,6 @@
|
|||
| node_modules/@types/foo/index.d.ts:1:17:1:19 | foo | () => any |
|
||||
| test.ts:1:10:1:12 | foo | () => any |
|
||||
| test.ts:1:10:1:12 | foo | () => any |
|
||||
| test.ts:1:21:1:25 | "foo" | any |
|
||||
| test.ts:3:1:3:3 | foo | () => any |
|
||||
| test.ts:3:1:3:5 | foo() | any |
|
|
@ -0,0 +1,3 @@
|
|||
import javascript
|
||||
|
||||
from Expr e select e, e.getType()
|
|
@ -0,0 +1,3 @@
|
|||
import { foo } from "foo";
|
||||
|
||||
foo();
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"include": ["."],
|
||||
"compilerOptions": {
|
||||
"traceResolution": true
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче