
committed by
Matias Niemelä

parent
c230173716
commit
5653fada32
@ -224,7 +224,8 @@ function isEligibleForLowering(node: ts.Node | undefined): boolean {
|
||||
return false;
|
||||
case ts.SyntaxKind.VariableDeclaration:
|
||||
// Avoid lowering expressions already in an exported variable declaration
|
||||
return (ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) == 0;
|
||||
return (ts.getCombinedModifierFlags(node as ts.VariableDeclaration) &
|
||||
ts.ModifierFlags.Export) == 0;
|
||||
}
|
||||
return isEligibleForLowering(node.parent);
|
||||
}
|
||||
@ -370,7 +371,7 @@ function createExportTableFor(sourceFile: ts.SourceFile): Set<string> {
|
||||
case ts.SyntaxKind.ClassDeclaration:
|
||||
case ts.SyntaxKind.FunctionDeclaration:
|
||||
case ts.SyntaxKind.InterfaceDeclaration:
|
||||
if ((ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) != 0) {
|
||||
if ((ts.getCombinedModifierFlags(node as ts.Declaration) & ts.ModifierFlags.Export) != 0) {
|
||||
const classDeclaration =
|
||||
node as(ts.ClassDeclaration | ts.FunctionDeclaration | ts.InterfaceDeclaration);
|
||||
const name = classDeclaration.name;
|
||||
@ -385,7 +386,7 @@ function createExportTableFor(sourceFile: ts.SourceFile): Set<string> {
|
||||
break;
|
||||
case ts.SyntaxKind.VariableDeclaration:
|
||||
const variableDeclaration = node as ts.VariableDeclaration;
|
||||
if ((ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) != 0 &&
|
||||
if ((ts.getCombinedModifierFlags(variableDeclaration) & ts.ModifierFlags.Export) != 0 &&
|
||||
variableDeclaration.name.kind == ts.SyntaxKind.Identifier) {
|
||||
const name = variableDeclaration.name as ts.Identifier;
|
||||
exportTable.add(name.text);
|
||||
|
Reference in New Issue
Block a user