
committed by
Matias Niemelä

parent
c230173716
commit
5653fada32
@ -12,7 +12,8 @@ import {Evaluator, errorSymbol, recordMapEntry} from './evaluator';
|
||||
import {ClassMetadata, ConstructorMetadata, FunctionMetadata, InterfaceMetadata, METADATA_VERSION, MemberMetadata, MetadataEntry, MetadataError, MetadataMap, MetadataSymbolicBinaryExpression, MetadataSymbolicCallExpression, MetadataSymbolicExpression, MetadataSymbolicIfExpression, MetadataSymbolicIndexExpression, MetadataSymbolicPrefixExpression, MetadataSymbolicReferenceExpression, MetadataSymbolicSelectExpression, MetadataSymbolicSpreadExpression, MetadataValue, MethodMetadata, ModuleExportMetadata, ModuleMetadata, isClassMetadata, isConstructorMetadata, isFunctionMetadata, isMetadataError, isMetadataGlobalReferenceExpression, isMetadataImportDefaultReference, isMetadataImportedSymbolReferenceExpression, isMetadataSymbolicExpression, isMetadataSymbolicReferenceExpression, isMetadataSymbolicSelectExpression, isMethodMetadata} from './schema';
|
||||
import {Symbols} from './symbols';
|
||||
|
||||
const isStatic = (node: ts.Node) => ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Static;
|
||||
const isStatic = (node: ts.Declaration) =>
|
||||
ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Static;
|
||||
|
||||
/**
|
||||
* A set of collector options to use when collecting metadata.
|
||||
@ -277,8 +278,8 @@ export class MetadataCollector {
|
||||
}
|
||||
});
|
||||
|
||||
const isExport = (node: ts.Node) =>
|
||||
sourceFile.isDeclarationFile || ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export;
|
||||
const isExport = (node: ts.Node) => sourceFile.isDeclarationFile ||
|
||||
ts.getCombinedModifierFlags(node as ts.Declaration) & ts.ModifierFlags.Export;
|
||||
const isExportedIdentifier = (identifier?: ts.Identifier) =>
|
||||
identifier && exportMap.has(identifier.text);
|
||||
const isExported =
|
||||
|
@ -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);
|
||||
|
@ -102,14 +102,14 @@ const defaultEmitCallback: TsEmitCallback =
|
||||
* Minimum supported TypeScript version
|
||||
* ∀ supported typescript version v, v >= MIN_TS_VERSION
|
||||
*/
|
||||
const MIN_TS_VERSION = '2.7.2';
|
||||
const MIN_TS_VERSION = '3.0.1';
|
||||
|
||||
/**
|
||||
* Supremum of supported TypeScript versions
|
||||
* ∀ supported typescript version v, v < MAX_TS_VERSION
|
||||
* MAX_TS_VERSION is not considered as a supported TypeScript version
|
||||
*/
|
||||
const MAX_TS_VERSION = '2.10.0';
|
||||
const MAX_TS_VERSION = '3.1.0';
|
||||
|
||||
class AngularCompilerProgram implements Program {
|
||||
private rootNames: string[];
|
||||
|
Reference in New Issue
Block a user