mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
TS: Fix handling of 'export ='
This commit is contained in:
@@ -372,7 +372,9 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
|
||||
function getEffectiveExportTarget(symbol: ts.Symbol) {
|
||||
if (symbol.exports != null && symbol.exports.has(ts.InternalSymbolName.ExportEquals)) {
|
||||
let exportAlias = symbol.exports.get(ts.InternalSymbolName.ExportEquals);
|
||||
return typeChecker.getAliasedSymbol(exportAlias);
|
||||
if (exportAlias.flags & ts.SymbolFlags.Alias) {
|
||||
return typeChecker.getAliasedSymbol(exportAlias);
|
||||
}
|
||||
}
|
||||
return symbol;
|
||||
}
|
||||
|
||||
14
javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/extern.d.ts
vendored
Normal file
14
javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/extern.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
class Foo {}
|
||||
|
||||
declare module 'foo' {
|
||||
export = new Foo();
|
||||
}
|
||||
|
||||
declare module 'bar' {
|
||||
import * as baz from "baz";
|
||||
export = baz;
|
||||
}
|
||||
|
||||
declare module 'baz' {
|
||||
export class C {}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
| "bar" in global scope |
|
||||
| C in module 'bar' |
|
||||
| Foo in global scope |
|
||||
| Foo in tst.ts |
|
||||
| module 'bar' |
|
||||
| module 'foo' |
|
||||
| tst.ts |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from CanonicalName name
|
||||
select name
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"include": ["."],
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import self from "./tst";
|
||||
|
||||
class Foo {}
|
||||
|
||||
export = new Foo();
|
||||
Reference in New Issue
Block a user