Merge pull request #1983 from Microsoft/es6Import

Support ES6 import and export declarations
This commit is contained in:
Anders Hejlsberg 2015-02-23 13:04:00 -08:00
commit 4aae41b996
88 changed files with 3908 additions and 1659 deletions

View File

@ -15,12 +15,12 @@ module ts {
if (node.kind === SyntaxKind.InterfaceDeclaration || node.kind === SyntaxKind.TypeAliasDeclaration) {
return ModuleInstanceState.NonInstantiated;
}
// 2. const enum declarations don't make module instantiated
// 2. const enum declarations
else if (isConstEnumDeclaration(node)) {
return ModuleInstanceState.ConstEnumOnly;
}
// 3. non - exported import declarations
else if (node.kind === SyntaxKind.ImportDeclaration && !(node.flags & NodeFlags.Export)) {
// 3. non-exported import declarations
else if ((node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration) && !(node.flags & NodeFlags.Export)) {
return ModuleInstanceState.NonInstantiated;
}
// 4. other uninstantiated module declarations.
@ -179,41 +179,39 @@ module ts {
}
function declareModuleMember(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags) {
// Exported module members are given 2 symbols: A local symbol that is classified with an ExportValue,
// ExportType, or ExportContainer flag, and an associated export symbol with all the correct flags set
// on it. There are 2 main reasons:
//
// 1. We treat locals and exports of the same name as mutually exclusive within a container.
// That means the binder will issue a Duplicate Identifier error if you mix locals and exports
// with the same name in the same container.
// TODO: Make this a more specific error and decouple it from the exclusion logic.
// 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol,
// but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way
// when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope.
var exportKind = 0;
if (symbolKind & SymbolFlags.Value) {
exportKind |= SymbolFlags.ExportValue;
var hasExportModifier = getCombinedNodeFlags(node) & NodeFlags.Export;
if (symbolKind & SymbolFlags.Import) {
if (node.kind === SyntaxKind.ExportSpecifier || (node.kind === SyntaxKind.ImportEqualsDeclaration && hasExportModifier)) {
declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes);
}
else {
declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes);
}
}
if (symbolKind & SymbolFlags.Type) {
exportKind |= SymbolFlags.ExportType;
}
if (symbolKind & SymbolFlags.Namespace) {
exportKind |= SymbolFlags.ExportNamespace;
}
if (getCombinedNodeFlags(node) & NodeFlags.Export || (node.kind !== SyntaxKind.ImportDeclaration && isAmbientContext(container))) {
if (exportKind) {
else {
// Exported module members are given 2 symbols: A local symbol that is classified with an ExportValue,
// ExportType, or ExportContainer flag, and an associated export symbol with all the correct flags set
// on it. There are 2 main reasons:
//
// 1. We treat locals and exports of the same name as mutually exclusive within a container.
// That means the binder will issue a Duplicate Identifier error if you mix locals and exports
// with the same name in the same container.
// TODO: Make this a more specific error and decouple it from the exclusion logic.
// 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol,
// but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way
// when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope.
if (hasExportModifier || isAmbientContext(container)) {
var exportKind = (symbolKind & SymbolFlags.Value ? SymbolFlags.ExportValue : 0) |
(symbolKind & SymbolFlags.Type ? SymbolFlags.ExportType : 0) |
(symbolKind & SymbolFlags.Namespace ? SymbolFlags.ExportNamespace : 0);
var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes);
local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes);
node.localSymbol = local;
}
else {
declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes);
declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes);
}
}
else {
declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes);
}
}
// All container nodes are kept on a linked list in declaration order. This list is used by the getLocalNameOfContainer function
@ -312,6 +310,13 @@ module ts {
}
}
function bindExportDeclaration(node: ExportDeclaration) {
if (!node.exportClause) {
((<ExportContainer>container).exportStars || ((<ExportContainer>container).exportStars = [])).push(node);
}
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
}
function bindFunctionOrConstructorType(node: SignatureDeclaration) {
// For a given function symbol "<...>(...) => T" we want to generate a symbol identical
// to the one we would get for: { <...>(...): T }
@ -467,9 +472,23 @@ module ts {
case SyntaxKind.ModuleDeclaration:
bindModuleDeclaration(<ModuleDeclaration>node);
break;
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.NamespaceImport:
case SyntaxKind.ImportSpecifier:
case SyntaxKind.ExportSpecifier:
bindDeclaration(<Declaration>node, SymbolFlags.Import, SymbolFlags.ImportExcludes, /*isBlockScopeContainer*/ false);
break;
case SyntaxKind.ExportDeclaration:
bindExportDeclaration(<ExportDeclaration>node);
break;
case SyntaxKind.ImportClause:
if ((<ImportClause>node).name) {
bindDeclaration(<Declaration>node, SymbolFlags.Import, SymbolFlags.ImportExcludes, /*isBlockScopeContainer*/ false);
}
else {
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
}
break;
case SyntaxKind.SourceFile:
if (isExternalModule(<SourceFile>node)) {
bindAnonymousDeclaration(<SourceFile>node, SymbolFlags.ValueModule, '"' + removeFileExtension((<SourceFile>node).fileName) + '"', /*isBlockScopeContainer*/ true);

View File

@ -186,7 +186,7 @@ module ts {
return result;
}
function extendSymbol(target: Symbol, source: Symbol) {
function mergeSymbol(target: Symbol, source: Symbol) {
if (!(target.flags & getExcludedSymbolFlags(source.flags))) {
if (source.flags & SymbolFlags.ValueModule && target.flags & SymbolFlags.ValueModule && target.constEnumOnlyModule && !source.constEnumOnlyModule) {
// reset flag when merging instantiated module into value module that has only const enums
@ -199,11 +199,11 @@ module ts {
});
if (source.members) {
if (!target.members) target.members = {};
extendSymbolTable(target.members, source.members);
mergeSymbolTable(target.members, source.members);
}
if (source.exports) {
if (!target.exports) target.exports = {};
extendSymbolTable(target.exports, source.exports);
mergeSymbolTable(target.exports, source.exports);
}
recordMergedSymbol(target, source);
}
@ -229,7 +229,7 @@ module ts {
return result;
}
function extendSymbolTable(target: SymbolTable, source: SymbolTable) {
function mergeSymbolTable(target: SymbolTable, source: SymbolTable) {
for (var id in source) {
if (hasProperty(source, id)) {
if (!hasProperty(target, id)) {
@ -240,12 +240,20 @@ module ts {
if (!(symbol.flags & SymbolFlags.Merged)) {
target[id] = symbol = cloneSymbol(symbol);
}
extendSymbol(symbol, source[id]);
mergeSymbol(symbol, source[id]);
}
}
}
}
function extendSymbolTable(target: SymbolTable, source: SymbolTable) {
for (var id in source) {
if (!hasProperty(target, id)) {
target[id] = source[id];
}
}
}
function getSymbolLinks(symbol: Symbol): SymbolLinks {
if (symbol.flags & SymbolFlags.Transient) return <TransientSymbol>symbol;
if (!symbol.id) symbol.id = nextSymbolId++;
@ -323,7 +331,10 @@ module ts {
if (!isExternalModule(<SourceFile>location)) break;
case SyntaxKind.ModuleDeclaration:
if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.ModuleMember)) {
break loop;
if (!(result.flags & SymbolFlags.Import && getDeclarationOfImportSymbol(result).kind === SyntaxKind.ExportSpecifier)) {
break loop;
}
result = undefined;
}
break;
case SyntaxKind.EnumDeclaration:
@ -449,22 +460,89 @@ module ts {
return result;
}
function isImportSymbolDeclaration(node: Node): boolean {
return node.kind === SyntaxKind.ImportEqualsDeclaration ||
node.kind === SyntaxKind.ImportClause && !!(<ImportClause>node).name ||
node.kind === SyntaxKind.NamespaceImport ||
node.kind === SyntaxKind.ImportSpecifier ||
node.kind === SyntaxKind.ExportSpecifier;
}
function getDeclarationOfImportSymbol(symbol: Symbol): Declaration {
return forEach(symbol.declarations, d => isImportSymbolDeclaration(d) ? d : undefined);
}
function getTargetOfImportEqualsDeclaration(node: ImportEqualsDeclaration): Symbol {
if (node.moduleReference.kind === SyntaxKind.ExternalModuleReference) {
var moduleSymbol = resolveExternalModuleName(node, getExternalModuleImportEqualsDeclarationExpression(node));
var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol);
return exportAssignmentSymbol || moduleSymbol;
}
return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>node.moduleReference, node);
}
function getTargetOfImportClause(node: ImportClause): Symbol {
var moduleSymbol = resolveExternalModuleName(node, (<ImportDeclaration>node.parent).moduleSpecifier);
if (moduleSymbol) {
var exportAssignmentSymbol = getResolvedExportAssignmentSymbol(moduleSymbol);
if (!exportAssignmentSymbol) {
error(node.name, Diagnostics.External_module_0_has_no_default_export_or_export_assignment, symbolToString(moduleSymbol));
}
return exportAssignmentSymbol;
}
}
function getTargetOfNamespaceImport(node: NamespaceImport): Symbol {
return resolveExternalModuleName(node, (<ImportDeclaration>node.parent.parent).moduleSpecifier);
}
function getExternalModuleMember(node: ImportDeclaration | ExportDeclaration, specifier: ImportOrExportSpecifier): Symbol {
var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier);
if (moduleSymbol) {
var name = specifier.propertyName || specifier.name;
if (name.text) {
var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), name.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
if (!symbol) {
error(name, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), declarationNameToString(name));
return;
}
return symbol.flags & (SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace) ? symbol : resolveImport(symbol);
}
}
}
function getTargetOfImportSpecifier(node: ImportSpecifier): Symbol {
return getExternalModuleMember(<ImportDeclaration>node.parent.parent.parent, node);
}
function getTargetOfExportSpecifier(node: ExportSpecifier): Symbol {
return (<ExportDeclaration>node.parent.parent).moduleSpecifier ?
getExternalModuleMember(<ExportDeclaration>node.parent.parent, node) :
resolveEntityName(node, node.propertyName || node.name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
}
function getTargetOfImportDeclaration(node: Declaration): Symbol {
switch (node.kind) {
case SyntaxKind.ImportEqualsDeclaration:
return getTargetOfImportEqualsDeclaration(<ImportEqualsDeclaration>node);
case SyntaxKind.ImportClause:
return getTargetOfImportClause(<ImportClause>node);
case SyntaxKind.NamespaceImport:
return getTargetOfNamespaceImport(<NamespaceImport>node);
case SyntaxKind.ImportSpecifier:
return getTargetOfImportSpecifier(<ImportSpecifier>node);
case SyntaxKind.ExportSpecifier:
return getTargetOfExportSpecifier(<ExportSpecifier>node);
}
}
function resolveImport(symbol: Symbol): Symbol {
Debug.assert((symbol.flags & SymbolFlags.Import) !== 0, "Should only get Imports here.");
var links = getSymbolLinks(symbol);
if (!links.target) {
links.target = resolvingSymbol;
var node = <ImportDeclaration>getDeclarationOfKind(symbol, SyntaxKind.ImportDeclaration);
// Grammar checking
if (node.moduleReference.kind === SyntaxKind.ExternalModuleReference) {
if ((<ExternalModuleReference>node.moduleReference).expression.kind !== SyntaxKind.StringLiteral) {
grammarErrorOnNode((<ExternalModuleReference>node.moduleReference).expression, Diagnostics.String_literal_expected);
}
}
var target = node.moduleReference.kind === SyntaxKind.ExternalModuleReference
? resolveExternalModuleName(node, getExternalModuleImportDeclarationExpression(node))
: getSymbolOfPartOfRightHandSideOfImport(<EntityName>node.moduleReference, node);
var node = getDeclarationOfImportSymbol(symbol);
var target = getTargetOfImportDeclaration(node);
if (links.target === resolvingSymbol) {
links.target = target || unknownSymbol;
}
@ -479,9 +557,9 @@ module ts {
}
// This function is only for imports with entity names
function getSymbolOfPartOfRightHandSideOfImport(entityName: EntityName, importDeclaration?: ImportDeclaration): Symbol {
function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, importDeclaration?: ImportEqualsDeclaration): Symbol {
if (!importDeclaration) {
importDeclaration = <ImportDeclaration>getAncestor(entityName, SyntaxKind.ImportDeclaration);
importDeclaration = <ImportEqualsDeclaration>getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration);
Debug.assert(importDeclaration !== undefined);
}
// There are three things we might try to look for. In the following examples,
@ -500,7 +578,7 @@ module ts {
else {
// Case 2 in above example
// entityName.kind could be a QualifiedName or a Missing identifier
Debug.assert(entityName.parent.kind === SyntaxKind.ImportDeclaration);
Debug.assert(entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration);
return resolveEntityName(importDeclaration, entityName, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
}
}
@ -524,7 +602,7 @@ module ts {
else if (name.kind === SyntaxKind.QualifiedName) {
var namespace = resolveEntityName(location,(<QualifiedName>name).left, SymbolFlags.Namespace);
if (!namespace || namespace === unknownSymbol || getFullWidth((<QualifiedName>name).right) === 0) return;
var symbol = getSymbol(namespace.exports,(<QualifiedName>name).right.text, meaning);
var symbol = getSymbol(getExportsOfSymbol(namespace), (<QualifiedName>name).right.text, meaning);
if (!symbol) {
error(location, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace),
declarationNameToString((<QualifiedName>name).right));
@ -559,7 +637,7 @@ module ts {
if (!isRelative) {
var symbol = getSymbol(globals, '"' + moduleName + '"', SymbolFlags.ValueModule);
if (symbol) {
return getResolvedExportSymbol(symbol);
return symbol;
}
}
while (true) {
@ -572,7 +650,7 @@ module ts {
}
if (sourceFile) {
if (sourceFile.symbol) {
return getResolvedExportSymbol(sourceFile.symbol);
return sourceFile.symbol;
}
error(moduleReferenceLiteral, Diagnostics.File_0_is_not_an_external_module, sourceFile.fileName);
return;
@ -580,7 +658,7 @@ module ts {
error(moduleReferenceLiteral, Diagnostics.Cannot_find_external_module_0, moduleName);
}
function getResolvedExportSymbol(moduleSymbol: Symbol): Symbol {
function getResolvedExportAssignmentSymbol(moduleSymbol: Symbol): Symbol {
var symbol = getExportAssignmentSymbol(moduleSymbol);
if (symbol) {
if (symbol.flags & (SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace)) {
@ -590,18 +668,16 @@ module ts {
return resolveImport(symbol);
}
}
return moduleSymbol;
}
function getExportAssignmentSymbol(symbol: Symbol): Symbol {
checkTypeOfExportAssignmentSymbol(symbol);
var symbolLinks = getSymbolLinks(symbol);
return symbolLinks.exportAssignSymbol === unknownSymbol ? undefined : symbolLinks.exportAssignSymbol;
return getSymbolLinks(symbol).exportAssignmentSymbol;
}
function checkTypeOfExportAssignmentSymbol(containerSymbol: Symbol): void {
var symbolLinks = getSymbolLinks(containerSymbol);
if (!symbolLinks.exportAssignSymbol) {
if (!symbolLinks.exportAssignmentChecked) {
var exportInformation = collectExportInformationForSourceFileOrModule(containerSymbol);
if (exportInformation.exportAssignments.length) {
if (exportInformation.exportAssignments.length > 1) {
@ -621,8 +697,9 @@ module ts {
var meaning = SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace;
var exportSymbol = resolveName(node, node.exportName.text, meaning, Diagnostics.Cannot_find_name_0, node.exportName);
}
symbolLinks.exportAssignmentSymbol = exportSymbol || unknownSymbol;
}
symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol;
symbolLinks.exportAssignmentChecked = true;
}
}
@ -646,6 +723,41 @@ module ts {
};
}
function getExportsOfSymbol(symbol: Symbol): SymbolTable {
return symbol.flags & SymbolFlags.Module ? getExportsOfModule(symbol) : symbol.exports;
}
function getExportsOfModule(symbol: Symbol): SymbolTable {
var links = getSymbolLinks(symbol);
return links.resolvedExports || (links.resolvedExports = getExportsForModule(symbol));
}
function getExportsForModule(symbol: Symbol): SymbolTable {
var result: SymbolTable;
var visitedSymbols: Symbol[] = [];
visit(symbol);
return result;
function visit(symbol: Symbol) {
if (!contains(visitedSymbols, symbol)) {
visitedSymbols.push(symbol);
if (!result) {
result = symbol.exports;
}
else {
extendSymbolTable(result, symbol.exports);
}
forEach(symbol.declarations, node => {
if (node.kind === SyntaxKind.SourceFile || node.kind === SyntaxKind.ModuleDeclaration) {
forEach((<ExportContainer>node).exportStars, exportStar => {
visit(resolveExternalModuleName(exportStar, exportStar.moduleSpecifier));
});
}
});
}
}
}
function getMergedSymbol(symbol: Symbol): Symbol {
var merged: Symbol;
return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol;
@ -824,7 +936,7 @@ module ts {
if (symbolFromSymbolTable.flags & SymbolFlags.Import) {
if (!useOnlyExternalAliasing || // We can use any type of alias to get the name
// Is this external alias, then use it to name
ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportDeclaration)) {
ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) {
var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable);
if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) {
@ -950,7 +1062,7 @@ module ts {
}
function hasVisibleDeclarations(symbol: Symbol): SymbolVisibilityResult {
var aliasesToMakeVisible: ImportDeclaration[];
var aliasesToMakeVisible: ImportEqualsDeclaration[];
if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) {
return undefined;
}
@ -960,17 +1072,17 @@ module ts {
if (!isDeclarationVisible(declaration)) {
// Mark the unexported alias as visible if its parent is visible
// because these kind of aliases can be used to name types in declaration file
if (declaration.kind === SyntaxKind.ImportDeclaration &&
if (declaration.kind === SyntaxKind.ImportEqualsDeclaration &&
!(declaration.flags & NodeFlags.Export) &&
isDeclarationVisible(<Declaration>declaration.parent)) {
getNodeLinks(declaration).isVisible = true;
if (aliasesToMakeVisible) {
if (!contains(aliasesToMakeVisible, declaration)) {
aliasesToMakeVisible.push(<ImportDeclaration>declaration);
aliasesToMakeVisible.push(<ImportEqualsDeclaration>declaration);
}
}
else {
aliasesToMakeVisible = [<ImportDeclaration>declaration];
aliasesToMakeVisible = [<ImportEqualsDeclaration>declaration];
}
return true;
}
@ -991,7 +1103,7 @@ module ts {
meaning = SymbolFlags.Value | SymbolFlags.ExportValue;
}
else if (entityName.kind === SyntaxKind.QualifiedName ||
entityName.parent.kind === SyntaxKind.ImportDeclaration) {
entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration) {
// Left identifier from type reference or TypeAlias
// Entity name of the import declaration
meaning = SymbolFlags.Namespace;
@ -1602,11 +1714,11 @@ module ts {
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
var parent = getDeclarationContainer(node);
// If the node is not exported or it is not ambient module element (except import declaration)
if (!(getCombinedNodeFlags(node) & NodeFlags.Export) &&
!(node.kind !== SyntaxKind.ImportDeclaration && parent.kind !== SyntaxKind.SourceFile && isInAmbientContext(parent))) {
!(node.kind !== SyntaxKind.ImportEqualsDeclaration && parent.kind !== SyntaxKind.SourceFile && isInAmbientContext(parent))) {
return isGlobalSourceFile(parent) || isUsedInExportAssignment(node);
}
// Exported members/ambient module elements (exception import declaration) are visible if parent is visible
@ -2419,7 +2531,7 @@ module ts {
var callSignatures: Signature[] = emptyArray;
var constructSignatures: Signature[] = emptyArray;
if (symbol.flags & SymbolFlags.HasExports) {
members = symbol.exports;
members = getExportsOfSymbol(symbol);
}
if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method)) {
callSignatures = getSignaturesOfSymbol(symbol);
@ -4885,16 +4997,18 @@ module ts {
}
/*Transitively mark all linked imports as referenced*/
function markLinkedImportsAsReferenced(node: ImportDeclaration): void {
var nodeLinks = getNodeLinks(node);
while (nodeLinks.importOnRightSide) {
var rightSide = nodeLinks.importOnRightSide;
nodeLinks.importOnRightSide = undefined;
function markLinkedImportsAsReferenced(node: ImportEqualsDeclaration): void {
if (node) {
var nodeLinks = getNodeLinks(node);
while (nodeLinks.importOnRightSide) {
var rightSide = nodeLinks.importOnRightSide;
nodeLinks.importOnRightSide = undefined;
getSymbolLinks(rightSide).referenced = true;
Debug.assert((rightSide.flags & SymbolFlags.Import) !== 0);
getSymbolLinks(rightSide).referenced = true;
Debug.assert((rightSide.flags & SymbolFlags.Import) !== 0);
nodeLinks = getNodeLinks(getDeclarationOfKind(rightSide, SyntaxKind.ImportDeclaration))
nodeLinks = getNodeLinks(getDeclarationOfKind(rightSide, SyntaxKind.ImportEqualsDeclaration))
}
}
}
@ -4908,13 +5022,25 @@ module ts {
// To avoid that we will give an error to users if they use arguments objects in arrow function so that they
// can explicitly bound arguments objects
if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) {
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression);
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression);
}
if (symbol.flags & SymbolFlags.Import) {
//var symbolLinks = getSymbolLinks(symbol);
//if (!symbolLinks.referenced) {
// if (!isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol))) {
// symbolLinks.referenced = true;
// }
//}
// TODO: AndersH: This needs to be simplified. In an import of the form "import x = a.b.c;" we only need
// to resolve "a" and mark it as referenced. If "b" and/or "c" are aliases, we would be able to access them
// unless they're exported, and in that case they're already implicitly referenced.
var symbolLinks = getSymbolLinks(symbol);
if (!symbolLinks.referenced) {
var importOrExportAssignment = getLeftSideOfImportOrExportAssignment(node);
var importOrExportAssignment = getLeftSideOfImportEqualsOrExportAssignment(node);
// decision about whether import is referenced can be made now if
// - import that are used anywhere except right side of import declarations
@ -4935,7 +5061,7 @@ module ts {
}
if (symbolLinks.referenced) {
markLinkedImportsAsReferenced(<ImportDeclaration>getDeclarationOfKind(symbol, SyntaxKind.ImportDeclaration));
markLinkedImportsAsReferenced(<ImportEqualsDeclaration>getDeclarationOfKind(symbol, SyntaxKind.ImportEqualsDeclaration));
}
}
@ -8170,7 +8296,7 @@ module ts {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.EnumDeclaration:
return SymbolFlags.ExportType | SymbolFlags.ExportValue;
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
var result: SymbolFlags = 0;
var target = resolveImport(getSymbolOfNode(d));
forEach(target.declarations, d => { result |= getDeclarationSpaces(d); });
@ -9416,13 +9542,12 @@ module ts {
for (var i = 0, n = statements.length; i < n; i++) {
var statement = statements[i];
// TODO: AndersH: No reason to do a separate pass over the statements for this check, we should
// just fold it into checkExportAssignment.
if (statement.kind === SyntaxKind.ExportAssignment) {
// Export assignments are not allowed in an internal module
grammarErrorOnNode(statement, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module);
}
else if (isExternalModuleImportDeclaration(statement)) {
grammarErrorOnNode(getExternalModuleImportDeclarationExpression(statement), Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module);
}
}
}
}
@ -9468,18 +9593,81 @@ module ts {
return <Identifier>node;
}
function checkImportDeclaration(node: ImportDeclaration) {
// Grammar checking
checkGrammarModifiers(node);
function checkExternalImportOrExportDeclaration(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): boolean {
var moduleName = getExternalModuleName(node);
if (getFullWidth(moduleName) !== 0 && moduleName.kind !== SyntaxKind.StringLiteral) {
error(moduleName, Diagnostics.String_literal_expected);
return false;
}
var inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && (<ModuleDeclaration>node.parent.parent).name.kind === SyntaxKind.StringLiteral;
if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) {
error(moduleName, node.kind === SyntaxKind.ExportDeclaration ?
Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module :
Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module);
return false;
}
if (inAmbientExternalModule && isExternalModuleNameRelative((<LiteralExpression>moduleName).text)) {
// TypeScript 1.0 spec (April 2013): 12.1.6
// An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference
// other external modules only through top - level external module names.
// Relative external module names are not permitted.
error(node, Diagnostics.Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name);
return false;
}
return true;
}
function checkImportSymbol(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportSpecifier | ExportSpecifier) {
var symbol = getSymbolOfNode(node);
var target = resolveImport(symbol);
if (target !== unknownSymbol) {
var excludedMeanings =
(symbol.flags & SymbolFlags.Value ? SymbolFlags.Value : 0) |
(symbol.flags & SymbolFlags.Type ? SymbolFlags.Type : 0) |
(symbol.flags & SymbolFlags.Namespace ? SymbolFlags.Namespace : 0);
if (target.flags & excludedMeanings) {
var message = node.kind === SyntaxKind.ExportSpecifier ?
Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
}
}
}
function checkImportBinding(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportSpecifier) {
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
var symbol = getSymbolOfNode(node);
var target: Symbol;
if (isInternalModuleImportDeclaration(node)) {
target = resolveImport(symbol);
// Import declaration for an internal module
checkImportSymbol(node);
}
function checkImportDeclaration(node: ImportDeclaration) {
if (!checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) {
grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers);
}
if (checkExternalImportOrExportDeclaration(node)) {
var importClause = node.importClause;
if (importClause) {
if (importClause.name) {
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {
checkImportBinding(<NamespaceImport>importClause.namedBindings);
}
else {
forEach((<NamedImports>importClause.namedBindings).elements, checkImportBinding);
}
}
}
}
}
function checkImportEqualsDeclaration(node: ImportEqualsDeclaration) {
checkGrammarModifiers(node);
if (isInternalModuleImportEqualsDeclaration(node)) {
checkImportBinding(node);
var symbol = getSymbolOfNode(node);
var target = resolveImport(symbol);
if (target !== unknownSymbol) {
if (target.flags & SymbolFlags.Value) {
// Target is a value symbol, check that it is not hidden by a local declaration with the same name and
@ -9498,40 +9686,19 @@ module ts {
}
}
else {
// Import declaration for an external module
if (node.parent.kind === SyntaxKind.SourceFile) {
target = resolveImport(symbol);
}
else if (node.parent.kind === SyntaxKind.ModuleBlock && (<ModuleDeclaration>node.parent.parent).name.kind === SyntaxKind.StringLiteral) {
// TypeScript 1.0 spec (April 2013): 12.1.6
// An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference
// other external modules only through top - level external module names.
// Relative external module names are not permitted.
if (getExternalModuleImportDeclarationExpression(node).kind === SyntaxKind.StringLiteral) {
if (isExternalModuleNameRelative((<LiteralExpression>getExternalModuleImportDeclarationExpression(node)).text)) {
error(node, Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name);
target = unknownSymbol;
}
else {
target = resolveImport(symbol);
}
}
else {
target = unknownSymbol;
}
}
else {
// Parent is an internal module (syntax error is already reported)
target = unknownSymbol;
if (checkExternalImportOrExportDeclaration(node)) {
checkImportBinding(node);
}
}
if (target !== unknownSymbol) {
var excludedMeanings =
(symbol.flags & SymbolFlags.Value ? SymbolFlags.Value : 0) |
(symbol.flags & SymbolFlags.Type ? SymbolFlags.Type : 0) |
(symbol.flags & SymbolFlags.Namespace ? SymbolFlags.Namespace : 0);
if (target.flags & excludedMeanings) {
error(node, Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol));
}
function checkExportDeclaration(node: ExportDeclaration) {
if (!checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) {
grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers);
}
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause) {
forEach(node.exportClause.elements, checkImportSymbol);
}
}
}
@ -9641,6 +9808,10 @@ module ts {
return checkModuleDeclaration(<ModuleDeclaration>node);
case SyntaxKind.ImportDeclaration:
return checkImportDeclaration(<ImportDeclaration>node);
case SyntaxKind.ImportEqualsDeclaration:
return checkImportEqualsDeclaration(<ImportEqualsDeclaration>node);
case SyntaxKind.ExportDeclaration:
return checkExportDeclaration(<ExportDeclaration>node);
case SyntaxKind.ExportAssignment:
return checkExportAssignment(<ExportAssignment>node);
case SyntaxKind.EmptyStatement:
@ -9766,7 +9937,7 @@ module ts {
// Mark the import as referenced so that we emit it in the final .js file.
getSymbolLinks(symbol).referenced = true;
// mark any import declarations that depend upon this import as referenced
markLinkedImportsAsReferenced(<ImportDeclaration>getDeclarationOfKind(symbol, SyntaxKind.ImportDeclaration))
markLinkedImportsAsReferenced(<ImportEqualsDeclaration>getDeclarationOfKind(symbol, SyntaxKind.ImportEqualsDeclaration))
}
}
@ -9984,13 +10155,13 @@ module ts {
return false;
}
function getLeftSideOfImportOrExportAssignment(nodeOnRightSide: EntityName): ImportDeclaration | ExportAssignment {
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide: EntityName): ImportEqualsDeclaration | ExportAssignment {
while (nodeOnRightSide.parent.kind === SyntaxKind.QualifiedName) {
nodeOnRightSide = <QualifiedName>nodeOnRightSide.parent;
}
if (nodeOnRightSide.parent.kind === SyntaxKind.ImportDeclaration) {
return (<ImportDeclaration>nodeOnRightSide.parent).moduleReference === nodeOnRightSide && <ImportDeclaration>nodeOnRightSide.parent;
if (nodeOnRightSide.parent.kind === SyntaxKind.ImportEqualsDeclaration) {
return (<ImportEqualsDeclaration>nodeOnRightSide.parent).moduleReference === nodeOnRightSide && <ImportEqualsDeclaration>nodeOnRightSide.parent;
}
if (nodeOnRightSide.parent.kind === SyntaxKind.ExportAssignment) {
@ -10001,7 +10172,7 @@ module ts {
}
function isInRightSideOfImportOrExportAssignment(node: EntityName) {
return getLeftSideOfImportOrExportAssignment(node) !== undefined;
return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined;
}
function isRightSideOfQualifiedNameOrPropertyAccess(node: Node) {
@ -10022,7 +10193,7 @@ module ts {
if (entityName.kind !== SyntaxKind.PropertyAccessExpression) {
if (isInRightSideOfImportOrExportAssignment(<EntityName>entityName)) {
// Since we already checked for ExportAssignment, this really could only be an Import
return getSymbolOfPartOfRightHandSideOfImport(<EntityName>entityName);
return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName);
}
}
@ -10083,7 +10254,7 @@ module ts {
if (node.kind === SyntaxKind.Identifier && isInRightSideOfImportOrExportAssignment(<Identifier>node)) {
return node.parent.kind === SyntaxKind.ExportAssignment
? getSymbolOfEntityNameOrPropertyAccessExpression(<Identifier>node)
: getSymbolOfPartOfRightHandSideOfImport(<Identifier>node);
: getSymbolOfPartOfRightHandSideOfImportEquals(<Identifier>node);
}
switch (node.kind) {
@ -10107,8 +10278,8 @@ module ts {
case SyntaxKind.StringLiteral:
// External module name in an import declaration
if (isExternalModuleImportDeclaration(node.parent.parent) &&
getExternalModuleImportDeclarationExpression(node.parent.parent) === node) {
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) &&
getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) {
var importSymbol = getSymbolOfNode(node.parent.parent);
var moduleType = getTypeOfSymbol(importSymbol);
return moduleType ? moduleType.symbol : undefined;
@ -10241,73 +10412,172 @@ module ts {
function isUniqueLocalName(name: string, container: Node): boolean {
for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
if (node.locals && hasProperty(node.locals, name)) {
var symbolWithRelevantName = node.locals[name];
if (symbolWithRelevantName.flags & (SymbolFlags.Value | SymbolFlags.ExportValue)) {
// We conservatively include import symbols to cover cases where they're emitted as locals
if (node.locals[name].flags & (SymbolFlags.Value | SymbolFlags.ExportValue | SymbolFlags.Import)) {
return false;
}
// An import can be emitted too, if it is referenced as a value.
// Make sure the name in question does not collide with an import.
if (symbolWithRelevantName.flags & SymbolFlags.Import) {
var importDeclarationWithRelevantName = <ImportDeclaration>getDeclarationOfKind(symbolWithRelevantName, SyntaxKind.ImportDeclaration);
if (isReferencedImportDeclaration(importDeclarationWithRelevantName)) {
return false;
}
}
}
}
return true;
}
function getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string {
var links = getNodeLinks(container);
if (!links.localModuleName) {
var prefix = "";
var name = unescapeIdentifier(container.name.text);
while (!isUniqueLocalName(escapeIdentifier(prefix + name), container)) {
prefix += "_";
}
links.localModuleName = prefix + getTextOfNode(container.name);
function getGeneratedNamesForSourceFile(sourceFile: SourceFile): Map<string> {
var links = getNodeLinks(sourceFile);
var generatedNames = links.generatedNames;
if (!generatedNames) {
generatedNames = links.generatedNames = {};
generateNames(sourceFile);
}
return generatedNames;
function generateNames(node: Node) {
switch (node.kind) {
case SyntaxKind.ModuleDeclaration:
generateNameForModuleOrEnum(<ModuleDeclaration>node);
generateNames((<ModuleDeclaration>node).body);
break;
case SyntaxKind.EnumDeclaration:
generateNameForModuleOrEnum(<EnumDeclaration>node);
break;
case SyntaxKind.ImportDeclaration:
generateNameForImportDeclaration(<ImportDeclaration>node);
break;
case SyntaxKind.ExportDeclaration:
generateNameForExportDeclaration(<ExportDeclaration>node);
break;
case SyntaxKind.SourceFile:
case SyntaxKind.ModuleBlock:
forEach((<SourceFile | ModuleBlock>node).statements, generateNames);
break;
}
}
function isExistingName(name: string) {
return hasProperty(globals, name) || hasProperty(sourceFile.identifiers, name) || hasProperty(generatedNames, name);
}
function makeUniqueName(baseName: string): string {
// First try '_name'
if (baseName.charCodeAt(0) !== CharacterCodes._) {
var baseName = "_" + baseName;
if (!isExistingName(baseName)) {
return generatedNames[baseName] = baseName;
}
}
// Find the first unique '_name_n', where n is a positive number
if (baseName.charCodeAt(baseName.length - 1) !== CharacterCodes._) {
baseName += "_";
}
var i = 1;
while (true) {
name = baseName + i;
if (!isExistingName(name)) {
return generatedNames[name] = name;
}
i++;
}
}
function assignGeneratedName(node: Node, name: string) {
getNodeLinks(node).generatedName = unescapeIdentifier(name);
}
function generateNameForModuleOrEnum(node: ModuleDeclaration | EnumDeclaration) {
if (node.name.kind === SyntaxKind.Identifier) {
var name = node.name.text;
// Use module/enum name itself if it is unique, otherwise make a unique variation
assignGeneratedName(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name));
}
}
function generateNameForImportOrExportDeclaration(node: ImportDeclaration | ExportDeclaration) {
var expr = getExternalModuleName(node);
var baseName = expr.kind === SyntaxKind.StringLiteral ?
escapeIdentifier(makeIdentifierFromModuleName((<LiteralExpression>expr).text)) : "module";
assignGeneratedName(node, makeUniqueName(baseName));
}
function generateNameForImportDeclaration(node: ImportDeclaration) {
if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === SyntaxKind.NamedImports) {
generateNameForImportOrExportDeclaration(node);
}
}
function generateNameForExportDeclaration(node: ExportDeclaration) {
if (node.moduleSpecifier) {
generateNameForImportOrExportDeclaration(node);
}
}
return links.localModuleName;
}
function getLocalNameForSymbol(symbol: Symbol, location: Node): string {
function getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration) {
var links = getNodeLinks(node);
if (!links.generatedName) {
getGeneratedNamesForSourceFile(getSourceFile(node));
}
return links.generatedName;
}
function getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string {
return getGeneratedNameForNode(container);
}
function getLocalNameForImportDeclaration(node: ImportDeclaration): string {
return getGeneratedNameForNode(node);
}
function getImportNameSubstitution(symbol: Symbol): string {
var declaration = getDeclarationOfImportSymbol(symbol);
if (declaration && declaration.kind === SyntaxKind.ImportSpecifier) {
var moduleName = getGeneratedNameForNode(<ImportDeclaration>declaration.parent.parent.parent);
var propertyName = (<ImportSpecifier>declaration).propertyName || (<ImportSpecifier>declaration).name;
return moduleName + "." + unescapeIdentifier(propertyName.text);
}
}
function getExportNameSubstitution(symbol: Symbol, location: Node): string {
if (isExternalModuleSymbol(symbol.parent)) {
return "exports." + unescapeIdentifier(symbol.name);
}
var node = location;
var containerSymbol = getParentOfSymbol(symbol);
while (node) {
if ((node.kind === SyntaxKind.ModuleDeclaration || node.kind === SyntaxKind.EnumDeclaration) && getSymbolOfNode(node) === symbol) {
return getLocalNameOfContainer(<ModuleDeclaration | EnumDeclaration>node);
if ((node.kind === SyntaxKind.ModuleDeclaration || node.kind === SyntaxKind.EnumDeclaration) && getSymbolOfNode(node) === containerSymbol) {
return getGeneratedNameForNode(<ModuleDeclaration | EnumDeclaration>node) + "." + unescapeIdentifier(symbol.name);
}
node = node.parent;
}
Debug.fail("getLocalNameForSymbol failed");
}
function getExpressionNamePrefix(node: Identifier): string {
function getExpressionNameSubstitution(node: Identifier): string {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol) {
// In general, we need to prefix an identifier with its parent name if it references
// an exported entity from another module declaration. If we reference an exported
// entity within the same module declaration, then whether we prefix depends on the
// kind of entity. SymbolFlags.ExportHasLocal encompasses all the kinds that we
// do NOT prefix.
// Whan an identifier resolves to a parented symbol, it references an exported entity from
// another declaration of the same internal module.
if (symbol.parent) {
return getExportNameSubstitution(symbol, node.parent);
}
// If we reference an exported entity within the same module declaration, then whether
// we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the
// kinds that we do NOT prefix.
var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
if (symbol !== exportSymbol && !(exportSymbol.flags & SymbolFlags.ExportHasLocal)) {
symbol = exportSymbol;
return getExportNameSubstitution(exportSymbol, node.parent);
}
if (symbol.parent) {
return isExternalModuleSymbol(symbol.parent) ? "exports" : getLocalNameForSymbol(getParentOfSymbol(symbol), node.parent);
// Named imports from ES6 import declarations are rewritten
if (symbol.flags & SymbolFlags.Import) {
return getImportNameSubstitution(symbol);
}
}
}
function getExportAssignmentName(node: SourceFile): string {
var symbol = getExportAssignmentSymbol(getSymbolOfNode(node));
return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol): undefined;
return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol): undefined;
}
function isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean {
if (node.parent.kind !== SyntaxKind.SourceFile || !isInternalModuleImportDeclaration(node)) {
function isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean {
if (node.parent.kind !== SyntaxKind.SourceFile || !isInternalModuleImportEqualsDeclaration(node)) {
// parent is not source file or it is not reference to internal module
return false;
}
@ -10324,17 +10594,19 @@ module ts {
return isConstEnumSymbol(s) || s.constEnumOnlyModule;
}
function isReferencedImportDeclaration(node: ImportDeclaration): boolean {
var symbol = getSymbolOfNode(node);
if (getSymbolLinks(symbol).referenced) {
return true;
function isReferencedImportDeclaration(node: Node): boolean {
if (isImportSymbolDeclaration(node)) {
var symbol = getSymbolOfNode(node);
if (getSymbolLinks(symbol).referenced) {
return true;
}
// logic below will answer 'true' for exported import declaration in a nested module that itself is not exported.
// As a consequence this might cause emitting extra.
if (node.kind === SyntaxKind.ImportEqualsDeclaration && node.flags & NodeFlags.Export && isImportResolvedToValue(symbol)) {
return true;
}
}
// logic below will answer 'true' for exported import declaration in a nested module that itself is not exported.
// As a consequence this might cause emitting extra.
if (node.flags & NodeFlags.Export) {
return isImportResolvedToValue(symbol);
}
return false;
return forEachChild(node, isReferencedImportDeclaration);
}
function isImplementationOfOverload(node: FunctionLikeDeclaration) {
@ -10400,17 +10672,18 @@ module ts {
}
function isUnknownIdentifier(location: Node, name: string): boolean {
return !resolveName(location, name, SymbolFlags.Value, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
return !resolveName(location, name, SymbolFlags.Value, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined) &&
!hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name);
}
function createResolver(): EmitResolver {
return {
getLocalNameOfContainer,
getExpressionNamePrefix,
getGeneratedNameForNode,
getExpressionNameSubstitution,
getExportAssignmentName,
isReferencedImportDeclaration,
getNodeCheckFlags,
isTopLevelValueImportWithEntityName,
isTopLevelValueImportEqualsWithEntityName,
isDeclarationVisible,
isImplementationOfOverload,
writeTypeOfDeclaration,
@ -10431,7 +10704,7 @@ module ts {
// Initialize global symbol table
forEach(host.getSourceFiles(), file => {
if (!isExternalModule(file)) {
extendSymbolTable(globals, file.locals);
mergeSymbolTable(globals, file.locals);
}
});
@ -10486,11 +10759,13 @@ module ts {
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.ExportAssignment:
case SyntaxKind.VariableStatement:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.ExportDeclaration:
case SyntaxKind.ExportAssignment:
case SyntaxKind.Parameter:
break;
default:
@ -10595,7 +10870,7 @@ module ts {
return grammarErrorOnNode(lastPrivate, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private");
}
}
else if (node.kind === SyntaxKind.ImportDeclaration && flags & NodeFlags.Ambient) {
else if ((node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration) && flags & NodeFlags.Ambient) {
return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare");
}
else if (node.kind === SyntaxKind.InterfaceDeclaration && flags & NodeFlags.Ambient) {
@ -11386,6 +11661,8 @@ module ts {
//
if (node.kind === SyntaxKind.InterfaceDeclaration ||
node.kind === SyntaxKind.ImportDeclaration ||
node.kind === SyntaxKind.ImportEqualsDeclaration ||
node.kind === SyntaxKind.ExportDeclaration ||
node.kind === SyntaxKind.ExportAssignment ||
(node.flags & NodeFlags.Ambient)) {

View File

@ -150,6 +150,10 @@ module ts {
Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...of' statement." },
The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: DiagnosticCategory.Error, key: "The variable declaration of a 'for...in' statement cannot have an initializer." },
The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: DiagnosticCategory.Error, key: "The variable declaration of a 'for...of' statement cannot have an initializer." },
An_import_declaration_cannot_have_modifiers: { code: 1191, category: DiagnosticCategory.Error, key: "An import declaration cannot have modifiers." },
External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: DiagnosticCategory.Error, key: "External module '{0}' has no default export or export assignment." },
An_export_declaration_cannot_have_modifiers: { code: 1193, category: DiagnosticCategory.Error, key: "An export declaration cannot have modifiers." },
Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: DiagnosticCategory.Error, key: "Export declarations are not permitted in an internal module." },
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@ -278,7 +282,7 @@ module ts {
Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." },
Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" },
Import_name_cannot_be_0: { code: 2438, category: DiagnosticCategory.Error, key: "Import name cannot be '{0}'" },
Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: DiagnosticCategory.Error, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." },
Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: DiagnosticCategory.Error, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." },
Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" },
Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." },
Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." },
@ -322,6 +326,7 @@ module ts {
Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." },
for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: DiagnosticCategory.Error, key: "'for...of' statements are only available when targeting ECMAScript 6 or higher." },
The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." },
Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: DiagnosticCategory.Error, key: "Export declaration conflicts with exported declaration of '{0}'" },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },

View File

@ -591,6 +591,22 @@
"category": "Error",
"code": 1190
},
"An import declaration cannot have modifiers.": {
"category": "Error",
"code": 1191
},
"External module '{0}' has no default export or export assignment.": {
"category": "Error",
"code": 1192
},
"An export declaration cannot have modifiers.": {
"category": "Error",
"code": 1193
},
"Export declarations are not permitted in an internal module.": {
"category": "Error",
"code": 1194
},
"Duplicate identifier '{0}'.": {
"category": "Error",
@ -1104,7 +1120,7 @@
"category": "Error",
"code": 2438
},
"Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": {
"Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name.": {
"category": "Error",
"code": 2439
},
@ -1280,6 +1296,10 @@
"category": "Error",
"code": 2483
},
"Export declaration conflicts with exported declaration of '{0}'": {
"category": "Error",
"code": 2484
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",

View File

@ -16,6 +16,12 @@ module ts {
getIndent(): number;
}
interface ExternalImportInfo {
rootNode: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration;
declarationNode?: ImportEqualsDeclaration | ImportClause | NamespaceImport;
namedImports?: NamedImports;
}
interface SymbolAccessibilityDiagnostic {
errorNode: Node;
diagnosticMessage: DiagnosticMessage;
@ -34,7 +40,7 @@ module ts {
}
interface AliasDeclarationEmitInfo {
declaration: ImportDeclaration;
declaration: ImportEqualsDeclaration;
outputPos: number;
indent: number;
asynchronousOutput?: string; // If the output for alias was written asynchronously, the corresponding output
@ -468,9 +474,9 @@ module ts {
decreaseIndent = newWriter.decreaseIndent;
}
function writeAsychronousImportDeclarations(importDeclarations: ImportDeclaration[]) {
function writeAsychronousImportEqualsDeclarations(importEqualsDeclarations: ImportEqualsDeclaration[]) {
var oldWriter = writer;
forEach(importDeclarations, aliasToWrite => {
forEach(importEqualsDeclarations, aliasToWrite => {
var aliasEmitInfo = forEach(aliasDeclarationEmitInfo, declEmitInfo => declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined);
// If the alias was marked as not visible when we saw its declaration, we would have saved the aliasEmitInfo, but if we haven't yet visited the alias declaration
// then we don't need to write it at this point. We will write it when we actually see its declaration
@ -484,7 +490,7 @@ module ts {
for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) {
increaseIndent();
}
writeImportDeclaration(aliasToWrite);
writeImportEqualsDeclaration(aliasToWrite);
aliasEmitInfo.asynchronousOutput = writer.getText();
}
});
@ -495,7 +501,7 @@ module ts {
if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) {
// write the aliases
if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) {
writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible);
writeAsychronousImportEqualsDeclarations(symbolAccesibilityResult.aliasesToMakeVisible);
}
}
else {
@ -621,7 +627,7 @@ module ts {
function emitEntityName(entityName: EntityName) {
var visibilityResult = resolver.isEntityNameVisible(entityName,
// Aliases can be written asynchronously so use correct enclosing declaration
entityName.parent.kind === SyntaxKind.ImportDeclaration ? entityName.parent : enclosingDeclaration);
entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration ? entityName.parent : enclosingDeclaration);
handleSymbolAccessibilityError(visibilityResult);
writeEntityName(entityName);
@ -727,7 +733,7 @@ module ts {
}
}
function emitImportDeclaration(node: ImportDeclaration) {
function emitImportEqualsDeclaration(node: ImportEqualsDeclaration) {
var nodeEmitInfo = {
declaration: node,
outputPos: writer.getTextPos(),
@ -736,12 +742,12 @@ module ts {
};
aliasDeclarationEmitInfo.push(nodeEmitInfo);
if (nodeEmitInfo.hasWritten) {
writeImportDeclaration(node);
writeImportEqualsDeclaration(node);
}
}
function writeImportDeclaration(node: ImportDeclaration) {
// note usage of writer. methods instead of aliases created, just to make sure we are using
function writeImportEqualsDeclaration(node: ImportEqualsDeclaration) {
// note usage of writer. methods instead of aliases created, just to make sure we are using
// correct writer especially to handle asynchronous alias writing
emitJsDocComments(node);
if (node.flags & NodeFlags.Export) {
@ -750,13 +756,13 @@ module ts {
write("import ");
writeTextOfNode(currentSourceFile, node.name);
write(" = ");
if (isInternalModuleImportDeclaration(node)) {
if (isInternalModuleImportEqualsDeclaration(node)) {
emitTypeWithNewGetSymbolAccessibilityDiagnostic(<EntityName>node.moduleReference, getImportEntityNameVisibilityError);
write(";");
}
else {
write("require(");
writeTextOfNode(currentSourceFile, getExternalModuleImportDeclarationExpression(node));
writeTextOfNode(currentSourceFile, getExternalModuleImportEqualsDeclarationExpression(node));
write(");");
}
writer.writeLine();
@ -1483,8 +1489,8 @@ module ts {
return emitEnumDeclaration(<EnumDeclaration>node);
case SyntaxKind.ModuleDeclaration:
return emitModuleDeclaration(<ModuleDeclaration>node);
case SyntaxKind.ImportDeclaration:
return emitImportDeclaration(<ImportDeclaration>node);
case SyntaxKind.ImportEqualsDeclaration:
return emitImportEqualsDeclaration(<ImportEqualsDeclaration>node);
case SyntaxKind.ExportAssignment:
return emitExportAssignment(<ExportAssignment>node);
case SyntaxKind.SourceFile:
@ -1572,6 +1578,8 @@ module ts {
var tempCount = 0;
var tempVariables: Identifier[];
var tempParameters: Identifier[];
var externalImports: ExternalImportInfo[];
var exportSpecifiers: Map<ExportSpecifier[]>;
/** write emitted output to disk*/
var writeEmittedFiles = writeJavaScriptFile;
@ -2378,7 +2386,7 @@ module ts {
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
return (<Declaration>parent).name === node;
case SyntaxKind.BreakStatement:
case SyntaxKind.ContinueStatement:
@ -2392,12 +2400,13 @@ module ts {
}
function emitExpressionIdentifier(node: Identifier) {
var prefix = resolver.getExpressionNamePrefix(node);
if (prefix) {
write(prefix);
write(".");
var substitution = resolver.getExpressionNameSubstitution(node);
if (substitution) {
write(substitution);
}
else {
writeTextOfNode(currentSourceFile, node);
}
writeTextOfNode(currentSourceFile, node);
}
function emitIdentifier(node: Identifier) {
@ -2619,8 +2628,12 @@ module ts {
return (<PropertyAssignment>property).initializer;
case SyntaxKind.ShorthandPropertyAssignment:
var prefix = createIdentifier(resolver.getExpressionNamePrefix((<ShorthandPropertyAssignment>property).name));
return createPropertyAccessExpression(prefix, (<ShorthandPropertyAssignment>property).name);
// TODO: (andersh) Technically it isn't correct to make an identifier here since getExpressionNamePrefix returns
// a string containing a dotted name. In general I'm not a fan of mini tree rewriters as this one, elsewhere we
// manage by just emitting strings (which is a lot more performant).
//var prefix = createIdentifier(resolver.getExpressionNamePrefix((<ShorthandPropertyAssignment>property).name));
//return createPropertyAccessExpression(prefix, (<ShorthandPropertyAssignment>property).name);
return createIdentifier(resolver.getExpressionNameSubstitution((<ShorthandPropertyAssignment>property).name));
case SyntaxKind.MethodDeclaration:
return createFunctionExpression((<MethodDeclaration>property).parameters, (<MethodDeclaration>property).body);
@ -2815,7 +2828,7 @@ module ts {
// export var obj = { y };
// }
// The short-hand property in obj need to emit as such ... = { y : m.y } regardless of the TargetScript version
if (languageVersion <= ScriptTarget.ES5 || resolver.getExpressionNamePrefix(node.name)) {
if (languageVersion < ScriptTarget.ES6 || resolver.getExpressionNameSubstitution(node.name)) {
// Emit identifier as an identifier
write(": ");
// Even though this is stored as identifier treat it as an expression
@ -3417,17 +3430,37 @@ module ts {
return <ModuleDeclaration>node;
}
function emitContainingModuleName(node: Node) {
var container = getContainingModule(node);
write(container ? resolver.getGeneratedNameForNode(container) : "exports");
}
function emitModuleMemberName(node: Declaration) {
emitStart(node.name);
if (getCombinedNodeFlags(node) & NodeFlags.Export) {
var container = getContainingModule(node);
write(container ? resolver.getLocalNameOfContainer(container) : "exports");
emitContainingModuleName(node);
write(".");
}
emitNode(node.name);
emitEnd(node.name);
}
function emitExportMemberAssignments(name: Identifier) {
if (exportSpecifiers && hasProperty(exportSpecifiers, name.text)) {
forEach(exportSpecifiers[name.text], specifier => {
writeLine();
emitStart(specifier.name);
emitContainingModuleName(specifier);
write(".");
emitNode(specifier.name);
emitEnd(specifier.name);
write(" = ");
emitNode(name);
write(";");
});
}
}
function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, value?: Expression) {
var emitCount = 0;
// An exported declaration is actually emitted as an assignment (to a property on the module object), so
@ -3660,6 +3693,16 @@ module ts {
}
}
function emitExportVariableAssignments(node: VariableDeclaration | BindingElement) {
var name = (<VariableLikeDeclaration>node).name;
if (name.kind === SyntaxKind.Identifier) {
emitExportMemberAssignments(<Identifier>name);
}
else if (isBindingPattern(name)) {
forEach((<BindingPattern>name).elements, emitExportVariableAssignments);
}
}
function emitVariableStatement(node: VariableStatement) {
if (!(node.flags & NodeFlags.Export)) {
if (isLet(node.declarationList)) {
@ -3674,6 +3717,9 @@ module ts {
}
emitCommaList(node.declarationList.declarations);
write(";");
if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile) {
forEach(node.declarationList.declarations, emitExportVariableAssignments);
}
}
function emitParameter(node: ParameterDeclaration) {
@ -3798,6 +3844,9 @@ module ts {
emit(node.name);
}
emitSignatureAndBody(node);
if (languageVersion < ScriptTarget.ES6 && node.kind === SyntaxKind.FunctionDeclaration && node.parent === currentSourceFile) {
emitExportMemberAssignments((<FunctionDeclaration>node).name);
}
if (node.kind !== SyntaxKind.MethodDeclaration && node.kind !== SyntaxKind.MethodSignature) {
emitTrailingComments(node);
}
@ -4164,6 +4213,9 @@ module ts {
emitEnd(node);
write(";");
}
if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile) {
emitExportMemberAssignments(node.name);
}
function emitConstructorOfClass() {
var saveTempCount = tempCount;
@ -4264,7 +4316,7 @@ module ts {
emitStart(node);
write("(function (");
emitStart(node.name);
write(resolver.getLocalNameOfContainer(node));
write(resolver.getGeneratedNameForNode(node));
emitEnd(node.name);
write(") {");
increaseIndent();
@ -4290,14 +4342,17 @@ module ts {
emitEnd(node);
write(";");
}
if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile) {
emitExportMemberAssignments(node.name);
}
}
function emitEnumMember(node: EnumMember) {
var enumParent = <EnumDeclaration>node.parent;
emitStart(node);
write(resolver.getLocalNameOfContainer(enumParent));
write(resolver.getGeneratedNameForNode(enumParent));
write("[");
write(resolver.getLocalNameOfContainer(enumParent));
write(resolver.getGeneratedNameForNode(enumParent));
write("[");
emitExpressionForPropertyName(node.name);
write("] = ");
@ -4353,7 +4408,7 @@ module ts {
emitStart(node);
write("(function (");
emitStart(node.name);
write(resolver.getLocalNameOfContainer(node));
write(resolver.getGeneratedNameForNode(node));
emitEnd(node.name);
write(") ");
if (node.body.kind === SyntaxKind.ModuleBlock) {
@ -4388,65 +4443,200 @@ module ts {
emitModuleMemberName(node);
write(" = {}));");
emitEnd(node);
if (languageVersion < ScriptTarget.ES6 && node.name.kind === SyntaxKind.Identifier && node.parent === currentSourceFile) {
emitExportMemberAssignments(<Identifier>node.name);
}
}
function emitImportDeclaration(node: ImportDeclaration) {
var emitImportDeclaration = resolver.isReferencedImportDeclaration(node);
if (!emitImportDeclaration) {
// preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when
// - current file is not external module
// - import declaration is top level and target is value imported by entity name
emitImportDeclaration = !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node);
function emitRequire(moduleName: Expression) {
if (moduleName.kind === SyntaxKind.StringLiteral) {
write("require(");
emitStart(moduleName);
emitLiteral(<LiteralExpression>moduleName);
emitEnd(moduleName);
emitToken(SyntaxKind.CloseParenToken, moduleName.end);
write(";");
}
else {
write("require();");
}
}
if (emitImportDeclaration) {
if (isExternalModuleImportDeclaration(node) && node.parent.kind === SyntaxKind.SourceFile && compilerOptions.module === ModuleKind.AMD) {
if (node.flags & NodeFlags.Export) {
writeLine();
emitLeadingComments(node);
emitStart(node);
emitModuleMemberName(node);
write(" = ");
emit(node.name);
write(";");
emitEnd(node);
emitTrailingComments(node);
}
}
else {
writeLine();
function emitImportDeclaration(node: ImportDeclaration | ImportEqualsDeclaration) {
var info = getExternalImportInfo(node);
if (info) {
var declarationNode = info.declarationNode;
var namedImports = info.namedImports;
if (compilerOptions.module !== ModuleKind.AMD) {
emitLeadingComments(node);
emitStart(node);
if (!(node.flags & NodeFlags.Export)) write("var ");
emitModuleMemberName(node);
write(" = ");
if (isInternalModuleImportDeclaration(node)) {
emit(node.moduleReference);
var moduleName = getExternalModuleName(node);
if (declarationNode) {
if (!(declarationNode.flags & NodeFlags.Export)) write("var ");
emitModuleMemberName(declarationNode);
write(" = ");
emitRequire(moduleName);
}
else if (namedImports) {
write("var ");
write(resolver.getGeneratedNameForNode(<ImportDeclaration>node));
write(" = ");
emitRequire(moduleName);
}
else {
var literal = <LiteralExpression>getExternalModuleImportDeclarationExpression(node);
write("require(");
emitStart(literal);
emitLiteral(literal);
emitEnd(literal);
emitToken(SyntaxKind.CloseParenToken, literal.end);
emitRequire(moduleName);
}
write(";");
emitEnd(node);
emitTrailingComments(node);
}
else {
if (declarationNode) {
if (declarationNode.flags & NodeFlags.Export) {
emitModuleMemberName(declarationNode);
write(" = ");
emit(declarationNode.name);
write(";");
}
}
}
}
}
function getExternalImportDeclarations(node: SourceFile): ImportDeclaration[] {
var result: ImportDeclaration[] = [];
forEach(node.statements, statement => {
if (isExternalModuleImportDeclaration(statement) && resolver.isReferencedImportDeclaration(<ImportDeclaration>statement)) {
result.push(<ImportDeclaration>statement);
function emitImportEqualsDeclaration(node: ImportEqualsDeclaration) {
if (isExternalModuleImportEqualsDeclaration(node)) {
emitImportDeclaration(node);
return;
}
// preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when
// - current file is not external module
// - import declaration is top level and target is value imported by entity name
if (resolver.isReferencedImportDeclaration(node) ||
(!isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) {
emitLeadingComments(node);
emitStart(node);
if (!(node.flags & NodeFlags.Export)) write("var ");
emitModuleMemberName(node);
write(" = ");
emit(node.moduleReference);
write(";");
emitEnd(node);
emitTrailingComments(node);
}
}
function emitExportDeclaration(node: ExportDeclaration) {
if (node.moduleSpecifier) {
emitStart(node);
var generatedName = resolver.getGeneratedNameForNode(node);
if (compilerOptions.module !== ModuleKind.AMD) {
write("var ");
write(generatedName);
write(" = ");
emitRequire(getExternalModuleName(node));
}
if (node.exportClause) {
// export { x, y, ... }
forEach(node.exportClause.elements, specifier => {
writeLine();
emitStart(specifier);
emitContainingModuleName(specifier);
write(".");
emitNode(specifier.name);
write(" = ");
write(generatedName);
write(".");
emitNode(specifier.propertyName || specifier.name);
write(";");
emitEnd(specifier);
});
}
else {
// export *
var tempName = createTempVariable(node).text;
writeLine();
write("for (var " + tempName + " in " + generatedName + ") if (!");
emitContainingModuleName(node);
write(".hasOwnProperty(" + tempName + ")) ");
emitContainingModuleName(node);
write("[" + tempName + "] = " + generatedName + "[" + tempName + "];");
}
emitEnd(node);
}
}
function createExternalImportInfo(node: Node): ExternalImportInfo {
if (node.kind === SyntaxKind.ImportEqualsDeclaration) {
if ((<ImportEqualsDeclaration>node).moduleReference.kind === SyntaxKind.ExternalModuleReference) {
return {
rootNode: <ImportEqualsDeclaration>node,
declarationNode: <ImportEqualsDeclaration>node
};
}
}
else if (node.kind === SyntaxKind.ImportDeclaration) {
var importClause = (<ImportDeclaration>node).importClause;
if (importClause) {
if (importClause.name) {
return {
rootNode: <ImportDeclaration>node,
declarationNode: importClause
};
}
if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {
return {
rootNode: <ImportDeclaration>node,
declarationNode: <NamespaceImport>importClause.namedBindings
};
}
return {
rootNode: <ImportDeclaration>node,
namedImports: <NamedImports>importClause.namedBindings,
localName: resolver.getGeneratedNameForNode(<ImportDeclaration>node)
};
}
return {
rootNode: <ImportDeclaration>node
}
}
else if (node.kind === SyntaxKind.ExportDeclaration) {
if ((<ExportDeclaration>node).moduleSpecifier) {
return {
rootNode: <ExportDeclaration>node,
};
}
}
}
function createExternalModuleInfo(sourceFile: SourceFile) {
externalImports = [];
exportSpecifiers = {};
forEach(sourceFile.statements, node => {
if (node.kind === SyntaxKind.ExportDeclaration && !(<ExportDeclaration>node).moduleSpecifier) {
forEach((<ExportDeclaration>node).exportClause.elements, specifier => {
var name = (specifier.propertyName || specifier.name).text;
(exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier);
});
}
else {
var info = createExternalImportInfo(node);
if (info) {
if ((!info.declarationNode && !info.namedImports) || resolver.isReferencedImportDeclaration(node)) {
externalImports.push(info);
}
}
}
});
return result;
}
function getExternalImportInfo(node: ImportDeclaration | ImportEqualsDeclaration): ExternalImportInfo {
if (externalImports) {
for (var i = 0; i < externalImports.length; i++) {
var info = externalImports[i];
if (info.rootNode === node) {
return info;
}
}
}
}
function getFirstExportAssignment(sourceFile: SourceFile) {
@ -4471,7 +4661,6 @@ module ts {
}
function emitAMDModule(node: SourceFile, startIndex: number) {
var imports = getExternalImportDeclarations(node);
writeLine();
write("define(");
sortAMDModules(node.amdDependencies);
@ -4479,9 +4668,15 @@ module ts {
write("\"" + node.amdModuleName + "\", ");
}
write("[\"require\", \"exports\"");
forEach(imports, imp => {
forEach(externalImports, info => {
write(", ");
emitLiteral(<LiteralExpression>getExternalModuleImportDeclarationExpression(imp));
var moduleName = getExternalModuleName(info.rootNode);
if (moduleName.kind === SyntaxKind.StringLiteral) {
emitLiteral(<LiteralExpression>moduleName);
}
else {
write("\"\"");
}
});
forEach(node.amdDependencies, amdDependency => {
var text = "\"" + amdDependency.path + "\"";
@ -4489,9 +4684,14 @@ module ts {
write(text);
});
write("], function (require, exports");
forEach(imports, imp => {
forEach(externalImports, info => {
write(", ");
emit(imp.name);
if (info.declarationNode) {
emit(info.declarationNode.name);
}
else {
write(resolver.getGeneratedNameForNode(<ImportDeclaration | ExportDeclaration>info.rootNode));
}
});
forEach(node.amdDependencies, amdDependency => {
if (amdDependency.name) {
@ -4581,6 +4781,7 @@ module ts {
extendsEmitted = true;
}
if (isExternalModule(node)) {
createExternalModuleInfo(node);
if (compilerOptions.module === ModuleKind.AMD) {
emitAMDModule(node, startIndex);
}
@ -4589,6 +4790,8 @@ module ts {
}
}
else {
externalImports = undefined;
exportSpecifiers = undefined;
emitCaptureThisForNodeIfNecessary(node);
emitLinesStartingAt(node.statements, startIndex);
emitTempDeclarations(/*newLine*/ true);
@ -4625,6 +4828,7 @@ module ts {
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.ExportAssignment:
return false;
@ -4789,6 +4993,10 @@ module ts {
return emitModuleDeclaration(<ModuleDeclaration>node);
case SyntaxKind.ImportDeclaration:
return emitImportDeclaration(<ImportDeclaration>node);
case SyntaxKind.ImportEqualsDeclaration:
return emitImportEqualsDeclaration(<ImportEqualsDeclaration>node);
case SyntaxKind.ExportDeclaration:
return emitExportDeclaration(<ExportDeclaration>node);
case SyntaxKind.SourceFile:
return emitSourceFile(<SourceFile>node);
}

View File

@ -252,10 +252,30 @@ module ts {
return visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, (<ModuleDeclaration>node).name) ||
visitNode(cbNode, (<ModuleDeclaration>node).body);
case SyntaxKind.ImportEqualsDeclaration:
return visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, (<ImportEqualsDeclaration>node).name) ||
visitNode(cbNode, (<ImportEqualsDeclaration>node).moduleReference);
case SyntaxKind.ImportDeclaration:
return visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, (<ImportDeclaration>node).name) ||
visitNode(cbNode, (<ImportDeclaration>node).moduleReference);
visitNode(cbNode, (<ImportDeclaration>node).importClause) ||
visitNode(cbNode, (<ImportDeclaration>node).moduleSpecifier);
case SyntaxKind.ImportClause:
return visitNode(cbNode, (<ImportClause>node).name) ||
visitNode(cbNode, (<ImportClause>node).namedBindings);
case SyntaxKind.NamespaceImport:
return visitNode(cbNode, (<NamespaceImport>node).name);
case SyntaxKind.NamedImports:
case SyntaxKind.NamedExports:
return visitNodes(cbNodes, (<NamedImportsOrExports>node).elements);
case SyntaxKind.ExportDeclaration:
return visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, (<ExportDeclaration>node).exportClause) ||
visitNode(cbNode, (<ExportDeclaration>node).moduleSpecifier);
case SyntaxKind.ImportSpecifier:
case SyntaxKind.ExportSpecifier:
return visitNode(cbNode, (<ImportOrExportSpecifier>node).propertyName) ||
visitNode(cbNode, (<ImportOrExportSpecifier>node).name);
case SyntaxKind.ExportAssignment:
return visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, (<ExportAssignment>node).exportName);
@ -273,27 +293,28 @@ module ts {
}
const enum ParsingContext {
SourceElements, // Elements in source file
ModuleElements, // Elements in module declaration
BlockStatements, // Statements in block
SwitchClauses, // Clauses in switch statement
SwitchClauseStatements, // Statements in switch clause
TypeMembers, // Members in interface or type literal
ClassMembers, // Members in class declaration
EnumMembers, // Members in enum declaration
TypeReferences, // Type references in extends or implements clause
VariableDeclarations, // Variable declarations in variable statement
ObjectBindingElements, // Binding elements in object binding list
ArrayBindingElements, // Binding elements in array binding list
ArgumentExpressions, // Expressions in argument list
ObjectLiteralMembers, // Members in object literal
ArrayLiteralMembers, // Members in array literal
Parameters, // Parameters in parameter list
TypeParameters, // Type parameters in type parameter list
TypeArguments, // Type arguments in type argument list
TupleElementTypes, // Element types in tuple element type list
HeritageClauses, // Heritage clauses for a class or interface declaration.
Count // Number of parsing contexts
SourceElements, // Elements in source file
ModuleElements, // Elements in module declaration
BlockStatements, // Statements in block
SwitchClauses, // Clauses in switch statement
SwitchClauseStatements, // Statements in switch clause
TypeMembers, // Members in interface or type literal
ClassMembers, // Members in class declaration
EnumMembers, // Members in enum declaration
TypeReferences, // Type references in extends or implements clause
VariableDeclarations, // Variable declarations in variable statement
ObjectBindingElements, // Binding elements in object binding list
ArrayBindingElements, // Binding elements in array binding list
ArgumentExpressions, // Expressions in argument list
ObjectLiteralMembers, // Members in object literal
ArrayLiteralMembers, // Members in array literal
Parameters, // Parameters in parameter list
TypeParameters, // Type parameters in type parameter list
TypeArguments, // Type arguments in type argument list
TupleElementTypes, // Element types in tuple element type list
HeritageClauses, // Heritage clauses for a class or interface declaration.
ImportOrExportSpecifiers, // Named import clause's import specifier list
Count // Number of parsing contexts
}
const enum Tristate {
@ -304,26 +325,27 @@ module ts {
function parsingContextErrors(context: ParsingContext): DiagnosticMessage {
switch (context) {
case ParsingContext.SourceElements: return Diagnostics.Declaration_or_statement_expected;
case ParsingContext.ModuleElements: return Diagnostics.Declaration_or_statement_expected;
case ParsingContext.BlockStatements: return Diagnostics.Statement_expected;
case ParsingContext.SwitchClauses: return Diagnostics.case_or_default_expected;
case ParsingContext.SwitchClauseStatements: return Diagnostics.Statement_expected;
case ParsingContext.TypeMembers: return Diagnostics.Property_or_signature_expected;
case ParsingContext.ClassMembers: return Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected;
case ParsingContext.EnumMembers: return Diagnostics.Enum_member_expected;
case ParsingContext.TypeReferences: return Diagnostics.Type_reference_expected;
case ParsingContext.VariableDeclarations: return Diagnostics.Variable_declaration_expected;
case ParsingContext.ObjectBindingElements: return Diagnostics.Property_destructuring_pattern_expected;
case ParsingContext.ArrayBindingElements: return Diagnostics.Array_element_destructuring_pattern_expected;
case ParsingContext.ArgumentExpressions: return Diagnostics.Argument_expression_expected;
case ParsingContext.ObjectLiteralMembers: return Diagnostics.Property_assignment_expected;
case ParsingContext.ArrayLiteralMembers: return Diagnostics.Expression_or_comma_expected;
case ParsingContext.Parameters: return Diagnostics.Parameter_declaration_expected;
case ParsingContext.TypeParameters: return Diagnostics.Type_parameter_declaration_expected;
case ParsingContext.TypeArguments: return Diagnostics.Type_argument_expected;
case ParsingContext.TupleElementTypes: return Diagnostics.Type_expected;
case ParsingContext.HeritageClauses: return Diagnostics.Unexpected_token_expected;
case ParsingContext.SourceElements: return Diagnostics.Declaration_or_statement_expected;
case ParsingContext.ModuleElements: return Diagnostics.Declaration_or_statement_expected;
case ParsingContext.BlockStatements: return Diagnostics.Statement_expected;
case ParsingContext.SwitchClauses: return Diagnostics.case_or_default_expected;
case ParsingContext.SwitchClauseStatements: return Diagnostics.Statement_expected;
case ParsingContext.TypeMembers: return Diagnostics.Property_or_signature_expected;
case ParsingContext.ClassMembers: return Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected;
case ParsingContext.EnumMembers: return Diagnostics.Enum_member_expected;
case ParsingContext.TypeReferences: return Diagnostics.Type_reference_expected;
case ParsingContext.VariableDeclarations: return Diagnostics.Variable_declaration_expected;
case ParsingContext.ObjectBindingElements: return Diagnostics.Property_destructuring_pattern_expected;
case ParsingContext.ArrayBindingElements: return Diagnostics.Array_element_destructuring_pattern_expected;
case ParsingContext.ArgumentExpressions: return Diagnostics.Argument_expression_expected;
case ParsingContext.ObjectLiteralMembers: return Diagnostics.Property_assignment_expected;
case ParsingContext.ArrayLiteralMembers: return Diagnostics.Expression_or_comma_expected;
case ParsingContext.Parameters: return Diagnostics.Parameter_declaration_expected;
case ParsingContext.TypeParameters: return Diagnostics.Type_parameter_declaration_expected;
case ParsingContext.TypeArguments: return Diagnostics.Type_argument_expected;
case ParsingContext.TupleElementTypes: return Diagnostics.Type_expected;
case ParsingContext.HeritageClauses: return Diagnostics.Unexpected_token_expected;
case ParsingContext.ImportOrExportSpecifiers: return Diagnostics.Identifier_expected;
}
};
@ -1476,7 +1498,10 @@ module ts {
// 'const' is only a modifier if followed by 'enum'.
return nextToken() === SyntaxKind.EnumKeyword;
}
if (token === SyntaxKind.ExportKeyword) {
nextToken();
return token !== SyntaxKind.AsteriskToken && token !== SyntaxKind.OpenBraceToken && canFollowModifier();
}
nextToken();
return canFollowModifier();
}
@ -1536,6 +1561,8 @@ module ts {
return token === SyntaxKind.CommaToken || isStartOfType();
case ParsingContext.HeritageClauses:
return isHeritageClause();
case ParsingContext.ImportOrExportSpecifiers:
return isIdentifierOrKeyword();
}
Debug.fail("Non-exhaustive case in 'isListElement'.");
@ -1572,6 +1599,7 @@ module ts {
case ParsingContext.EnumMembers:
case ParsingContext.ObjectLiteralMembers:
case ParsingContext.ObjectBindingElements:
case ParsingContext.ImportOrExportSpecifiers:
return token === SyntaxKind.CloseBraceToken;
case ParsingContext.SwitchClauseStatements:
return token === SyntaxKind.CloseBraceToken || token === SyntaxKind.CaseKeyword || token === SyntaxKind.DefaultKeyword;
@ -1597,7 +1625,6 @@ module ts {
return token === SyntaxKind.GreaterThanToken || token === SyntaxKind.OpenParenToken;
case ParsingContext.HeritageClauses:
return token === SyntaxKind.OpenBraceToken || token === SyntaxKind.CloseBraceToken;
}
}
@ -1832,6 +1859,8 @@ module ts {
if (node) {
switch (node.kind) {
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.ExportDeclaration:
case SyntaxKind.ExportAssignment:
case SyntaxKind.ClassDeclaration:
case SyntaxKind.InterfaceDeclaration:
@ -4622,15 +4651,75 @@ module ts {
return nextToken() === SyntaxKind.OpenParenToken;
}
function parseImportDeclaration(fullStart: number, modifiers: ModifiersArray): ImportDeclaration {
var node = <ImportDeclaration>createNode(SyntaxKind.ImportDeclaration, fullStart);
setModifiers(node, modifiers);
function nextTokenIsCommaOrFromKeyword() {
nextToken();
return token === SyntaxKind.CommaToken ||
token === SyntaxKind.FromKeyword;
}
function parseImportDeclarationOrImportEqualsDeclaration(fullStart: number, modifiers: ModifiersArray): ImportEqualsDeclaration | ImportDeclaration {
parseExpected(SyntaxKind.ImportKeyword);
node.name = parseIdentifier();
parseExpected(SyntaxKind.EqualsToken);
node.moduleReference = parseModuleReference();
var afterImportPos = scanner.getStartPos();
var identifier: Identifier;
if (isIdentifier()) {
identifier = parseIdentifier();
if (token !== SyntaxKind.CommaToken && token !== SyntaxKind.FromKeyword) {
// ImportEquals declaration of type:
// import x = require("mod"); or
// import x = M.x;
var importEqualsDeclaration = <ImportEqualsDeclaration>createNode(SyntaxKind.ImportEqualsDeclaration, fullStart);
setModifiers(importEqualsDeclaration, modifiers);
importEqualsDeclaration.name = identifier;
parseExpected(SyntaxKind.EqualsToken);
importEqualsDeclaration.moduleReference = parseModuleReference();
parseSemicolon();
return finishNode(importEqualsDeclaration);
}
}
// Import statement
var importDeclaration = <ImportDeclaration>createNode(SyntaxKind.ImportDeclaration, fullStart);
setModifiers(importDeclaration, modifiers);
// ImportDeclaration:
// import ImportClause from ModuleSpecifier ;
// import ModuleSpecifier;
if (identifier || // import id
token === SyntaxKind.AsteriskToken || // import *
token === SyntaxKind.OpenBraceToken) { // import {
importDeclaration.importClause = parseImportClause(identifier, afterImportPos);
parseExpected(SyntaxKind.FromKeyword);
}
importDeclaration.moduleSpecifier = parseModuleSpecifier();
parseSemicolon();
return finishNode(node);
return finishNode(importDeclaration);
}
function parseImportClause(identifier: Identifier, fullStart: number) {
//ImportClause:
// ImportedDefaultBinding
// NameSpaceImport
// NamedImports
// ImportedDefaultBinding, NameSpaceImport
// ImportedDefaultBinding, NamedImports
var importClause = <ImportClause>createNode(SyntaxKind.ImportClause, fullStart);
if (identifier) {
// ImportedDefaultBinding:
// ImportedBinding
importClause.name = identifier;
}
// If there was no default import or if there is comma token after default import
// parse namespace or named imports
if (!importClause.name ||
parseOptional(SyntaxKind.CommaToken)) {
importClause.namedBindings = token === SyntaxKind.AsteriskToken ? parseNamespaceImport() : parseNamedImportsOrExports(SyntaxKind.NamedImports);
}
return finishNode(importClause);
}
function parseModuleReference() {
@ -4643,19 +4732,102 @@ module ts {
var node = <ExternalModuleReference>createNode(SyntaxKind.ExternalModuleReference);
parseExpected(SyntaxKind.RequireKeyword);
parseExpected(SyntaxKind.OpenParenToken);
node.expression = parseModuleSpecifier();
parseExpected(SyntaxKind.CloseParenToken);
return finishNode(node);
}
function parseModuleSpecifier(): Expression {
// We allow arbitrary expressions here, even though the grammar only allows string
// literals. We check to ensure that it is only a string literal later in the grammar
// walker.
node.expression = parseExpression();
var result = parseExpression();
// Ensure the string being required is in our 'identifier' table. This will ensure
// that features like 'find refs' will look inside this file when search for its name.
if (node.expression.kind === SyntaxKind.StringLiteral) {
internIdentifier((<LiteralExpression>node.expression).text);
if (result.kind === SyntaxKind.StringLiteral) {
internIdentifier((<LiteralExpression>result).text);
}
return result;
}
function parseNamespaceImport(): NamespaceImport {
// NameSpaceImport:
// * as ImportedBinding
var namespaceImport = <NamespaceImport>createNode(SyntaxKind.NamespaceImport);
parseExpected(SyntaxKind.AsteriskToken);
parseExpected(SyntaxKind.AsKeyword);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
function parseNamedImportsOrExports(kind: SyntaxKind): NamedImportsOrExports {
var node = <NamedImports>createNode(kind);
// NamedImports:
// { }
// { ImportsList }
// { ImportsList, }
// ImportsList:
// ImportSpecifier
// ImportsList, ImportSpecifier
node.elements = parseBracketedList(ParsingContext.ImportOrExportSpecifiers,
kind === SyntaxKind.NamedImports ? parseImportSpecifier : parseExportSpecifier,
SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken);
return finishNode(node);
}
function parseExportSpecifier() {
return parseImportOrExportSpecifier(SyntaxKind.ExportSpecifier);
}
function parseImportSpecifier() {
return parseImportOrExportSpecifier(SyntaxKind.ImportSpecifier);
}
function parseImportOrExportSpecifier(kind: SyntaxKind): ImportOrExportSpecifier {
var node = <ImportSpecifier>createNode(kind);
// ImportSpecifier:
// ImportedBinding
// IdentifierName as ImportedBinding
var isFirstIdentifierNameNotAnIdentifier = isKeyword(token) && !isIdentifier();
var start = scanner.getTokenPos();
var identifierName = parseIdentifierName();
if (token === SyntaxKind.AsKeyword) {
node.propertyName = identifierName;
parseExpected(SyntaxKind.AsKeyword);
if (isIdentifier()) {
node.name = parseIdentifierName();
}
else {
parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
}
}
else {
node.name = identifierName;
if (isFirstIdentifierNameNotAnIdentifier) {
// Report error identifier expected
parseErrorAtPosition(start, identifierName.end - start, Diagnostics.Identifier_expected);
}
}
parseExpected(SyntaxKind.CloseParenToken);
return finishNode(node);
}
function parseExportDeclaration(fullStart: number, modifiers: ModifiersArray): ExportDeclaration {
var node = <ExportDeclaration>createNode(SyntaxKind.ExportDeclaration, fullStart);
setModifiers(node, modifiers);
if (parseOptional(SyntaxKind.AsteriskToken)) {
parseExpected(SyntaxKind.FromKeyword);
node.moduleSpecifier = parseModuleSpecifier();
}
else {
node.exportClause = parseNamedImportsOrExports(SyntaxKind.NamedExports);
if (parseOptional(SyntaxKind.FromKeyword)) {
node.moduleSpecifier = parseModuleSpecifier();
}
}
parseSemicolon();
return finishNode(node);
}
@ -4684,16 +4856,18 @@ module ts {
case SyntaxKind.ClassKeyword:
case SyntaxKind.InterfaceKeyword:
case SyntaxKind.EnumKeyword:
case SyntaxKind.ImportKeyword:
case SyntaxKind.TypeKeyword:
// Not true keywords so ensure an identifier follows
return lookAhead(nextTokenIsIdentifierOrKeyword);
case SyntaxKind.ImportKeyword:
// Not true keywords so ensure an identifier follows or is string literal or asterisk or open brace
return lookAhead(nextTokenCanFollowImportKeyword);
case SyntaxKind.ModuleKeyword:
// Not a true keyword so ensure an identifier or string literal follows
return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral);
case SyntaxKind.ExportKeyword:
// Check for export assignment or modifier on source element
return lookAhead(nextTokenIsEqualsTokenOrDeclarationStart);
return lookAhead(nextTokenCanFollowExportKeyword);
case SyntaxKind.DeclareKeyword:
case SyntaxKind.PublicKeyword:
case SyntaxKind.PrivateKeyword:
@ -4718,9 +4892,16 @@ module ts {
return isIdentifierOrKeyword() || token === SyntaxKind.StringLiteral;
}
function nextTokenIsEqualsTokenOrDeclarationStart() {
function nextTokenCanFollowImportKeyword() {
nextToken();
return token === SyntaxKind.EqualsToken || isDeclarationStart();
return isIdentifierOrKeyword() || token === SyntaxKind.StringLiteral ||
token === SyntaxKind.AsteriskToken || token === SyntaxKind.OpenBraceToken;
}
function nextTokenCanFollowExportKeyword() {
nextToken();
return token === SyntaxKind.EqualsToken || token === SyntaxKind.AsteriskToken ||
token === SyntaxKind.OpenBraceToken || isDeclarationStart();
}
function nextTokenIsDeclarationStart() {
@ -4728,6 +4909,10 @@ module ts {
return isDeclarationStart();
}
function nextTokenIsAsKeyword() {
return nextToken() === SyntaxKind.AsKeyword;
}
function parseDeclaration(): ModuleElement {
var fullStart = getNodePos();
var modifiers = parseModifiers();
@ -4736,6 +4921,9 @@ module ts {
if (parseOptional(SyntaxKind.EqualsToken)) {
return parseExportAssignmentTail(fullStart, modifiers);
}
if (token === SyntaxKind.AsteriskToken || token === SyntaxKind.OpenBraceToken) {
return parseExportDeclaration(fullStart, modifiers);
}
}
switch (token) {
@ -4756,7 +4944,7 @@ module ts {
case SyntaxKind.ModuleKeyword:
return parseModuleDeclaration(fullStart, modifiers);
case SyntaxKind.ImportKeyword:
return parseImportDeclaration(fullStart, modifiers);
return parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers);
default:
Debug.fail("Mismatch between isDeclarationStart and parseDeclaration");
}
@ -4846,8 +5034,10 @@ module ts {
function setExternalModuleIndicator(sourceFile: SourceFile) {
sourceFile.externalModuleIndicator = forEach(sourceFile.statements, node =>
node.flags & NodeFlags.Export
|| node.kind === SyntaxKind.ImportDeclaration && (<ImportDeclaration>node).moduleReference.kind === SyntaxKind.ExternalModuleReference
|| node.kind === SyntaxKind.ImportEqualsDeclaration && (<ImportEqualsDeclaration>node).moduleReference.kind === SyntaxKind.ExternalModuleReference
|| node.kind === SyntaxKind.ImportDeclaration
|| node.kind === SyntaxKind.ExportAssignment
|| node.kind === SyntaxKind.ExportDeclaration
? node
: undefined);
}

View File

@ -351,24 +351,23 @@ module ts {
function processImportedModules(file: SourceFile, basePath: string) {
forEach(file.statements, node => {
if (isExternalModuleImportDeclaration(node) &&
getExternalModuleImportDeclarationExpression(node).kind === SyntaxKind.StringLiteral) {
var nameLiteral = <LiteralExpression>getExternalModuleImportDeclarationExpression(node);
var moduleName = nameLiteral.text;
if (moduleName) {
var searchPath = basePath;
while (true) {
var searchName = normalizePath(combinePaths(searchPath, moduleName));
if (findModuleSourceFile(searchName + ".ts", nameLiteral) || findModuleSourceFile(searchName + ".d.ts", nameLiteral)) {
break;
if (node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration || node.kind === SyntaxKind.ExportDeclaration) {
var moduleNameExpr = getExternalModuleName(node);
if (moduleNameExpr && moduleNameExpr.kind === SyntaxKind.StringLiteral) {
var moduleNameText = (<LiteralExpression>moduleNameExpr).text;
if (moduleNameText) {
var searchPath = basePath;
while (true) {
var searchName = normalizePath(combinePaths(searchPath, moduleNameText));
if (findModuleSourceFile(searchName + ".ts", moduleNameExpr) || findModuleSourceFile(searchName + ".d.ts", moduleNameExpr)) {
break;
}
var parentPath = getDirectoryPath(searchPath);
if (parentPath === searchPath) {
break;
}
searchPath = parentPath;
}
var parentPath = getDirectoryPath(searchPath);
if (parentPath === searchPath) {
break;
}
searchPath = parentPath;
}
}
}
@ -379,10 +378,10 @@ module ts {
// The StringLiteral must specify a top - level external module name.
// Relative external module names are not permitted
forEachChild((<ModuleDeclaration>node).body, node => {
if (isExternalModuleImportDeclaration(node) &&
getExternalModuleImportDeclarationExpression(node).kind === SyntaxKind.StringLiteral) {
if (isExternalModuleImportEqualsDeclaration(node) &&
getExternalModuleImportEqualsDeclarationExpression(node).kind === SyntaxKind.StringLiteral) {
var nameLiteral = <LiteralExpression>getExternalModuleImportDeclarationExpression(node);
var nameLiteral = <LiteralExpression>getExternalModuleImportEqualsDeclarationExpression(node);
var moduleName = nameLiteral.text;
if (moduleName) {
// TypeScript 1.0 spec (April 2014): 12.1.6
@ -399,7 +398,7 @@ module ts {
}
});
function findModuleSourceFile(fileName: string, nameLiteral: LiteralExpression) {
function findModuleSourceFile(fileName: string, nameLiteral: Expression) {
return findSourceFile(fileName, /* isDefaultLib */ false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos);
}
}

View File

@ -38,6 +38,7 @@ module ts {
var textToToken: Map<SyntaxKind> = {
"any": SyntaxKind.AnyKeyword,
"as": SyntaxKind.AsKeyword,
"boolean": SyntaxKind.BooleanKeyword,
"break": SyntaxKind.BreakKeyword,
"case": SyntaxKind.CaseKeyword,
@ -58,6 +59,7 @@ module ts {
"false": SyntaxKind.FalseKeyword,
"finally": SyntaxKind.FinallyKeyword,
"for": SyntaxKind.ForKeyword,
"from": SyntaxKind.FromKeyword,
"function": SyntaxKind.FunctionKeyword,
"get": SyntaxKind.GetKeyword,
"if": SyntaxKind.IfKeyword,

View File

@ -120,6 +120,8 @@ module ts {
WhileKeyword,
WithKeyword,
// Strict mode reserved words
AsKeyword,
FromKeyword,
ImplementsKeyword,
InterfaceKeyword,
LetKeyword,
@ -230,8 +232,16 @@ module ts {
EnumDeclaration,
ModuleDeclaration,
ModuleBlock,
ImportEqualsDeclaration,
ImportDeclaration,
ImportClause,
NamespaceImport,
NamedImports,
ImportSpecifier,
ExportAssignment,
ExportDeclaration,
NamedExports,
ExportSpecifier,
// Module references
ExternalModuleReference,
@ -344,13 +354,13 @@ module ts {
// Specific context the parser was in when this node was created. Normally undefined.
// Only set when the parser was in some interesting context (like async/yield).
parserContextFlags?: ParserContextFlags;
modifiers?: ModifiersArray; // Array of modifiers
id?: number; // Unique id (used to look up NodeLinks)
parent?: Node; // Parent node (initialized by binding)
symbol?: Symbol; // Symbol declared by node (initialized by binding)
locals?: SymbolTable; // Locals associated with node (initialized by binding)
nextContainer?: Node; // Next container in declaration order (initialized by binding)
localSymbol?: Symbol; // Local symbol declared by node (initialized by binding only for exported nodes)
modifiers?: ModifiersArray; // Array of modifiers
}
export interface NodeArray<T> extends Array<T>, TextRange {
@ -853,7 +863,11 @@ module ts {
members: NodeArray<EnumMember>;
}
export interface ModuleDeclaration extends Declaration, ModuleElement {
export interface ExportContainer {
exportStars?: ExportDeclaration[]; // List of 'export *' statements (initialized by binding)
}
export interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@ -862,7 +876,7 @@ module ts {
statements: NodeArray<ModuleElement>
}
export interface ImportDeclaration extends Declaration, ModuleElement {
export interface ImportEqualsDeclaration extends Declaration, ModuleElement {
name: Identifier;
// 'EntityName' for an internal module reference, 'ExternalModuleReference' for an external
@ -874,6 +888,50 @@ module ts {
expression?: Expression;
}
// In case of:
// import "mod" => importClause = undefined, moduleSpecifier = "mod"
// In rest of the cases, module specifier is string literal corresponding to module
// ImportClause information is shown at its declaration below.
export interface ImportDeclaration extends Statement, ModuleElement {
importClause?: ImportClause;
moduleSpecifier: Expression;
}
// In case of:
// import d from "mod" => name = d, namedBinding = undefined
// import * as ns from "mod" => name = undefined, namedBinding: NamespaceImport = { name: ns }
// import d, * as ns from "mod" => name = d, namedBinding: NamespaceImport = { name: ns }
// import { a, b as x } from "mod" => name = undefined, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]}
// import d, { a, b as x } from "mod" => name = d, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]}
export interface ImportClause extends Declaration {
name?: Identifier; // Default binding
namedBindings?: NamespaceImport | NamedImports;
}
export interface NamespaceImport extends Declaration {
name: Identifier;
}
export interface ExportDeclaration extends Statement, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
export interface NamedImportsOrExports extends Node {
elements: NodeArray<ImportOrExportSpecifier>;
}
export type NamedImports = NamedImportsOrExports;
export type NamedExports = NamedImportsOrExports;
export interface ImportOrExportSpecifier extends Declaration {
propertyName?: Identifier; // Name preceding "as" keyword (or undefined when "as" is absent)
name: Identifier; // Declared name
}
export type ImportSpecifier = ImportOrExportSpecifier;
export type ExportSpecifier = ImportOrExportSpecifier;
export interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
}
@ -887,7 +945,7 @@ module ts {
}
// Source files are declarations when they are external modules.
export interface SourceFile extends Declaration {
export interface SourceFile extends Declaration, ExportContainer {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
@ -1120,7 +1178,7 @@ module ts {
export interface SymbolVisibilityResult {
accessibility: SymbolAccessibility;
aliasesToMakeVisible?: ImportDeclaration[]; // aliases that need to have this symbol visible
aliasesToMakeVisible?: ImportEqualsDeclaration[]; // aliases that need to have this symbol visible
errorSymbolName?: string; // Optional symbol name that results in error
errorNode?: Node; // optional node that results in error
}
@ -1130,11 +1188,11 @@ module ts {
}
export interface EmitResolver {
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
getExpressionNamePrefix(node: Identifier): string;
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
isReferencedImportDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
@ -1237,18 +1295,20 @@ module ts {
members?: SymbolTable; // Class, interface or literal instance members
exports?: SymbolTable; // Module exports
exportSymbol?: Symbol; // Exported symbol associated with this symbol
valueDeclaration?: Declaration // First value declaration of the symbol,
constEnumOnlyModule?: boolean // For modules - if true - module contains only const enums or other modules with only const enums.
valueDeclaration?: Declaration // First value declaration of the symbol
constEnumOnlyModule?: boolean // True if module contains only const enums or other modules with only const enums
}
export interface SymbolLinks {
target?: Symbol; // Resolved (non-alias) target of an alias
type?: Type; // Type of value symbol
declaredType?: Type; // Type of class, interface, enum, or type parameter
mapper?: TypeMapper; // Type mapper for instantiation alias
referenced?: boolean; // True if alias symbol has been referenced as a value
exportAssignSymbol?: Symbol; // Symbol exported from external module
unionType?: UnionType; // Containing union type for union property
target?: Symbol; // Resolved (non-alias) target of an alias
type?: Type; // Type of value symbol
declaredType?: Type; // Type of class, interface, enum, or type parameter
mapper?: TypeMapper; // Type mapper for instantiation alias
referenced?: boolean; // True if alias symbol has been referenced as a value
exportAssignmentChecked?: boolean; // True if export assignment was checked
exportAssignmentSymbol?: Symbol; // Symbol exported from external module
unionType?: UnionType; // Containing union type for union property
resolvedExports?: SymbolTable; // Resolved exports of module
}
export interface TransientSymbol extends Symbol, SymbolLinks { }
@ -1278,7 +1338,8 @@ module ts {
enumMemberValue?: number; // Constant value of enum member
isIllegalTypeReferenceInConstraint?: boolean; // Is type reference in constraint refers to the type parameter from the same list
isVisible?: boolean; // Is this node visible
localModuleName?: string; // Local name for module instance
generatedName?: string; // Generated name for module, enum, or import declaration
generatedNames?: Map<string>; // Generated names table for source file
assignmentChecks?: Map<boolean>; // Cache of assignment checks
hasReportedStatementInAmbientContext?: boolean; // Cache boolean if we report statements in ambient context
importOnRightSide?: Symbol; // for import declarations - import that appear on the right side

View File

@ -186,6 +186,12 @@ module ts {
return identifier.length >= 3 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ && identifier.charCodeAt(2) === CharacterCodes._ ? identifier.substr(1) : identifier;
}
// Make an identifier from an external module name by extracting the string after the last "/" and replacing
// all non-alphanumeric characters with underscores
export function makeIdentifierFromModuleName(moduleName: string): string {
return getBaseFileName(moduleName).replace(/\W/g, "_");
}
// Return display name of an identifier
// Computed property names will just be emitted as "[<expr>]", where <expr> is the source
// text of the expression in the computed property.
@ -591,17 +597,32 @@ module ts {
(preserveConstEnums && moduleState === ModuleInstanceState.ConstEnumOnly);
}
export function isExternalModuleImportDeclaration(node: Node) {
return node.kind === SyntaxKind.ImportDeclaration && (<ImportDeclaration>node).moduleReference.kind === SyntaxKind.ExternalModuleReference;
export function isExternalModuleImportEqualsDeclaration(node: Node) {
return node.kind === SyntaxKind.ImportEqualsDeclaration && (<ImportEqualsDeclaration>node).moduleReference.kind === SyntaxKind.ExternalModuleReference;
}
export function getExternalModuleImportDeclarationExpression(node: Node) {
Debug.assert(isExternalModuleImportDeclaration(node));
return (<ExternalModuleReference>(<ImportDeclaration>node).moduleReference).expression;
export function getExternalModuleImportEqualsDeclarationExpression(node: Node) {
Debug.assert(isExternalModuleImportEqualsDeclaration(node));
return (<ExternalModuleReference>(<ImportEqualsDeclaration>node).moduleReference).expression;
}
export function isInternalModuleImportDeclaration(node: Node) {
return node.kind === SyntaxKind.ImportDeclaration && (<ImportDeclaration>node).moduleReference.kind !== SyntaxKind.ExternalModuleReference;
export function isInternalModuleImportEqualsDeclaration(node: Node) {
return node.kind === SyntaxKind.ImportEqualsDeclaration && (<ImportEqualsDeclaration>node).moduleReference.kind !== SyntaxKind.ExternalModuleReference;
}
export function getExternalModuleName(node: Node): Expression {
if (node.kind === SyntaxKind.ImportDeclaration) {
return (<ImportDeclaration>node).moduleSpecifier;
}
if (node.kind === SyntaxKind.ImportEqualsDeclaration) {
var reference = (<ImportEqualsDeclaration>node).moduleReference;
if (reference.kind === SyntaxKind.ExternalModuleReference) {
return (<ExternalModuleReference>reference).expression;
}
}
if (node.kind === SyntaxKind.ExportDeclaration) {
return (<ExportDeclaration>node).moduleSpecifier;
}
}
export function hasDotDotDotToken(node: Node) {
@ -680,7 +701,11 @@ module ts {
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.ImportClause:
case SyntaxKind.ImportSpecifier:
case SyntaxKind.NamespaceImport:
case SyntaxKind.ExportSpecifier:
return true;
}
return false;
@ -767,36 +792,12 @@ module ts {
}
export function getAncestor(node: Node, kind: SyntaxKind): Node {
switch (kind) {
// special-cases that can be come first
case SyntaxKind.ClassDeclaration:
while (node) {
switch (node.kind) {
case SyntaxKind.ClassDeclaration:
return <ClassDeclaration>node;
case SyntaxKind.EnumDeclaration:
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.ImportDeclaration:
// early exit cases - declarations cannot be nested in classes
return undefined;
default:
node = node.parent;
continue;
}
}
break;
default:
while (node) {
if (node.kind === kind) {
return node;
}
node = node.parent;
}
break;
while (node) {
if (node.kind === kind) {
return node;
}
node = node.parent;
}
return undefined;
}

View File

@ -176,9 +176,9 @@ module ts.BreakpointResolver {
// span on export = id
return textSpan(node, (<ExportAssignment>node).exportName);
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
// import statement without including semicolon
return textSpan(node,(<ImportDeclaration>node).moduleReference);
return textSpan(node,(<ImportEqualsDeclaration>node).moduleReference);
case SyntaxKind.ModuleDeclaration:
// span on complete module if it is instantiated

View File

@ -452,7 +452,7 @@ module ts.formatting {
return true;
// equal in import a = module('a');
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
// equal in var a = 0;
case SyntaxKind.VariableDeclaration:
// equal in p = 0;

View File

@ -801,7 +801,7 @@ module ts {
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.TypeLiteral:
@ -1895,7 +1895,7 @@ module ts {
function isNameOfExternalModuleImportOrDeclaration(node: Node): boolean {
if (node.kind === SyntaxKind.StringLiteral) {
return isNameOfModuleDeclaration(node) ||
(isExternalModuleImportDeclaration(node.parent.parent) && getExternalModuleImportDeclarationExpression(node.parent.parent) === node);
(isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node);
}
return false;
@ -3045,19 +3045,19 @@ module ts {
displayParts.push(spacePart());
addFullSymbolName(symbol);
ts.forEach(symbol.declarations, declaration => {
if (declaration.kind === SyntaxKind.ImportDeclaration) {
var importDeclaration = <ImportDeclaration>declaration;
if (isExternalModuleImportDeclaration(importDeclaration)) {
if (declaration.kind === SyntaxKind.ImportEqualsDeclaration) {
var importEqualsDeclaration = <ImportEqualsDeclaration>declaration;
if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
displayParts.push(spacePart());
displayParts.push(keywordPart(SyntaxKind.RequireKeyword));
displayParts.push(punctuationPart(SyntaxKind.OpenParenToken));
displayParts.push(displayPart(getTextOfNode(getExternalModuleImportDeclarationExpression(importDeclaration)), SymbolDisplayPartKind.stringLiteral));
displayParts.push(displayPart(getTextOfNode(getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral));
displayParts.push(punctuationPart(SyntaxKind.CloseParenToken));
}
else {
var internalAliasSymbol = typeResolver.getSymbolAtLocation(importDeclaration.moduleReference);
var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
@ -4693,7 +4693,7 @@ module ts {
return SemanticMeaning.Namespace;
}
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace;
// An external module can be a Value
@ -4728,10 +4728,10 @@ module ts {
while (node.parent.kind === SyntaxKind.QualifiedName) {
node = node.parent;
}
return isInternalModuleImportDeclaration(node.parent) && (<ImportDeclaration>node.parent).moduleReference === node;
return isInternalModuleImportEqualsDeclaration(node.parent) && (<ImportEqualsDeclaration>node.parent).moduleReference === node;
}
function getMeaningFromRightHandSideOfImport(node: Node) {
function getMeaningFromRightHandSideOfImportEquals(node: Node) {
Debug.assert(node.kind === SyntaxKind.Identifier);
// import a = |b|; // Namespace
@ -4740,7 +4740,7 @@ module ts {
if (node.parent.kind === SyntaxKind.QualifiedName &&
(<QualifiedName>node.parent).right === node &&
node.parent.parent.kind === SyntaxKind.ImportDeclaration) {
node.parent.parent.kind === SyntaxKind.ImportEqualsDeclaration) {
return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace;
}
return SemanticMeaning.Namespace;
@ -4751,7 +4751,7 @@ module ts {
return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace;
}
else if (isInRightSideOfImport(node)) {
return getMeaningFromRightHandSideOfImport(node);
return getMeaningFromRightHandSideOfImportEquals(node);
}
else if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) {
return getMeaningFromDeclaration(node.parent);

View File

@ -160,132 +160,142 @@ declare module "typescript" {
VoidKeyword = 98,
WhileKeyword = 99,
WithKeyword = 100,
ImplementsKeyword = 101,
InterfaceKeyword = 102,
LetKeyword = 103,
PackageKeyword = 104,
PrivateKeyword = 105,
ProtectedKeyword = 106,
PublicKeyword = 107,
StaticKeyword = 108,
YieldKeyword = 109,
AnyKeyword = 110,
BooleanKeyword = 111,
ConstructorKeyword = 112,
DeclareKeyword = 113,
GetKeyword = 114,
ModuleKeyword = 115,
RequireKeyword = 116,
NumberKeyword = 117,
SetKeyword = 118,
StringKeyword = 119,
SymbolKeyword = 120,
TypeKeyword = 121,
OfKeyword = 122,
QualifiedName = 123,
ComputedPropertyName = 124,
TypeParameter = 125,
Parameter = 126,
PropertySignature = 127,
PropertyDeclaration = 128,
MethodSignature = 129,
MethodDeclaration = 130,
Constructor = 131,
GetAccessor = 132,
SetAccessor = 133,
CallSignature = 134,
ConstructSignature = 135,
IndexSignature = 136,
TypeReference = 137,
FunctionType = 138,
ConstructorType = 139,
TypeQuery = 140,
TypeLiteral = 141,
ArrayType = 142,
TupleType = 143,
UnionType = 144,
ParenthesizedType = 145,
ObjectBindingPattern = 146,
ArrayBindingPattern = 147,
BindingElement = 148,
ArrayLiteralExpression = 149,
ObjectLiteralExpression = 150,
PropertyAccessExpression = 151,
ElementAccessExpression = 152,
CallExpression = 153,
NewExpression = 154,
TaggedTemplateExpression = 155,
TypeAssertionExpression = 156,
ParenthesizedExpression = 157,
FunctionExpression = 158,
ArrowFunction = 159,
DeleteExpression = 160,
TypeOfExpression = 161,
VoidExpression = 162,
PrefixUnaryExpression = 163,
PostfixUnaryExpression = 164,
BinaryExpression = 165,
ConditionalExpression = 166,
TemplateExpression = 167,
YieldExpression = 168,
SpreadElementExpression = 169,
OmittedExpression = 170,
TemplateSpan = 171,
Block = 172,
VariableStatement = 173,
EmptyStatement = 174,
ExpressionStatement = 175,
IfStatement = 176,
DoStatement = 177,
WhileStatement = 178,
ForStatement = 179,
ForInStatement = 180,
ForOfStatement = 181,
ContinueStatement = 182,
BreakStatement = 183,
ReturnStatement = 184,
WithStatement = 185,
SwitchStatement = 186,
LabeledStatement = 187,
ThrowStatement = 188,
TryStatement = 189,
DebuggerStatement = 190,
VariableDeclaration = 191,
VariableDeclarationList = 192,
FunctionDeclaration = 193,
ClassDeclaration = 194,
InterfaceDeclaration = 195,
TypeAliasDeclaration = 196,
EnumDeclaration = 197,
ModuleDeclaration = 198,
ModuleBlock = 199,
ImportDeclaration = 200,
ExportAssignment = 201,
ExternalModuleReference = 202,
CaseClause = 203,
DefaultClause = 204,
HeritageClause = 205,
CatchClause = 206,
PropertyAssignment = 207,
ShorthandPropertyAssignment = 208,
EnumMember = 209,
SourceFile = 210,
SyntaxList = 211,
Count = 212,
AsKeyword = 101,
FromKeyword = 102,
ImplementsKeyword = 103,
InterfaceKeyword = 104,
LetKeyword = 105,
PackageKeyword = 106,
PrivateKeyword = 107,
ProtectedKeyword = 108,
PublicKeyword = 109,
StaticKeyword = 110,
YieldKeyword = 111,
AnyKeyword = 112,
BooleanKeyword = 113,
ConstructorKeyword = 114,
DeclareKeyword = 115,
GetKeyword = 116,
ModuleKeyword = 117,
RequireKeyword = 118,
NumberKeyword = 119,
SetKeyword = 120,
StringKeyword = 121,
SymbolKeyword = 122,
TypeKeyword = 123,
OfKeyword = 124,
QualifiedName = 125,
ComputedPropertyName = 126,
TypeParameter = 127,
Parameter = 128,
PropertySignature = 129,
PropertyDeclaration = 130,
MethodSignature = 131,
MethodDeclaration = 132,
Constructor = 133,
GetAccessor = 134,
SetAccessor = 135,
CallSignature = 136,
ConstructSignature = 137,
IndexSignature = 138,
TypeReference = 139,
FunctionType = 140,
ConstructorType = 141,
TypeQuery = 142,
TypeLiteral = 143,
ArrayType = 144,
TupleType = 145,
UnionType = 146,
ParenthesizedType = 147,
ObjectBindingPattern = 148,
ArrayBindingPattern = 149,
BindingElement = 150,
ArrayLiteralExpression = 151,
ObjectLiteralExpression = 152,
PropertyAccessExpression = 153,
ElementAccessExpression = 154,
CallExpression = 155,
NewExpression = 156,
TaggedTemplateExpression = 157,
TypeAssertionExpression = 158,
ParenthesizedExpression = 159,
FunctionExpression = 160,
ArrowFunction = 161,
DeleteExpression = 162,
TypeOfExpression = 163,
VoidExpression = 164,
PrefixUnaryExpression = 165,
PostfixUnaryExpression = 166,
BinaryExpression = 167,
ConditionalExpression = 168,
TemplateExpression = 169,
YieldExpression = 170,
SpreadElementExpression = 171,
OmittedExpression = 172,
TemplateSpan = 173,
Block = 174,
VariableStatement = 175,
EmptyStatement = 176,
ExpressionStatement = 177,
IfStatement = 178,
DoStatement = 179,
WhileStatement = 180,
ForStatement = 181,
ForInStatement = 182,
ForOfStatement = 183,
ContinueStatement = 184,
BreakStatement = 185,
ReturnStatement = 186,
WithStatement = 187,
SwitchStatement = 188,
LabeledStatement = 189,
ThrowStatement = 190,
TryStatement = 191,
DebuggerStatement = 192,
VariableDeclaration = 193,
VariableDeclarationList = 194,
FunctionDeclaration = 195,
ClassDeclaration = 196,
InterfaceDeclaration = 197,
TypeAliasDeclaration = 198,
EnumDeclaration = 199,
ModuleDeclaration = 200,
ModuleBlock = 201,
ImportEqualsDeclaration = 202,
ImportDeclaration = 203,
ImportClause = 204,
NamespaceImport = 205,
NamedImports = 206,
ImportSpecifier = 207,
ExportAssignment = 208,
ExportDeclaration = 209,
NamedExports = 210,
ExportSpecifier = 211,
ExternalModuleReference = 212,
CaseClause = 213,
DefaultClause = 214,
HeritageClause = 215,
CatchClause = 216,
PropertyAssignment = 217,
ShorthandPropertyAssignment = 218,
EnumMember = 219,
SourceFile = 220,
SyntaxList = 221,
Count = 222,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
LastReservedWord = 100,
FirstKeyword = 65,
LastKeyword = 122,
FirstFutureReservedWord = 101,
LastFutureReservedWord = 109,
FirstTypeNode = 137,
LastTypeNode = 145,
LastKeyword = 124,
FirstFutureReservedWord = 103,
LastFutureReservedWord = 111,
FirstTypeNode = 139,
LastTypeNode = 147,
FirstPunctuation = 14,
LastPunctuation = 63,
FirstToken = 0,
LastToken = 122,
LastToken = 124,
FirstTriviaToken = 2,
LastTriviaToken = 6,
FirstLiteralToken = 7,
@ -294,7 +304,7 @@ declare module "typescript" {
LastTemplateToken = 13,
FirstBinaryOperator = 24,
LastBinaryOperator = 63,
FirstNode = 123,
FirstNode = 125,
}
const enum NodeFlags {
Export = 1,
@ -332,13 +342,13 @@ declare module "typescript" {
kind: SyntaxKind;
flags: NodeFlags;
parserContextFlags?: ParserContextFlags;
modifiers?: ModifiersArray;
id?: number;
parent?: Node;
symbol?: Symbol;
locals?: SymbolTable;
nextContainer?: Node;
localSymbol?: Symbol;
modifiers?: ModifiersArray;
}
interface NodeArray<T> extends Array<T>, TextRange {
hasTrailingComma?: boolean;
@ -702,20 +712,49 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ModuleDeclaration extends Declaration, ModuleElement {
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
interface ModuleBlock extends Node, ModuleElement {
statements: NodeArray<ModuleElement>;
}
interface ImportDeclaration extends Declaration, ModuleElement {
interface ImportEqualsDeclaration extends Declaration, ModuleElement {
name: Identifier;
moduleReference: EntityName | ExternalModuleReference;
}
interface ExternalModuleReference extends Node {
expression?: Expression;
}
interface ImportDeclaration extends Statement, ModuleElement {
importClause?: ImportClause;
moduleSpecifier: Expression;
}
interface ImportClause extends Declaration {
name?: Identifier;
namedBindings?: NamespaceImport | NamedImports;
}
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
interface NamedImportsOrExports extends Node {
elements: NodeArray<ImportOrExportSpecifier>;
}
type NamedImports = NamedImportsOrExports;
type NamedExports = NamedImportsOrExports;
interface ImportOrExportSpecifier extends Declaration {
propertyName?: Identifier;
name: Identifier;
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
}
@ -725,7 +764,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration {
interface SourceFile extends Declaration, ExportContainer {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@ -879,7 +918,7 @@ declare module "typescript" {
}
interface SymbolVisibilityResult {
accessibility: SymbolAccessibility;
aliasesToMakeVisible?: ImportDeclaration[];
aliasesToMakeVisible?: ImportEqualsDeclaration[];
errorSymbolName?: string;
errorNode?: Node;
}
@ -887,11 +926,11 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
getExpressionNamePrefix(node: Identifier): string;
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
isReferencedImportDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
@ -986,8 +1025,10 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignSymbol?: Symbol;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@ -1012,7 +1053,8 @@ declare module "typescript" {
enumMemberValue?: number;
isIllegalTypeReferenceInConstraint?: boolean;
isVisible?: boolean;
localModuleName?: string;
generatedName?: string;
generatedNames?: Map<string>;
assignmentChecks?: Map<boolean>;
hasReportedStatementInAmbientContext?: boolean;
importOnRightSide?: Symbol;

View File

@ -498,340 +498,370 @@ declare module "typescript" {
WithKeyword = 100,
>WithKeyword : SyntaxKind
ImplementsKeyword = 101,
AsKeyword = 101,
>AsKeyword : SyntaxKind
FromKeyword = 102,
>FromKeyword : SyntaxKind
ImplementsKeyword = 103,
>ImplementsKeyword : SyntaxKind
InterfaceKeyword = 102,
InterfaceKeyword = 104,
>InterfaceKeyword : SyntaxKind
LetKeyword = 103,
LetKeyword = 105,
>LetKeyword : SyntaxKind
PackageKeyword = 104,
PackageKeyword = 106,
>PackageKeyword : SyntaxKind
PrivateKeyword = 105,
PrivateKeyword = 107,
>PrivateKeyword : SyntaxKind
ProtectedKeyword = 106,
ProtectedKeyword = 108,
>ProtectedKeyword : SyntaxKind
PublicKeyword = 107,
PublicKeyword = 109,
>PublicKeyword : SyntaxKind
StaticKeyword = 108,
StaticKeyword = 110,
>StaticKeyword : SyntaxKind
YieldKeyword = 109,
YieldKeyword = 111,
>YieldKeyword : SyntaxKind
AnyKeyword = 110,
AnyKeyword = 112,
>AnyKeyword : SyntaxKind
BooleanKeyword = 111,
BooleanKeyword = 113,
>BooleanKeyword : SyntaxKind
ConstructorKeyword = 112,
ConstructorKeyword = 114,
>ConstructorKeyword : SyntaxKind
DeclareKeyword = 113,
DeclareKeyword = 115,
>DeclareKeyword : SyntaxKind
GetKeyword = 114,
GetKeyword = 116,
>GetKeyword : SyntaxKind
ModuleKeyword = 115,
ModuleKeyword = 117,
>ModuleKeyword : SyntaxKind
RequireKeyword = 116,
RequireKeyword = 118,
>RequireKeyword : SyntaxKind
NumberKeyword = 117,
NumberKeyword = 119,
>NumberKeyword : SyntaxKind
SetKeyword = 118,
SetKeyword = 120,
>SetKeyword : SyntaxKind
StringKeyword = 119,
StringKeyword = 121,
>StringKeyword : SyntaxKind
SymbolKeyword = 120,
SymbolKeyword = 122,
>SymbolKeyword : SyntaxKind
TypeKeyword = 121,
TypeKeyword = 123,
>TypeKeyword : SyntaxKind
OfKeyword = 122,
OfKeyword = 124,
>OfKeyword : SyntaxKind
QualifiedName = 123,
QualifiedName = 125,
>QualifiedName : SyntaxKind
ComputedPropertyName = 124,
ComputedPropertyName = 126,
>ComputedPropertyName : SyntaxKind
TypeParameter = 125,
TypeParameter = 127,
>TypeParameter : SyntaxKind
Parameter = 126,
Parameter = 128,
>Parameter : SyntaxKind
PropertySignature = 127,
PropertySignature = 129,
>PropertySignature : SyntaxKind
PropertyDeclaration = 128,
PropertyDeclaration = 130,
>PropertyDeclaration : SyntaxKind
MethodSignature = 129,
MethodSignature = 131,
>MethodSignature : SyntaxKind
MethodDeclaration = 130,
MethodDeclaration = 132,
>MethodDeclaration : SyntaxKind
Constructor = 131,
Constructor = 133,
>Constructor : SyntaxKind
GetAccessor = 132,
GetAccessor = 134,
>GetAccessor : SyntaxKind
SetAccessor = 133,
SetAccessor = 135,
>SetAccessor : SyntaxKind
CallSignature = 134,
CallSignature = 136,
>CallSignature : SyntaxKind
ConstructSignature = 135,
ConstructSignature = 137,
>ConstructSignature : SyntaxKind
IndexSignature = 136,
IndexSignature = 138,
>IndexSignature : SyntaxKind
TypeReference = 137,
TypeReference = 139,
>TypeReference : SyntaxKind
FunctionType = 138,
FunctionType = 140,
>FunctionType : SyntaxKind
ConstructorType = 139,
ConstructorType = 141,
>ConstructorType : SyntaxKind
TypeQuery = 140,
TypeQuery = 142,
>TypeQuery : SyntaxKind
TypeLiteral = 141,
TypeLiteral = 143,
>TypeLiteral : SyntaxKind
ArrayType = 142,
ArrayType = 144,
>ArrayType : SyntaxKind
TupleType = 143,
TupleType = 145,
>TupleType : SyntaxKind
UnionType = 144,
UnionType = 146,
>UnionType : SyntaxKind
ParenthesizedType = 145,
ParenthesizedType = 147,
>ParenthesizedType : SyntaxKind
ObjectBindingPattern = 146,
ObjectBindingPattern = 148,
>ObjectBindingPattern : SyntaxKind
ArrayBindingPattern = 147,
ArrayBindingPattern = 149,
>ArrayBindingPattern : SyntaxKind
BindingElement = 148,
BindingElement = 150,
>BindingElement : SyntaxKind
ArrayLiteralExpression = 149,
ArrayLiteralExpression = 151,
>ArrayLiteralExpression : SyntaxKind
ObjectLiteralExpression = 150,
ObjectLiteralExpression = 152,
>ObjectLiteralExpression : SyntaxKind
PropertyAccessExpression = 151,
PropertyAccessExpression = 153,
>PropertyAccessExpression : SyntaxKind
ElementAccessExpression = 152,
ElementAccessExpression = 154,
>ElementAccessExpression : SyntaxKind
CallExpression = 153,
CallExpression = 155,
>CallExpression : SyntaxKind
NewExpression = 154,
NewExpression = 156,
>NewExpression : SyntaxKind
TaggedTemplateExpression = 155,
TaggedTemplateExpression = 157,
>TaggedTemplateExpression : SyntaxKind
TypeAssertionExpression = 156,
TypeAssertionExpression = 158,
>TypeAssertionExpression : SyntaxKind
ParenthesizedExpression = 157,
ParenthesizedExpression = 159,
>ParenthesizedExpression : SyntaxKind
FunctionExpression = 158,
FunctionExpression = 160,
>FunctionExpression : SyntaxKind
ArrowFunction = 159,
ArrowFunction = 161,
>ArrowFunction : SyntaxKind
DeleteExpression = 160,
DeleteExpression = 162,
>DeleteExpression : SyntaxKind
TypeOfExpression = 161,
TypeOfExpression = 163,
>TypeOfExpression : SyntaxKind
VoidExpression = 162,
VoidExpression = 164,
>VoidExpression : SyntaxKind
PrefixUnaryExpression = 163,
PrefixUnaryExpression = 165,
>PrefixUnaryExpression : SyntaxKind
PostfixUnaryExpression = 164,
PostfixUnaryExpression = 166,
>PostfixUnaryExpression : SyntaxKind
BinaryExpression = 165,
BinaryExpression = 167,
>BinaryExpression : SyntaxKind
ConditionalExpression = 166,
ConditionalExpression = 168,
>ConditionalExpression : SyntaxKind
TemplateExpression = 167,
TemplateExpression = 169,
>TemplateExpression : SyntaxKind
YieldExpression = 168,
YieldExpression = 170,
>YieldExpression : SyntaxKind
SpreadElementExpression = 169,
SpreadElementExpression = 171,
>SpreadElementExpression : SyntaxKind
OmittedExpression = 170,
OmittedExpression = 172,
>OmittedExpression : SyntaxKind
TemplateSpan = 171,
TemplateSpan = 173,
>TemplateSpan : SyntaxKind
Block = 172,
Block = 174,
>Block : SyntaxKind
VariableStatement = 173,
VariableStatement = 175,
>VariableStatement : SyntaxKind
EmptyStatement = 174,
EmptyStatement = 176,
>EmptyStatement : SyntaxKind
ExpressionStatement = 175,
ExpressionStatement = 177,
>ExpressionStatement : SyntaxKind
IfStatement = 176,
IfStatement = 178,
>IfStatement : SyntaxKind
DoStatement = 177,
DoStatement = 179,
>DoStatement : SyntaxKind
WhileStatement = 178,
WhileStatement = 180,
>WhileStatement : SyntaxKind
ForStatement = 179,
ForStatement = 181,
>ForStatement : SyntaxKind
ForInStatement = 180,
ForInStatement = 182,
>ForInStatement : SyntaxKind
ForOfStatement = 181,
ForOfStatement = 183,
>ForOfStatement : SyntaxKind
ContinueStatement = 182,
ContinueStatement = 184,
>ContinueStatement : SyntaxKind
BreakStatement = 183,
BreakStatement = 185,
>BreakStatement : SyntaxKind
ReturnStatement = 184,
ReturnStatement = 186,
>ReturnStatement : SyntaxKind
WithStatement = 185,
WithStatement = 187,
>WithStatement : SyntaxKind
SwitchStatement = 186,
SwitchStatement = 188,
>SwitchStatement : SyntaxKind
LabeledStatement = 187,
LabeledStatement = 189,
>LabeledStatement : SyntaxKind
ThrowStatement = 188,
ThrowStatement = 190,
>ThrowStatement : SyntaxKind
TryStatement = 189,
TryStatement = 191,
>TryStatement : SyntaxKind
DebuggerStatement = 190,
DebuggerStatement = 192,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 191,
VariableDeclaration = 193,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 192,
VariableDeclarationList = 194,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 193,
FunctionDeclaration = 195,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 194,
ClassDeclaration = 196,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 195,
InterfaceDeclaration = 197,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 196,
TypeAliasDeclaration = 198,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 197,
EnumDeclaration = 199,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 198,
ModuleDeclaration = 200,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 199,
ModuleBlock = 201,
>ModuleBlock : SyntaxKind
ImportDeclaration = 200,
ImportEqualsDeclaration = 202,
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 203,
>ImportDeclaration : SyntaxKind
ExportAssignment = 201,
ImportClause = 204,
>ImportClause : SyntaxKind
NamespaceImport = 205,
>NamespaceImport : SyntaxKind
NamedImports = 206,
>NamedImports : SyntaxKind
ImportSpecifier = 207,
>ImportSpecifier : SyntaxKind
ExportAssignment = 208,
>ExportAssignment : SyntaxKind
ExternalModuleReference = 202,
ExportDeclaration = 209,
>ExportDeclaration : SyntaxKind
NamedExports = 210,
>NamedExports : SyntaxKind
ExportSpecifier = 211,
>ExportSpecifier : SyntaxKind
ExternalModuleReference = 212,
>ExternalModuleReference : SyntaxKind
CaseClause = 203,
CaseClause = 213,
>CaseClause : SyntaxKind
DefaultClause = 204,
DefaultClause = 214,
>DefaultClause : SyntaxKind
HeritageClause = 205,
HeritageClause = 215,
>HeritageClause : SyntaxKind
CatchClause = 206,
CatchClause = 216,
>CatchClause : SyntaxKind
PropertyAssignment = 207,
PropertyAssignment = 217,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 208,
ShorthandPropertyAssignment = 218,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 209,
EnumMember = 219,
>EnumMember : SyntaxKind
SourceFile = 210,
SourceFile = 220,
>SourceFile : SyntaxKind
SyntaxList = 211,
SyntaxList = 221,
>SyntaxList : SyntaxKind
Count = 212,
Count = 222,
>Count : SyntaxKind
FirstAssignment = 52,
@ -849,19 +879,19 @@ declare module "typescript" {
FirstKeyword = 65,
>FirstKeyword : SyntaxKind
LastKeyword = 122,
LastKeyword = 124,
>LastKeyword : SyntaxKind
FirstFutureReservedWord = 101,
FirstFutureReservedWord = 103,
>FirstFutureReservedWord : SyntaxKind
LastFutureReservedWord = 109,
LastFutureReservedWord = 111,
>LastFutureReservedWord : SyntaxKind
FirstTypeNode = 137,
FirstTypeNode = 139,
>FirstTypeNode : SyntaxKind
LastTypeNode = 145,
LastTypeNode = 147,
>LastTypeNode : SyntaxKind
FirstPunctuation = 14,
@ -873,7 +903,7 @@ declare module "typescript" {
FirstToken = 0,
>FirstToken : SyntaxKind
LastToken = 122,
LastToken = 124,
>LastToken : SyntaxKind
FirstTriviaToken = 2,
@ -900,7 +930,7 @@ declare module "typescript" {
LastBinaryOperator = 63,
>LastBinaryOperator : SyntaxKind
FirstNode = 123,
FirstNode = 125,
>FirstNode : SyntaxKind
}
const enum NodeFlags {
@ -1006,6 +1036,10 @@ declare module "typescript" {
>parserContextFlags : ParserContextFlags
>ParserContextFlags : ParserContextFlags
modifiers?: ModifiersArray;
>modifiers : ModifiersArray
>ModifiersArray : ModifiersArray
id?: number;
>id : number
@ -1028,10 +1062,6 @@ declare module "typescript" {
localSymbol?: Symbol;
>localSymbol : Symbol
>Symbol : Symbol
modifiers?: ModifiersArray;
>modifiers : ModifiersArray
>ModifiersArray : ModifiersArray
}
interface NodeArray<T> extends Array<T>, TextRange {
>NodeArray : NodeArray<T>
@ -2130,10 +2160,18 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}
interface ModuleDeclaration extends Declaration, ModuleElement {
interface ExportContainer {
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;
>name : Identifier | LiteralExpression
@ -2155,8 +2193,8 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>ModuleElement : ModuleElement
}
interface ImportDeclaration extends Declaration, ModuleElement {
>ImportDeclaration : ImportDeclaration
interface ImportEqualsDeclaration extends Declaration, ModuleElement {
>ImportEqualsDeclaration : ImportEqualsDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
@ -2177,6 +2215,90 @@ declare module "typescript" {
>expression : Expression
>Expression : Expression
}
interface ImportDeclaration extends Statement, ModuleElement {
>ImportDeclaration : ImportDeclaration
>Statement : Statement
>ModuleElement : ModuleElement
importClause?: ImportClause;
>importClause : ImportClause
>ImportClause : ImportClause
moduleSpecifier: Expression;
>moduleSpecifier : Expression
>Expression : Expression
}
interface ImportClause extends Declaration {
>ImportClause : ImportClause
>Declaration : Declaration
name?: Identifier;
>name : Identifier
>Identifier : Identifier
namedBindings?: NamespaceImport | NamedImports;
>namedBindings : NamespaceImport | NamedImportsOrExports
>NamespaceImport : NamespaceImport
>NamedImports : NamedImportsOrExports
}
interface NamespaceImport extends Declaration {
>NamespaceImport : NamespaceImport
>Declaration : Declaration
name: Identifier;
>name : Identifier
>Identifier : Identifier
}
interface ExportDeclaration extends Statement, ModuleElement {
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>ModuleElement : ModuleElement
exportClause?: NamedExports;
>exportClause : NamedImportsOrExports
>NamedExports : NamedImportsOrExports
moduleSpecifier?: Expression;
>moduleSpecifier : Expression
>Expression : Expression
}
interface NamedImportsOrExports extends Node {
>NamedImportsOrExports : NamedImportsOrExports
>Node : Node
elements: NodeArray<ImportOrExportSpecifier>;
>elements : NodeArray<ImportOrExportSpecifier>
>NodeArray : NodeArray<T>
>ImportOrExportSpecifier : ImportOrExportSpecifier
}
type NamedImports = NamedImportsOrExports;
>NamedImports : NamedImportsOrExports
>NamedImportsOrExports : NamedImportsOrExports
type NamedExports = NamedImportsOrExports;
>NamedExports : NamedImportsOrExports
>NamedImportsOrExports : NamedImportsOrExports
interface ImportOrExportSpecifier extends Declaration {
>ImportOrExportSpecifier : ImportOrExportSpecifier
>Declaration : Declaration
propertyName?: Identifier;
>propertyName : Identifier
>Identifier : Identifier
name: Identifier;
>name : Identifier
>Identifier : Identifier
}
type ImportSpecifier = ImportOrExportSpecifier;
>ImportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
type ExportSpecifier = ImportOrExportSpecifier;
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {
>ExportAssignment : ExportAssignment
>Statement : Statement
@ -2200,9 +2322,10 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;
>hasTrailingNewLine : boolean
}
interface SourceFile extends Declaration {
interface SourceFile extends Declaration, ExportContainer {
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;
>statements : NodeArray<ModuleElement>
@ -2816,9 +2939,9 @@ declare module "typescript" {
>accessibility : SymbolAccessibility
>SymbolAccessibility : SymbolAccessibility
aliasesToMakeVisible?: ImportDeclaration[];
>aliasesToMakeVisible : ImportDeclaration[]
>ImportDeclaration : ImportDeclaration
aliasesToMakeVisible?: ImportEqualsDeclaration[];
>aliasesToMakeVisible : ImportEqualsDeclaration[]
>ImportEqualsDeclaration : ImportEqualsDeclaration
errorSymbolName?: string;
>errorSymbolName : string
@ -2837,14 +2960,16 @@ declare module "typescript" {
interface EmitResolver {
>EmitResolver : EmitResolver
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
>getLocalNameOfContainer : (container: EnumDeclaration | ModuleDeclaration) => string
>container : EnumDeclaration | ModuleDeclaration
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
>getGeneratedNameForNode : (node: EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration) => string
>node : EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration
>ModuleDeclaration : ModuleDeclaration
>EnumDeclaration : EnumDeclaration
>ImportDeclaration : ImportDeclaration
>ExportDeclaration : ExportDeclaration
getExpressionNamePrefix(node: Identifier): string;
>getExpressionNamePrefix : (node: Identifier) => string
getExpressionNameSubstitution(node: Identifier): string;
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
@ -2853,15 +2978,15 @@ declare module "typescript" {
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
>isReferencedImportDeclaration : (node: ImportDeclaration) => boolean
>node : ImportDeclaration
>ImportDeclaration : ImportDeclaration
isReferencedImportDeclaration(node: Node): boolean;
>isReferencedImportDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
>isTopLevelValueImportWithEntityName : (node: ImportDeclaration) => boolean
>node : ImportDeclaration
>ImportDeclaration : ImportDeclaration
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean
>node : ImportEqualsDeclaration
>ImportEqualsDeclaration : ImportEqualsDeclaration
getNodeCheckFlags(node: Node): NodeCheckFlags;
>getNodeCheckFlags : (node: Node) => NodeCheckFlags
@ -3190,13 +3315,20 @@ declare module "typescript" {
referenced?: boolean;
>referenced : boolean
exportAssignSymbol?: Symbol;
>exportAssignSymbol : Symbol
exportAssignmentChecked?: boolean;
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;
>unionType : UnionType
>UnionType : UnionType
resolvedExports?: SymbolTable;
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
}
interface TransientSymbol extends Symbol, SymbolLinks {
>TransientSymbol : TransientSymbol
@ -3265,8 +3397,12 @@ declare module "typescript" {
isVisible?: boolean;
>isVisible : boolean
localModuleName?: string;
>localModuleName : string
generatedName?: string;
>generatedName : string
generatedNames?: Map<string>;
>generatedNames : Map<string>
>Map : Map<T>
assignmentChecks?: Map<boolean>;
>assignmentChecks : Map<boolean>

View File

@ -191,132 +191,142 @@ declare module "typescript" {
VoidKeyword = 98,
WhileKeyword = 99,
WithKeyword = 100,
ImplementsKeyword = 101,
InterfaceKeyword = 102,
LetKeyword = 103,
PackageKeyword = 104,
PrivateKeyword = 105,
ProtectedKeyword = 106,
PublicKeyword = 107,
StaticKeyword = 108,
YieldKeyword = 109,
AnyKeyword = 110,
BooleanKeyword = 111,
ConstructorKeyword = 112,
DeclareKeyword = 113,
GetKeyword = 114,
ModuleKeyword = 115,
RequireKeyword = 116,
NumberKeyword = 117,
SetKeyword = 118,
StringKeyword = 119,
SymbolKeyword = 120,
TypeKeyword = 121,
OfKeyword = 122,
QualifiedName = 123,
ComputedPropertyName = 124,
TypeParameter = 125,
Parameter = 126,
PropertySignature = 127,
PropertyDeclaration = 128,
MethodSignature = 129,
MethodDeclaration = 130,
Constructor = 131,
GetAccessor = 132,
SetAccessor = 133,
CallSignature = 134,
ConstructSignature = 135,
IndexSignature = 136,
TypeReference = 137,
FunctionType = 138,
ConstructorType = 139,
TypeQuery = 140,
TypeLiteral = 141,
ArrayType = 142,
TupleType = 143,
UnionType = 144,
ParenthesizedType = 145,
ObjectBindingPattern = 146,
ArrayBindingPattern = 147,
BindingElement = 148,
ArrayLiteralExpression = 149,
ObjectLiteralExpression = 150,
PropertyAccessExpression = 151,
ElementAccessExpression = 152,
CallExpression = 153,
NewExpression = 154,
TaggedTemplateExpression = 155,
TypeAssertionExpression = 156,
ParenthesizedExpression = 157,
FunctionExpression = 158,
ArrowFunction = 159,
DeleteExpression = 160,
TypeOfExpression = 161,
VoidExpression = 162,
PrefixUnaryExpression = 163,
PostfixUnaryExpression = 164,
BinaryExpression = 165,
ConditionalExpression = 166,
TemplateExpression = 167,
YieldExpression = 168,
SpreadElementExpression = 169,
OmittedExpression = 170,
TemplateSpan = 171,
Block = 172,
VariableStatement = 173,
EmptyStatement = 174,
ExpressionStatement = 175,
IfStatement = 176,
DoStatement = 177,
WhileStatement = 178,
ForStatement = 179,
ForInStatement = 180,
ForOfStatement = 181,
ContinueStatement = 182,
BreakStatement = 183,
ReturnStatement = 184,
WithStatement = 185,
SwitchStatement = 186,
LabeledStatement = 187,
ThrowStatement = 188,
TryStatement = 189,
DebuggerStatement = 190,
VariableDeclaration = 191,
VariableDeclarationList = 192,
FunctionDeclaration = 193,
ClassDeclaration = 194,
InterfaceDeclaration = 195,
TypeAliasDeclaration = 196,
EnumDeclaration = 197,
ModuleDeclaration = 198,
ModuleBlock = 199,
ImportDeclaration = 200,
ExportAssignment = 201,
ExternalModuleReference = 202,
CaseClause = 203,
DefaultClause = 204,
HeritageClause = 205,
CatchClause = 206,
PropertyAssignment = 207,
ShorthandPropertyAssignment = 208,
EnumMember = 209,
SourceFile = 210,
SyntaxList = 211,
Count = 212,
AsKeyword = 101,
FromKeyword = 102,
ImplementsKeyword = 103,
InterfaceKeyword = 104,
LetKeyword = 105,
PackageKeyword = 106,
PrivateKeyword = 107,
ProtectedKeyword = 108,
PublicKeyword = 109,
StaticKeyword = 110,
YieldKeyword = 111,
AnyKeyword = 112,
BooleanKeyword = 113,
ConstructorKeyword = 114,
DeclareKeyword = 115,
GetKeyword = 116,
ModuleKeyword = 117,
RequireKeyword = 118,
NumberKeyword = 119,
SetKeyword = 120,
StringKeyword = 121,
SymbolKeyword = 122,
TypeKeyword = 123,
OfKeyword = 124,
QualifiedName = 125,
ComputedPropertyName = 126,
TypeParameter = 127,
Parameter = 128,
PropertySignature = 129,
PropertyDeclaration = 130,
MethodSignature = 131,
MethodDeclaration = 132,
Constructor = 133,
GetAccessor = 134,
SetAccessor = 135,
CallSignature = 136,
ConstructSignature = 137,
IndexSignature = 138,
TypeReference = 139,
FunctionType = 140,
ConstructorType = 141,
TypeQuery = 142,
TypeLiteral = 143,
ArrayType = 144,
TupleType = 145,
UnionType = 146,
ParenthesizedType = 147,
ObjectBindingPattern = 148,
ArrayBindingPattern = 149,
BindingElement = 150,
ArrayLiteralExpression = 151,
ObjectLiteralExpression = 152,
PropertyAccessExpression = 153,
ElementAccessExpression = 154,
CallExpression = 155,
NewExpression = 156,
TaggedTemplateExpression = 157,
TypeAssertionExpression = 158,
ParenthesizedExpression = 159,
FunctionExpression = 160,
ArrowFunction = 161,
DeleteExpression = 162,
TypeOfExpression = 163,
VoidExpression = 164,
PrefixUnaryExpression = 165,
PostfixUnaryExpression = 166,
BinaryExpression = 167,
ConditionalExpression = 168,
TemplateExpression = 169,
YieldExpression = 170,
SpreadElementExpression = 171,
OmittedExpression = 172,
TemplateSpan = 173,
Block = 174,
VariableStatement = 175,
EmptyStatement = 176,
ExpressionStatement = 177,
IfStatement = 178,
DoStatement = 179,
WhileStatement = 180,
ForStatement = 181,
ForInStatement = 182,
ForOfStatement = 183,
ContinueStatement = 184,
BreakStatement = 185,
ReturnStatement = 186,
WithStatement = 187,
SwitchStatement = 188,
LabeledStatement = 189,
ThrowStatement = 190,
TryStatement = 191,
DebuggerStatement = 192,
VariableDeclaration = 193,
VariableDeclarationList = 194,
FunctionDeclaration = 195,
ClassDeclaration = 196,
InterfaceDeclaration = 197,
TypeAliasDeclaration = 198,
EnumDeclaration = 199,
ModuleDeclaration = 200,
ModuleBlock = 201,
ImportEqualsDeclaration = 202,
ImportDeclaration = 203,
ImportClause = 204,
NamespaceImport = 205,
NamedImports = 206,
ImportSpecifier = 207,
ExportAssignment = 208,
ExportDeclaration = 209,
NamedExports = 210,
ExportSpecifier = 211,
ExternalModuleReference = 212,
CaseClause = 213,
DefaultClause = 214,
HeritageClause = 215,
CatchClause = 216,
PropertyAssignment = 217,
ShorthandPropertyAssignment = 218,
EnumMember = 219,
SourceFile = 220,
SyntaxList = 221,
Count = 222,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
LastReservedWord = 100,
FirstKeyword = 65,
LastKeyword = 122,
FirstFutureReservedWord = 101,
LastFutureReservedWord = 109,
FirstTypeNode = 137,
LastTypeNode = 145,
LastKeyword = 124,
FirstFutureReservedWord = 103,
LastFutureReservedWord = 111,
FirstTypeNode = 139,
LastTypeNode = 147,
FirstPunctuation = 14,
LastPunctuation = 63,
FirstToken = 0,
LastToken = 122,
LastToken = 124,
FirstTriviaToken = 2,
LastTriviaToken = 6,
FirstLiteralToken = 7,
@ -325,7 +335,7 @@ declare module "typescript" {
LastTemplateToken = 13,
FirstBinaryOperator = 24,
LastBinaryOperator = 63,
FirstNode = 123,
FirstNode = 125,
}
const enum NodeFlags {
Export = 1,
@ -363,13 +373,13 @@ declare module "typescript" {
kind: SyntaxKind;
flags: NodeFlags;
parserContextFlags?: ParserContextFlags;
modifiers?: ModifiersArray;
id?: number;
parent?: Node;
symbol?: Symbol;
locals?: SymbolTable;
nextContainer?: Node;
localSymbol?: Symbol;
modifiers?: ModifiersArray;
}
interface NodeArray<T> extends Array<T>, TextRange {
hasTrailingComma?: boolean;
@ -733,20 +743,49 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ModuleDeclaration extends Declaration, ModuleElement {
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
interface ModuleBlock extends Node, ModuleElement {
statements: NodeArray<ModuleElement>;
}
interface ImportDeclaration extends Declaration, ModuleElement {
interface ImportEqualsDeclaration extends Declaration, ModuleElement {
name: Identifier;
moduleReference: EntityName | ExternalModuleReference;
}
interface ExternalModuleReference extends Node {
expression?: Expression;
}
interface ImportDeclaration extends Statement, ModuleElement {
importClause?: ImportClause;
moduleSpecifier: Expression;
}
interface ImportClause extends Declaration {
name?: Identifier;
namedBindings?: NamespaceImport | NamedImports;
}
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
interface NamedImportsOrExports extends Node {
elements: NodeArray<ImportOrExportSpecifier>;
}
type NamedImports = NamedImportsOrExports;
type NamedExports = NamedImportsOrExports;
interface ImportOrExportSpecifier extends Declaration {
propertyName?: Identifier;
name: Identifier;
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
}
@ -756,7 +795,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration {
interface SourceFile extends Declaration, ExportContainer {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@ -910,7 +949,7 @@ declare module "typescript" {
}
interface SymbolVisibilityResult {
accessibility: SymbolAccessibility;
aliasesToMakeVisible?: ImportDeclaration[];
aliasesToMakeVisible?: ImportEqualsDeclaration[];
errorSymbolName?: string;
errorNode?: Node;
}
@ -918,11 +957,11 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
getExpressionNamePrefix(node: Identifier): string;
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
isReferencedImportDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
@ -1017,8 +1056,10 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignSymbol?: Symbol;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@ -1043,7 +1084,8 @@ declare module "typescript" {
enumMemberValue?: number;
isIllegalTypeReferenceInConstraint?: boolean;
isVisible?: boolean;
localModuleName?: string;
generatedName?: string;
generatedNames?: Map<string>;
assignmentChecks?: Map<boolean>;
hasReportedStatementInAmbientContext?: boolean;
importOnRightSide?: Symbol;
@ -1986,25 +2028,25 @@ function delint(sourceFile) {
delintNode(sourceFile);
function delintNode(node) {
switch (node.kind) {
case 179 /* ForStatement */:
case 180 /* ForInStatement */:
case 178 /* WhileStatement */:
case 177 /* DoStatement */:
if (node.statement.kind !== 172 /* Block */) {
case 181 /* ForStatement */:
case 182 /* ForInStatement */:
case 180 /* WhileStatement */:
case 179 /* DoStatement */:
if (node.statement.kind !== 174 /* Block */) {
report(node, "A looping statement's contents should be wrapped in a block body.");
}
break;
case 176 /* IfStatement */:
case 178 /* IfStatement */:
var ifStatement = node;
if (ifStatement.thenStatement.kind !== 172 /* Block */) {
if (ifStatement.thenStatement.kind !== 174 /* Block */) {
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
}
if (ifStatement.elseStatement &&
ifStatement.elseStatement.kind !== 172 /* Block */ && ifStatement.elseStatement.kind !== 176 /* IfStatement */) {
ifStatement.elseStatement.kind !== 174 /* Block */ && ifStatement.elseStatement.kind !== 178 /* IfStatement */) {
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
}
break;
case 165 /* BinaryExpression */:
case 167 /* BinaryExpression */:
var op = node.operatorToken.kind;
if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) {
report(node, "Use '===' and '!=='.");

View File

@ -644,340 +644,370 @@ declare module "typescript" {
WithKeyword = 100,
>WithKeyword : SyntaxKind
ImplementsKeyword = 101,
AsKeyword = 101,
>AsKeyword : SyntaxKind
FromKeyword = 102,
>FromKeyword : SyntaxKind
ImplementsKeyword = 103,
>ImplementsKeyword : SyntaxKind
InterfaceKeyword = 102,
InterfaceKeyword = 104,
>InterfaceKeyword : SyntaxKind
LetKeyword = 103,
LetKeyword = 105,
>LetKeyword : SyntaxKind
PackageKeyword = 104,
PackageKeyword = 106,
>PackageKeyword : SyntaxKind
PrivateKeyword = 105,
PrivateKeyword = 107,
>PrivateKeyword : SyntaxKind
ProtectedKeyword = 106,
ProtectedKeyword = 108,
>ProtectedKeyword : SyntaxKind
PublicKeyword = 107,
PublicKeyword = 109,
>PublicKeyword : SyntaxKind
StaticKeyword = 108,
StaticKeyword = 110,
>StaticKeyword : SyntaxKind
YieldKeyword = 109,
YieldKeyword = 111,
>YieldKeyword : SyntaxKind
AnyKeyword = 110,
AnyKeyword = 112,
>AnyKeyword : SyntaxKind
BooleanKeyword = 111,
BooleanKeyword = 113,
>BooleanKeyword : SyntaxKind
ConstructorKeyword = 112,
ConstructorKeyword = 114,
>ConstructorKeyword : SyntaxKind
DeclareKeyword = 113,
DeclareKeyword = 115,
>DeclareKeyword : SyntaxKind
GetKeyword = 114,
GetKeyword = 116,
>GetKeyword : SyntaxKind
ModuleKeyword = 115,
ModuleKeyword = 117,
>ModuleKeyword : SyntaxKind
RequireKeyword = 116,
RequireKeyword = 118,
>RequireKeyword : SyntaxKind
NumberKeyword = 117,
NumberKeyword = 119,
>NumberKeyword : SyntaxKind
SetKeyword = 118,
SetKeyword = 120,
>SetKeyword : SyntaxKind
StringKeyword = 119,
StringKeyword = 121,
>StringKeyword : SyntaxKind
SymbolKeyword = 120,
SymbolKeyword = 122,
>SymbolKeyword : SyntaxKind
TypeKeyword = 121,
TypeKeyword = 123,
>TypeKeyword : SyntaxKind
OfKeyword = 122,
OfKeyword = 124,
>OfKeyword : SyntaxKind
QualifiedName = 123,
QualifiedName = 125,
>QualifiedName : SyntaxKind
ComputedPropertyName = 124,
ComputedPropertyName = 126,
>ComputedPropertyName : SyntaxKind
TypeParameter = 125,
TypeParameter = 127,
>TypeParameter : SyntaxKind
Parameter = 126,
Parameter = 128,
>Parameter : SyntaxKind
PropertySignature = 127,
PropertySignature = 129,
>PropertySignature : SyntaxKind
PropertyDeclaration = 128,
PropertyDeclaration = 130,
>PropertyDeclaration : SyntaxKind
MethodSignature = 129,
MethodSignature = 131,
>MethodSignature : SyntaxKind
MethodDeclaration = 130,
MethodDeclaration = 132,
>MethodDeclaration : SyntaxKind
Constructor = 131,
Constructor = 133,
>Constructor : SyntaxKind
GetAccessor = 132,
GetAccessor = 134,
>GetAccessor : SyntaxKind
SetAccessor = 133,
SetAccessor = 135,
>SetAccessor : SyntaxKind
CallSignature = 134,
CallSignature = 136,
>CallSignature : SyntaxKind
ConstructSignature = 135,
ConstructSignature = 137,
>ConstructSignature : SyntaxKind
IndexSignature = 136,
IndexSignature = 138,
>IndexSignature : SyntaxKind
TypeReference = 137,
TypeReference = 139,
>TypeReference : SyntaxKind
FunctionType = 138,
FunctionType = 140,
>FunctionType : SyntaxKind
ConstructorType = 139,
ConstructorType = 141,
>ConstructorType : SyntaxKind
TypeQuery = 140,
TypeQuery = 142,
>TypeQuery : SyntaxKind
TypeLiteral = 141,
TypeLiteral = 143,
>TypeLiteral : SyntaxKind
ArrayType = 142,
ArrayType = 144,
>ArrayType : SyntaxKind
TupleType = 143,
TupleType = 145,
>TupleType : SyntaxKind
UnionType = 144,
UnionType = 146,
>UnionType : SyntaxKind
ParenthesizedType = 145,
ParenthesizedType = 147,
>ParenthesizedType : SyntaxKind
ObjectBindingPattern = 146,
ObjectBindingPattern = 148,
>ObjectBindingPattern : SyntaxKind
ArrayBindingPattern = 147,
ArrayBindingPattern = 149,
>ArrayBindingPattern : SyntaxKind
BindingElement = 148,
BindingElement = 150,
>BindingElement : SyntaxKind
ArrayLiteralExpression = 149,
ArrayLiteralExpression = 151,
>ArrayLiteralExpression : SyntaxKind
ObjectLiteralExpression = 150,
ObjectLiteralExpression = 152,
>ObjectLiteralExpression : SyntaxKind
PropertyAccessExpression = 151,
PropertyAccessExpression = 153,
>PropertyAccessExpression : SyntaxKind
ElementAccessExpression = 152,
ElementAccessExpression = 154,
>ElementAccessExpression : SyntaxKind
CallExpression = 153,
CallExpression = 155,
>CallExpression : SyntaxKind
NewExpression = 154,
NewExpression = 156,
>NewExpression : SyntaxKind
TaggedTemplateExpression = 155,
TaggedTemplateExpression = 157,
>TaggedTemplateExpression : SyntaxKind
TypeAssertionExpression = 156,
TypeAssertionExpression = 158,
>TypeAssertionExpression : SyntaxKind
ParenthesizedExpression = 157,
ParenthesizedExpression = 159,
>ParenthesizedExpression : SyntaxKind
FunctionExpression = 158,
FunctionExpression = 160,
>FunctionExpression : SyntaxKind
ArrowFunction = 159,
ArrowFunction = 161,
>ArrowFunction : SyntaxKind
DeleteExpression = 160,
DeleteExpression = 162,
>DeleteExpression : SyntaxKind
TypeOfExpression = 161,
TypeOfExpression = 163,
>TypeOfExpression : SyntaxKind
VoidExpression = 162,
VoidExpression = 164,
>VoidExpression : SyntaxKind
PrefixUnaryExpression = 163,
PrefixUnaryExpression = 165,
>PrefixUnaryExpression : SyntaxKind
PostfixUnaryExpression = 164,
PostfixUnaryExpression = 166,
>PostfixUnaryExpression : SyntaxKind
BinaryExpression = 165,
BinaryExpression = 167,
>BinaryExpression : SyntaxKind
ConditionalExpression = 166,
ConditionalExpression = 168,
>ConditionalExpression : SyntaxKind
TemplateExpression = 167,
TemplateExpression = 169,
>TemplateExpression : SyntaxKind
YieldExpression = 168,
YieldExpression = 170,
>YieldExpression : SyntaxKind
SpreadElementExpression = 169,
SpreadElementExpression = 171,
>SpreadElementExpression : SyntaxKind
OmittedExpression = 170,
OmittedExpression = 172,
>OmittedExpression : SyntaxKind
TemplateSpan = 171,
TemplateSpan = 173,
>TemplateSpan : SyntaxKind
Block = 172,
Block = 174,
>Block : SyntaxKind
VariableStatement = 173,
VariableStatement = 175,
>VariableStatement : SyntaxKind
EmptyStatement = 174,
EmptyStatement = 176,
>EmptyStatement : SyntaxKind
ExpressionStatement = 175,
ExpressionStatement = 177,
>ExpressionStatement : SyntaxKind
IfStatement = 176,
IfStatement = 178,
>IfStatement : SyntaxKind
DoStatement = 177,
DoStatement = 179,
>DoStatement : SyntaxKind
WhileStatement = 178,
WhileStatement = 180,
>WhileStatement : SyntaxKind
ForStatement = 179,
ForStatement = 181,
>ForStatement : SyntaxKind
ForInStatement = 180,
ForInStatement = 182,
>ForInStatement : SyntaxKind
ForOfStatement = 181,
ForOfStatement = 183,
>ForOfStatement : SyntaxKind
ContinueStatement = 182,
ContinueStatement = 184,
>ContinueStatement : SyntaxKind
BreakStatement = 183,
BreakStatement = 185,
>BreakStatement : SyntaxKind
ReturnStatement = 184,
ReturnStatement = 186,
>ReturnStatement : SyntaxKind
WithStatement = 185,
WithStatement = 187,
>WithStatement : SyntaxKind
SwitchStatement = 186,
SwitchStatement = 188,
>SwitchStatement : SyntaxKind
LabeledStatement = 187,
LabeledStatement = 189,
>LabeledStatement : SyntaxKind
ThrowStatement = 188,
ThrowStatement = 190,
>ThrowStatement : SyntaxKind
TryStatement = 189,
TryStatement = 191,
>TryStatement : SyntaxKind
DebuggerStatement = 190,
DebuggerStatement = 192,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 191,
VariableDeclaration = 193,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 192,
VariableDeclarationList = 194,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 193,
FunctionDeclaration = 195,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 194,
ClassDeclaration = 196,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 195,
InterfaceDeclaration = 197,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 196,
TypeAliasDeclaration = 198,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 197,
EnumDeclaration = 199,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 198,
ModuleDeclaration = 200,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 199,
ModuleBlock = 201,
>ModuleBlock : SyntaxKind
ImportDeclaration = 200,
ImportEqualsDeclaration = 202,
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 203,
>ImportDeclaration : SyntaxKind
ExportAssignment = 201,
ImportClause = 204,
>ImportClause : SyntaxKind
NamespaceImport = 205,
>NamespaceImport : SyntaxKind
NamedImports = 206,
>NamedImports : SyntaxKind
ImportSpecifier = 207,
>ImportSpecifier : SyntaxKind
ExportAssignment = 208,
>ExportAssignment : SyntaxKind
ExternalModuleReference = 202,
ExportDeclaration = 209,
>ExportDeclaration : SyntaxKind
NamedExports = 210,
>NamedExports : SyntaxKind
ExportSpecifier = 211,
>ExportSpecifier : SyntaxKind
ExternalModuleReference = 212,
>ExternalModuleReference : SyntaxKind
CaseClause = 203,
CaseClause = 213,
>CaseClause : SyntaxKind
DefaultClause = 204,
DefaultClause = 214,
>DefaultClause : SyntaxKind
HeritageClause = 205,
HeritageClause = 215,
>HeritageClause : SyntaxKind
CatchClause = 206,
CatchClause = 216,
>CatchClause : SyntaxKind
PropertyAssignment = 207,
PropertyAssignment = 217,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 208,
ShorthandPropertyAssignment = 218,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 209,
EnumMember = 219,
>EnumMember : SyntaxKind
SourceFile = 210,
SourceFile = 220,
>SourceFile : SyntaxKind
SyntaxList = 211,
SyntaxList = 221,
>SyntaxList : SyntaxKind
Count = 212,
Count = 222,
>Count : SyntaxKind
FirstAssignment = 52,
@ -995,19 +1025,19 @@ declare module "typescript" {
FirstKeyword = 65,
>FirstKeyword : SyntaxKind
LastKeyword = 122,
LastKeyword = 124,
>LastKeyword : SyntaxKind
FirstFutureReservedWord = 101,
FirstFutureReservedWord = 103,
>FirstFutureReservedWord : SyntaxKind
LastFutureReservedWord = 109,
LastFutureReservedWord = 111,
>LastFutureReservedWord : SyntaxKind
FirstTypeNode = 137,
FirstTypeNode = 139,
>FirstTypeNode : SyntaxKind
LastTypeNode = 145,
LastTypeNode = 147,
>LastTypeNode : SyntaxKind
FirstPunctuation = 14,
@ -1019,7 +1049,7 @@ declare module "typescript" {
FirstToken = 0,
>FirstToken : SyntaxKind
LastToken = 122,
LastToken = 124,
>LastToken : SyntaxKind
FirstTriviaToken = 2,
@ -1046,7 +1076,7 @@ declare module "typescript" {
LastBinaryOperator = 63,
>LastBinaryOperator : SyntaxKind
FirstNode = 123,
FirstNode = 125,
>FirstNode : SyntaxKind
}
const enum NodeFlags {
@ -1152,6 +1182,10 @@ declare module "typescript" {
>parserContextFlags : ParserContextFlags
>ParserContextFlags : ParserContextFlags
modifiers?: ModifiersArray;
>modifiers : ModifiersArray
>ModifiersArray : ModifiersArray
id?: number;
>id : number
@ -1174,10 +1208,6 @@ declare module "typescript" {
localSymbol?: Symbol;
>localSymbol : Symbol
>Symbol : Symbol
modifiers?: ModifiersArray;
>modifiers : ModifiersArray
>ModifiersArray : ModifiersArray
}
interface NodeArray<T> extends Array<T>, TextRange {
>NodeArray : NodeArray<T>
@ -2276,10 +2306,18 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}
interface ModuleDeclaration extends Declaration, ModuleElement {
interface ExportContainer {
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;
>name : Identifier | LiteralExpression
@ -2301,8 +2339,8 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>ModuleElement : ModuleElement
}
interface ImportDeclaration extends Declaration, ModuleElement {
>ImportDeclaration : ImportDeclaration
interface ImportEqualsDeclaration extends Declaration, ModuleElement {
>ImportEqualsDeclaration : ImportEqualsDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
@ -2323,6 +2361,90 @@ declare module "typescript" {
>expression : Expression
>Expression : Expression
}
interface ImportDeclaration extends Statement, ModuleElement {
>ImportDeclaration : ImportDeclaration
>Statement : Statement
>ModuleElement : ModuleElement
importClause?: ImportClause;
>importClause : ImportClause
>ImportClause : ImportClause
moduleSpecifier: Expression;
>moduleSpecifier : Expression
>Expression : Expression
}
interface ImportClause extends Declaration {
>ImportClause : ImportClause
>Declaration : Declaration
name?: Identifier;
>name : Identifier
>Identifier : Identifier
namedBindings?: NamespaceImport | NamedImports;
>namedBindings : NamespaceImport | NamedImportsOrExports
>NamespaceImport : NamespaceImport
>NamedImports : NamedImportsOrExports
}
interface NamespaceImport extends Declaration {
>NamespaceImport : NamespaceImport
>Declaration : Declaration
name: Identifier;
>name : Identifier
>Identifier : Identifier
}
interface ExportDeclaration extends Statement, ModuleElement {
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>ModuleElement : ModuleElement
exportClause?: NamedExports;
>exportClause : NamedImportsOrExports
>NamedExports : NamedImportsOrExports
moduleSpecifier?: Expression;
>moduleSpecifier : Expression
>Expression : Expression
}
interface NamedImportsOrExports extends Node {
>NamedImportsOrExports : NamedImportsOrExports
>Node : Node
elements: NodeArray<ImportOrExportSpecifier>;
>elements : NodeArray<ImportOrExportSpecifier>
>NodeArray : NodeArray<T>
>ImportOrExportSpecifier : ImportOrExportSpecifier
}
type NamedImports = NamedImportsOrExports;
>NamedImports : NamedImportsOrExports
>NamedImportsOrExports : NamedImportsOrExports
type NamedExports = NamedImportsOrExports;
>NamedExports : NamedImportsOrExports
>NamedImportsOrExports : NamedImportsOrExports
interface ImportOrExportSpecifier extends Declaration {
>ImportOrExportSpecifier : ImportOrExportSpecifier
>Declaration : Declaration
propertyName?: Identifier;
>propertyName : Identifier
>Identifier : Identifier
name: Identifier;
>name : Identifier
>Identifier : Identifier
}
type ImportSpecifier = ImportOrExportSpecifier;
>ImportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
type ExportSpecifier = ImportOrExportSpecifier;
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {
>ExportAssignment : ExportAssignment
>Statement : Statement
@ -2346,9 +2468,10 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;
>hasTrailingNewLine : boolean
}
interface SourceFile extends Declaration {
interface SourceFile extends Declaration, ExportContainer {
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;
>statements : NodeArray<ModuleElement>
@ -2962,9 +3085,9 @@ declare module "typescript" {
>accessibility : SymbolAccessibility
>SymbolAccessibility : SymbolAccessibility
aliasesToMakeVisible?: ImportDeclaration[];
>aliasesToMakeVisible : ImportDeclaration[]
>ImportDeclaration : ImportDeclaration
aliasesToMakeVisible?: ImportEqualsDeclaration[];
>aliasesToMakeVisible : ImportEqualsDeclaration[]
>ImportEqualsDeclaration : ImportEqualsDeclaration
errorSymbolName?: string;
>errorSymbolName : string
@ -2983,14 +3106,16 @@ declare module "typescript" {
interface EmitResolver {
>EmitResolver : EmitResolver
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
>getLocalNameOfContainer : (container: EnumDeclaration | ModuleDeclaration) => string
>container : EnumDeclaration | ModuleDeclaration
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
>getGeneratedNameForNode : (node: EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration) => string
>node : EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration
>ModuleDeclaration : ModuleDeclaration
>EnumDeclaration : EnumDeclaration
>ImportDeclaration : ImportDeclaration
>ExportDeclaration : ExportDeclaration
getExpressionNamePrefix(node: Identifier): string;
>getExpressionNamePrefix : (node: Identifier) => string
getExpressionNameSubstitution(node: Identifier): string;
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
@ -2999,15 +3124,15 @@ declare module "typescript" {
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
>isReferencedImportDeclaration : (node: ImportDeclaration) => boolean
>node : ImportDeclaration
>ImportDeclaration : ImportDeclaration
isReferencedImportDeclaration(node: Node): boolean;
>isReferencedImportDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
>isTopLevelValueImportWithEntityName : (node: ImportDeclaration) => boolean
>node : ImportDeclaration
>ImportDeclaration : ImportDeclaration
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean
>node : ImportEqualsDeclaration
>ImportEqualsDeclaration : ImportEqualsDeclaration
getNodeCheckFlags(node: Node): NodeCheckFlags;
>getNodeCheckFlags : (node: Node) => NodeCheckFlags
@ -3336,13 +3461,20 @@ declare module "typescript" {
referenced?: boolean;
>referenced : boolean
exportAssignSymbol?: Symbol;
>exportAssignSymbol : Symbol
exportAssignmentChecked?: boolean;
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;
>unionType : UnionType
>UnionType : UnionType
resolvedExports?: SymbolTable;
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
}
interface TransientSymbol extends Symbol, SymbolLinks {
>TransientSymbol : TransientSymbol
@ -3411,8 +3543,12 @@ declare module "typescript" {
isVisible?: boolean;
>isVisible : boolean
localModuleName?: string;
>localModuleName : string
generatedName?: string;
>generatedName : string
generatedNames?: Map<string>;
>generatedNames : Map<string>
>Map : Map<T>
assignmentChecks?: Map<boolean>;
>assignmentChecks : Map<boolean>

View File

@ -192,132 +192,142 @@ declare module "typescript" {
VoidKeyword = 98,
WhileKeyword = 99,
WithKeyword = 100,
ImplementsKeyword = 101,
InterfaceKeyword = 102,
LetKeyword = 103,
PackageKeyword = 104,
PrivateKeyword = 105,
ProtectedKeyword = 106,
PublicKeyword = 107,
StaticKeyword = 108,
YieldKeyword = 109,
AnyKeyword = 110,
BooleanKeyword = 111,
ConstructorKeyword = 112,
DeclareKeyword = 113,
GetKeyword = 114,
ModuleKeyword = 115,
RequireKeyword = 116,
NumberKeyword = 117,
SetKeyword = 118,
StringKeyword = 119,
SymbolKeyword = 120,
TypeKeyword = 121,
OfKeyword = 122,
QualifiedName = 123,
ComputedPropertyName = 124,
TypeParameter = 125,
Parameter = 126,
PropertySignature = 127,
PropertyDeclaration = 128,
MethodSignature = 129,
MethodDeclaration = 130,
Constructor = 131,
GetAccessor = 132,
SetAccessor = 133,
CallSignature = 134,
ConstructSignature = 135,
IndexSignature = 136,
TypeReference = 137,
FunctionType = 138,
ConstructorType = 139,
TypeQuery = 140,
TypeLiteral = 141,
ArrayType = 142,
TupleType = 143,
UnionType = 144,
ParenthesizedType = 145,
ObjectBindingPattern = 146,
ArrayBindingPattern = 147,
BindingElement = 148,
ArrayLiteralExpression = 149,
ObjectLiteralExpression = 150,
PropertyAccessExpression = 151,
ElementAccessExpression = 152,
CallExpression = 153,
NewExpression = 154,
TaggedTemplateExpression = 155,
TypeAssertionExpression = 156,
ParenthesizedExpression = 157,
FunctionExpression = 158,
ArrowFunction = 159,
DeleteExpression = 160,
TypeOfExpression = 161,
VoidExpression = 162,
PrefixUnaryExpression = 163,
PostfixUnaryExpression = 164,
BinaryExpression = 165,
ConditionalExpression = 166,
TemplateExpression = 167,
YieldExpression = 168,
SpreadElementExpression = 169,
OmittedExpression = 170,
TemplateSpan = 171,
Block = 172,
VariableStatement = 173,
EmptyStatement = 174,
ExpressionStatement = 175,
IfStatement = 176,
DoStatement = 177,
WhileStatement = 178,
ForStatement = 179,
ForInStatement = 180,
ForOfStatement = 181,
ContinueStatement = 182,
BreakStatement = 183,
ReturnStatement = 184,
WithStatement = 185,
SwitchStatement = 186,
LabeledStatement = 187,
ThrowStatement = 188,
TryStatement = 189,
DebuggerStatement = 190,
VariableDeclaration = 191,
VariableDeclarationList = 192,
FunctionDeclaration = 193,
ClassDeclaration = 194,
InterfaceDeclaration = 195,
TypeAliasDeclaration = 196,
EnumDeclaration = 197,
ModuleDeclaration = 198,
ModuleBlock = 199,
ImportDeclaration = 200,
ExportAssignment = 201,
ExternalModuleReference = 202,
CaseClause = 203,
DefaultClause = 204,
HeritageClause = 205,
CatchClause = 206,
PropertyAssignment = 207,
ShorthandPropertyAssignment = 208,
EnumMember = 209,
SourceFile = 210,
SyntaxList = 211,
Count = 212,
AsKeyword = 101,
FromKeyword = 102,
ImplementsKeyword = 103,
InterfaceKeyword = 104,
LetKeyword = 105,
PackageKeyword = 106,
PrivateKeyword = 107,
ProtectedKeyword = 108,
PublicKeyword = 109,
StaticKeyword = 110,
YieldKeyword = 111,
AnyKeyword = 112,
BooleanKeyword = 113,
ConstructorKeyword = 114,
DeclareKeyword = 115,
GetKeyword = 116,
ModuleKeyword = 117,
RequireKeyword = 118,
NumberKeyword = 119,
SetKeyword = 120,
StringKeyword = 121,
SymbolKeyword = 122,
TypeKeyword = 123,
OfKeyword = 124,
QualifiedName = 125,
ComputedPropertyName = 126,
TypeParameter = 127,
Parameter = 128,
PropertySignature = 129,
PropertyDeclaration = 130,
MethodSignature = 131,
MethodDeclaration = 132,
Constructor = 133,
GetAccessor = 134,
SetAccessor = 135,
CallSignature = 136,
ConstructSignature = 137,
IndexSignature = 138,
TypeReference = 139,
FunctionType = 140,
ConstructorType = 141,
TypeQuery = 142,
TypeLiteral = 143,
ArrayType = 144,
TupleType = 145,
UnionType = 146,
ParenthesizedType = 147,
ObjectBindingPattern = 148,
ArrayBindingPattern = 149,
BindingElement = 150,
ArrayLiteralExpression = 151,
ObjectLiteralExpression = 152,
PropertyAccessExpression = 153,
ElementAccessExpression = 154,
CallExpression = 155,
NewExpression = 156,
TaggedTemplateExpression = 157,
TypeAssertionExpression = 158,
ParenthesizedExpression = 159,
FunctionExpression = 160,
ArrowFunction = 161,
DeleteExpression = 162,
TypeOfExpression = 163,
VoidExpression = 164,
PrefixUnaryExpression = 165,
PostfixUnaryExpression = 166,
BinaryExpression = 167,
ConditionalExpression = 168,
TemplateExpression = 169,
YieldExpression = 170,
SpreadElementExpression = 171,
OmittedExpression = 172,
TemplateSpan = 173,
Block = 174,
VariableStatement = 175,
EmptyStatement = 176,
ExpressionStatement = 177,
IfStatement = 178,
DoStatement = 179,
WhileStatement = 180,
ForStatement = 181,
ForInStatement = 182,
ForOfStatement = 183,
ContinueStatement = 184,
BreakStatement = 185,
ReturnStatement = 186,
WithStatement = 187,
SwitchStatement = 188,
LabeledStatement = 189,
ThrowStatement = 190,
TryStatement = 191,
DebuggerStatement = 192,
VariableDeclaration = 193,
VariableDeclarationList = 194,
FunctionDeclaration = 195,
ClassDeclaration = 196,
InterfaceDeclaration = 197,
TypeAliasDeclaration = 198,
EnumDeclaration = 199,
ModuleDeclaration = 200,
ModuleBlock = 201,
ImportEqualsDeclaration = 202,
ImportDeclaration = 203,
ImportClause = 204,
NamespaceImport = 205,
NamedImports = 206,
ImportSpecifier = 207,
ExportAssignment = 208,
ExportDeclaration = 209,
NamedExports = 210,
ExportSpecifier = 211,
ExternalModuleReference = 212,
CaseClause = 213,
DefaultClause = 214,
HeritageClause = 215,
CatchClause = 216,
PropertyAssignment = 217,
ShorthandPropertyAssignment = 218,
EnumMember = 219,
SourceFile = 220,
SyntaxList = 221,
Count = 222,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
LastReservedWord = 100,
FirstKeyword = 65,
LastKeyword = 122,
FirstFutureReservedWord = 101,
LastFutureReservedWord = 109,
FirstTypeNode = 137,
LastTypeNode = 145,
LastKeyword = 124,
FirstFutureReservedWord = 103,
LastFutureReservedWord = 111,
FirstTypeNode = 139,
LastTypeNode = 147,
FirstPunctuation = 14,
LastPunctuation = 63,
FirstToken = 0,
LastToken = 122,
LastToken = 124,
FirstTriviaToken = 2,
LastTriviaToken = 6,
FirstLiteralToken = 7,
@ -326,7 +336,7 @@ declare module "typescript" {
LastTemplateToken = 13,
FirstBinaryOperator = 24,
LastBinaryOperator = 63,
FirstNode = 123,
FirstNode = 125,
}
const enum NodeFlags {
Export = 1,
@ -364,13 +374,13 @@ declare module "typescript" {
kind: SyntaxKind;
flags: NodeFlags;
parserContextFlags?: ParserContextFlags;
modifiers?: ModifiersArray;
id?: number;
parent?: Node;
symbol?: Symbol;
locals?: SymbolTable;
nextContainer?: Node;
localSymbol?: Symbol;
modifiers?: ModifiersArray;
}
interface NodeArray<T> extends Array<T>, TextRange {
hasTrailingComma?: boolean;
@ -734,20 +744,49 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ModuleDeclaration extends Declaration, ModuleElement {
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
interface ModuleBlock extends Node, ModuleElement {
statements: NodeArray<ModuleElement>;
}
interface ImportDeclaration extends Declaration, ModuleElement {
interface ImportEqualsDeclaration extends Declaration, ModuleElement {
name: Identifier;
moduleReference: EntityName | ExternalModuleReference;
}
interface ExternalModuleReference extends Node {
expression?: Expression;
}
interface ImportDeclaration extends Statement, ModuleElement {
importClause?: ImportClause;
moduleSpecifier: Expression;
}
interface ImportClause extends Declaration {
name?: Identifier;
namedBindings?: NamespaceImport | NamedImports;
}
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
interface NamedImportsOrExports extends Node {
elements: NodeArray<ImportOrExportSpecifier>;
}
type NamedImports = NamedImportsOrExports;
type NamedExports = NamedImportsOrExports;
interface ImportOrExportSpecifier extends Declaration {
propertyName?: Identifier;
name: Identifier;
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
}
@ -757,7 +796,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration {
interface SourceFile extends Declaration, ExportContainer {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@ -911,7 +950,7 @@ declare module "typescript" {
}
interface SymbolVisibilityResult {
accessibility: SymbolAccessibility;
aliasesToMakeVisible?: ImportDeclaration[];
aliasesToMakeVisible?: ImportEqualsDeclaration[];
errorSymbolName?: string;
errorNode?: Node;
}
@ -919,11 +958,11 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
getExpressionNamePrefix(node: Identifier): string;
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
isReferencedImportDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
@ -1018,8 +1057,10 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignSymbol?: Symbol;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@ -1044,7 +1085,8 @@ declare module "typescript" {
enumMemberValue?: number;
isIllegalTypeReferenceInConstraint?: boolean;
isVisible?: boolean;
localModuleName?: string;
generatedName?: string;
generatedNames?: Map<string>;
assignmentChecks?: Map<boolean>;
hasReportedStatementInAmbientContext?: boolean;
importOnRightSide?: Symbol;

View File

@ -594,340 +594,370 @@ declare module "typescript" {
WithKeyword = 100,
>WithKeyword : SyntaxKind
ImplementsKeyword = 101,
AsKeyword = 101,
>AsKeyword : SyntaxKind
FromKeyword = 102,
>FromKeyword : SyntaxKind
ImplementsKeyword = 103,
>ImplementsKeyword : SyntaxKind
InterfaceKeyword = 102,
InterfaceKeyword = 104,
>InterfaceKeyword : SyntaxKind
LetKeyword = 103,
LetKeyword = 105,
>LetKeyword : SyntaxKind
PackageKeyword = 104,
PackageKeyword = 106,
>PackageKeyword : SyntaxKind
PrivateKeyword = 105,
PrivateKeyword = 107,
>PrivateKeyword : SyntaxKind
ProtectedKeyword = 106,
ProtectedKeyword = 108,
>ProtectedKeyword : SyntaxKind
PublicKeyword = 107,
PublicKeyword = 109,
>PublicKeyword : SyntaxKind
StaticKeyword = 108,
StaticKeyword = 110,
>StaticKeyword : SyntaxKind
YieldKeyword = 109,
YieldKeyword = 111,
>YieldKeyword : SyntaxKind
AnyKeyword = 110,
AnyKeyword = 112,
>AnyKeyword : SyntaxKind
BooleanKeyword = 111,
BooleanKeyword = 113,
>BooleanKeyword : SyntaxKind
ConstructorKeyword = 112,
ConstructorKeyword = 114,
>ConstructorKeyword : SyntaxKind
DeclareKeyword = 113,
DeclareKeyword = 115,
>DeclareKeyword : SyntaxKind
GetKeyword = 114,
GetKeyword = 116,
>GetKeyword : SyntaxKind
ModuleKeyword = 115,
ModuleKeyword = 117,
>ModuleKeyword : SyntaxKind
RequireKeyword = 116,
RequireKeyword = 118,
>RequireKeyword : SyntaxKind
NumberKeyword = 117,
NumberKeyword = 119,
>NumberKeyword : SyntaxKind
SetKeyword = 118,
SetKeyword = 120,
>SetKeyword : SyntaxKind
StringKeyword = 119,
StringKeyword = 121,
>StringKeyword : SyntaxKind
SymbolKeyword = 120,
SymbolKeyword = 122,
>SymbolKeyword : SyntaxKind
TypeKeyword = 121,
TypeKeyword = 123,
>TypeKeyword : SyntaxKind
OfKeyword = 122,
OfKeyword = 124,
>OfKeyword : SyntaxKind
QualifiedName = 123,
QualifiedName = 125,
>QualifiedName : SyntaxKind
ComputedPropertyName = 124,
ComputedPropertyName = 126,
>ComputedPropertyName : SyntaxKind
TypeParameter = 125,
TypeParameter = 127,
>TypeParameter : SyntaxKind
Parameter = 126,
Parameter = 128,
>Parameter : SyntaxKind
PropertySignature = 127,
PropertySignature = 129,
>PropertySignature : SyntaxKind
PropertyDeclaration = 128,
PropertyDeclaration = 130,
>PropertyDeclaration : SyntaxKind
MethodSignature = 129,
MethodSignature = 131,
>MethodSignature : SyntaxKind
MethodDeclaration = 130,
MethodDeclaration = 132,
>MethodDeclaration : SyntaxKind
Constructor = 131,
Constructor = 133,
>Constructor : SyntaxKind
GetAccessor = 132,
GetAccessor = 134,
>GetAccessor : SyntaxKind
SetAccessor = 133,
SetAccessor = 135,
>SetAccessor : SyntaxKind
CallSignature = 134,
CallSignature = 136,
>CallSignature : SyntaxKind
ConstructSignature = 135,
ConstructSignature = 137,
>ConstructSignature : SyntaxKind
IndexSignature = 136,
IndexSignature = 138,
>IndexSignature : SyntaxKind
TypeReference = 137,
TypeReference = 139,
>TypeReference : SyntaxKind
FunctionType = 138,
FunctionType = 140,
>FunctionType : SyntaxKind
ConstructorType = 139,
ConstructorType = 141,
>ConstructorType : SyntaxKind
TypeQuery = 140,
TypeQuery = 142,
>TypeQuery : SyntaxKind
TypeLiteral = 141,
TypeLiteral = 143,
>TypeLiteral : SyntaxKind
ArrayType = 142,
ArrayType = 144,
>ArrayType : SyntaxKind
TupleType = 143,
TupleType = 145,
>TupleType : SyntaxKind
UnionType = 144,
UnionType = 146,
>UnionType : SyntaxKind
ParenthesizedType = 145,
ParenthesizedType = 147,
>ParenthesizedType : SyntaxKind
ObjectBindingPattern = 146,
ObjectBindingPattern = 148,
>ObjectBindingPattern : SyntaxKind
ArrayBindingPattern = 147,
ArrayBindingPattern = 149,
>ArrayBindingPattern : SyntaxKind
BindingElement = 148,
BindingElement = 150,
>BindingElement : SyntaxKind
ArrayLiteralExpression = 149,
ArrayLiteralExpression = 151,
>ArrayLiteralExpression : SyntaxKind
ObjectLiteralExpression = 150,
ObjectLiteralExpression = 152,
>ObjectLiteralExpression : SyntaxKind
PropertyAccessExpression = 151,
PropertyAccessExpression = 153,
>PropertyAccessExpression : SyntaxKind
ElementAccessExpression = 152,
ElementAccessExpression = 154,
>ElementAccessExpression : SyntaxKind
CallExpression = 153,
CallExpression = 155,
>CallExpression : SyntaxKind
NewExpression = 154,
NewExpression = 156,
>NewExpression : SyntaxKind
TaggedTemplateExpression = 155,
TaggedTemplateExpression = 157,
>TaggedTemplateExpression : SyntaxKind
TypeAssertionExpression = 156,
TypeAssertionExpression = 158,
>TypeAssertionExpression : SyntaxKind
ParenthesizedExpression = 157,
ParenthesizedExpression = 159,
>ParenthesizedExpression : SyntaxKind
FunctionExpression = 158,
FunctionExpression = 160,
>FunctionExpression : SyntaxKind
ArrowFunction = 159,
ArrowFunction = 161,
>ArrowFunction : SyntaxKind
DeleteExpression = 160,
DeleteExpression = 162,
>DeleteExpression : SyntaxKind
TypeOfExpression = 161,
TypeOfExpression = 163,
>TypeOfExpression : SyntaxKind
VoidExpression = 162,
VoidExpression = 164,
>VoidExpression : SyntaxKind
PrefixUnaryExpression = 163,
PrefixUnaryExpression = 165,
>PrefixUnaryExpression : SyntaxKind
PostfixUnaryExpression = 164,
PostfixUnaryExpression = 166,
>PostfixUnaryExpression : SyntaxKind
BinaryExpression = 165,
BinaryExpression = 167,
>BinaryExpression : SyntaxKind
ConditionalExpression = 166,
ConditionalExpression = 168,
>ConditionalExpression : SyntaxKind
TemplateExpression = 167,
TemplateExpression = 169,
>TemplateExpression : SyntaxKind
YieldExpression = 168,
YieldExpression = 170,
>YieldExpression : SyntaxKind
SpreadElementExpression = 169,
SpreadElementExpression = 171,
>SpreadElementExpression : SyntaxKind
OmittedExpression = 170,
OmittedExpression = 172,
>OmittedExpression : SyntaxKind
TemplateSpan = 171,
TemplateSpan = 173,
>TemplateSpan : SyntaxKind
Block = 172,
Block = 174,
>Block : SyntaxKind
VariableStatement = 173,
VariableStatement = 175,
>VariableStatement : SyntaxKind
EmptyStatement = 174,
EmptyStatement = 176,
>EmptyStatement : SyntaxKind
ExpressionStatement = 175,
ExpressionStatement = 177,
>ExpressionStatement : SyntaxKind
IfStatement = 176,
IfStatement = 178,
>IfStatement : SyntaxKind
DoStatement = 177,
DoStatement = 179,
>DoStatement : SyntaxKind
WhileStatement = 178,
WhileStatement = 180,
>WhileStatement : SyntaxKind
ForStatement = 179,
ForStatement = 181,
>ForStatement : SyntaxKind
ForInStatement = 180,
ForInStatement = 182,
>ForInStatement : SyntaxKind
ForOfStatement = 181,
ForOfStatement = 183,
>ForOfStatement : SyntaxKind
ContinueStatement = 182,
ContinueStatement = 184,
>ContinueStatement : SyntaxKind
BreakStatement = 183,
BreakStatement = 185,
>BreakStatement : SyntaxKind
ReturnStatement = 184,
ReturnStatement = 186,
>ReturnStatement : SyntaxKind
WithStatement = 185,
WithStatement = 187,
>WithStatement : SyntaxKind
SwitchStatement = 186,
SwitchStatement = 188,
>SwitchStatement : SyntaxKind
LabeledStatement = 187,
LabeledStatement = 189,
>LabeledStatement : SyntaxKind
ThrowStatement = 188,
ThrowStatement = 190,
>ThrowStatement : SyntaxKind
TryStatement = 189,
TryStatement = 191,
>TryStatement : SyntaxKind
DebuggerStatement = 190,
DebuggerStatement = 192,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 191,
VariableDeclaration = 193,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 192,
VariableDeclarationList = 194,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 193,
FunctionDeclaration = 195,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 194,
ClassDeclaration = 196,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 195,
InterfaceDeclaration = 197,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 196,
TypeAliasDeclaration = 198,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 197,
EnumDeclaration = 199,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 198,
ModuleDeclaration = 200,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 199,
ModuleBlock = 201,
>ModuleBlock : SyntaxKind
ImportDeclaration = 200,
ImportEqualsDeclaration = 202,
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 203,
>ImportDeclaration : SyntaxKind
ExportAssignment = 201,
ImportClause = 204,
>ImportClause : SyntaxKind
NamespaceImport = 205,
>NamespaceImport : SyntaxKind
NamedImports = 206,
>NamedImports : SyntaxKind
ImportSpecifier = 207,
>ImportSpecifier : SyntaxKind
ExportAssignment = 208,
>ExportAssignment : SyntaxKind
ExternalModuleReference = 202,
ExportDeclaration = 209,
>ExportDeclaration : SyntaxKind
NamedExports = 210,
>NamedExports : SyntaxKind
ExportSpecifier = 211,
>ExportSpecifier : SyntaxKind
ExternalModuleReference = 212,
>ExternalModuleReference : SyntaxKind
CaseClause = 203,
CaseClause = 213,
>CaseClause : SyntaxKind
DefaultClause = 204,
DefaultClause = 214,
>DefaultClause : SyntaxKind
HeritageClause = 205,
HeritageClause = 215,
>HeritageClause : SyntaxKind
CatchClause = 206,
CatchClause = 216,
>CatchClause : SyntaxKind
PropertyAssignment = 207,
PropertyAssignment = 217,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 208,
ShorthandPropertyAssignment = 218,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 209,
EnumMember = 219,
>EnumMember : SyntaxKind
SourceFile = 210,
SourceFile = 220,
>SourceFile : SyntaxKind
SyntaxList = 211,
SyntaxList = 221,
>SyntaxList : SyntaxKind
Count = 212,
Count = 222,
>Count : SyntaxKind
FirstAssignment = 52,
@ -945,19 +975,19 @@ declare module "typescript" {
FirstKeyword = 65,
>FirstKeyword : SyntaxKind
LastKeyword = 122,
LastKeyword = 124,
>LastKeyword : SyntaxKind
FirstFutureReservedWord = 101,
FirstFutureReservedWord = 103,
>FirstFutureReservedWord : SyntaxKind
LastFutureReservedWord = 109,
LastFutureReservedWord = 111,
>LastFutureReservedWord : SyntaxKind
FirstTypeNode = 137,
FirstTypeNode = 139,
>FirstTypeNode : SyntaxKind
LastTypeNode = 145,
LastTypeNode = 147,
>LastTypeNode : SyntaxKind
FirstPunctuation = 14,
@ -969,7 +999,7 @@ declare module "typescript" {
FirstToken = 0,
>FirstToken : SyntaxKind
LastToken = 122,
LastToken = 124,
>LastToken : SyntaxKind
FirstTriviaToken = 2,
@ -996,7 +1026,7 @@ declare module "typescript" {
LastBinaryOperator = 63,
>LastBinaryOperator : SyntaxKind
FirstNode = 123,
FirstNode = 125,
>FirstNode : SyntaxKind
}
const enum NodeFlags {
@ -1102,6 +1132,10 @@ declare module "typescript" {
>parserContextFlags : ParserContextFlags
>ParserContextFlags : ParserContextFlags
modifiers?: ModifiersArray;
>modifiers : ModifiersArray
>ModifiersArray : ModifiersArray
id?: number;
>id : number
@ -1124,10 +1158,6 @@ declare module "typescript" {
localSymbol?: Symbol;
>localSymbol : Symbol
>Symbol : Symbol
modifiers?: ModifiersArray;
>modifiers : ModifiersArray
>ModifiersArray : ModifiersArray
}
interface NodeArray<T> extends Array<T>, TextRange {
>NodeArray : NodeArray<T>
@ -2226,10 +2256,18 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}
interface ModuleDeclaration extends Declaration, ModuleElement {
interface ExportContainer {
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;
>name : Identifier | LiteralExpression
@ -2251,8 +2289,8 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>ModuleElement : ModuleElement
}
interface ImportDeclaration extends Declaration, ModuleElement {
>ImportDeclaration : ImportDeclaration
interface ImportEqualsDeclaration extends Declaration, ModuleElement {
>ImportEqualsDeclaration : ImportEqualsDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
@ -2273,6 +2311,90 @@ declare module "typescript" {
>expression : Expression
>Expression : Expression
}
interface ImportDeclaration extends Statement, ModuleElement {
>ImportDeclaration : ImportDeclaration
>Statement : Statement
>ModuleElement : ModuleElement
importClause?: ImportClause;
>importClause : ImportClause
>ImportClause : ImportClause
moduleSpecifier: Expression;
>moduleSpecifier : Expression
>Expression : Expression
}
interface ImportClause extends Declaration {
>ImportClause : ImportClause
>Declaration : Declaration
name?: Identifier;
>name : Identifier
>Identifier : Identifier
namedBindings?: NamespaceImport | NamedImports;
>namedBindings : NamespaceImport | NamedImportsOrExports
>NamespaceImport : NamespaceImport
>NamedImports : NamedImportsOrExports
}
interface NamespaceImport extends Declaration {
>NamespaceImport : NamespaceImport
>Declaration : Declaration
name: Identifier;
>name : Identifier
>Identifier : Identifier
}
interface ExportDeclaration extends Statement, ModuleElement {
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>ModuleElement : ModuleElement
exportClause?: NamedExports;
>exportClause : NamedImportsOrExports
>NamedExports : NamedImportsOrExports
moduleSpecifier?: Expression;
>moduleSpecifier : Expression
>Expression : Expression
}
interface NamedImportsOrExports extends Node {
>NamedImportsOrExports : NamedImportsOrExports
>Node : Node
elements: NodeArray<ImportOrExportSpecifier>;
>elements : NodeArray<ImportOrExportSpecifier>
>NodeArray : NodeArray<T>
>ImportOrExportSpecifier : ImportOrExportSpecifier
}
type NamedImports = NamedImportsOrExports;
>NamedImports : NamedImportsOrExports
>NamedImportsOrExports : NamedImportsOrExports
type NamedExports = NamedImportsOrExports;
>NamedExports : NamedImportsOrExports
>NamedImportsOrExports : NamedImportsOrExports
interface ImportOrExportSpecifier extends Declaration {
>ImportOrExportSpecifier : ImportOrExportSpecifier
>Declaration : Declaration
propertyName?: Identifier;
>propertyName : Identifier
>Identifier : Identifier
name: Identifier;
>name : Identifier
>Identifier : Identifier
}
type ImportSpecifier = ImportOrExportSpecifier;
>ImportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
type ExportSpecifier = ImportOrExportSpecifier;
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {
>ExportAssignment : ExportAssignment
>Statement : Statement
@ -2296,9 +2418,10 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;
>hasTrailingNewLine : boolean
}
interface SourceFile extends Declaration {
interface SourceFile extends Declaration, ExportContainer {
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;
>statements : NodeArray<ModuleElement>
@ -2912,9 +3035,9 @@ declare module "typescript" {
>accessibility : SymbolAccessibility
>SymbolAccessibility : SymbolAccessibility
aliasesToMakeVisible?: ImportDeclaration[];
>aliasesToMakeVisible : ImportDeclaration[]
>ImportDeclaration : ImportDeclaration
aliasesToMakeVisible?: ImportEqualsDeclaration[];
>aliasesToMakeVisible : ImportEqualsDeclaration[]
>ImportEqualsDeclaration : ImportEqualsDeclaration
errorSymbolName?: string;
>errorSymbolName : string
@ -2933,14 +3056,16 @@ declare module "typescript" {
interface EmitResolver {
>EmitResolver : EmitResolver
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
>getLocalNameOfContainer : (container: EnumDeclaration | ModuleDeclaration) => string
>container : EnumDeclaration | ModuleDeclaration
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
>getGeneratedNameForNode : (node: EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration) => string
>node : EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration
>ModuleDeclaration : ModuleDeclaration
>EnumDeclaration : EnumDeclaration
>ImportDeclaration : ImportDeclaration
>ExportDeclaration : ExportDeclaration
getExpressionNamePrefix(node: Identifier): string;
>getExpressionNamePrefix : (node: Identifier) => string
getExpressionNameSubstitution(node: Identifier): string;
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
@ -2949,15 +3074,15 @@ declare module "typescript" {
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
>isReferencedImportDeclaration : (node: ImportDeclaration) => boolean
>node : ImportDeclaration
>ImportDeclaration : ImportDeclaration
isReferencedImportDeclaration(node: Node): boolean;
>isReferencedImportDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
>isTopLevelValueImportWithEntityName : (node: ImportDeclaration) => boolean
>node : ImportDeclaration
>ImportDeclaration : ImportDeclaration
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean
>node : ImportEqualsDeclaration
>ImportEqualsDeclaration : ImportEqualsDeclaration
getNodeCheckFlags(node: Node): NodeCheckFlags;
>getNodeCheckFlags : (node: Node) => NodeCheckFlags
@ -3286,13 +3411,20 @@ declare module "typescript" {
referenced?: boolean;
>referenced : boolean
exportAssignSymbol?: Symbol;
>exportAssignSymbol : Symbol
exportAssignmentChecked?: boolean;
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;
>unionType : UnionType
>UnionType : UnionType
resolvedExports?: SymbolTable;
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
}
interface TransientSymbol extends Symbol, SymbolLinks {
>TransientSymbol : TransientSymbol
@ -3361,8 +3493,12 @@ declare module "typescript" {
isVisible?: boolean;
>isVisible : boolean
localModuleName?: string;
>localModuleName : string
generatedName?: string;
>generatedName : string
generatedNames?: Map<string>;
>generatedNames : Map<string>
>Map : Map<T>
assignmentChecks?: Map<boolean>;
>assignmentChecks : Map<boolean>

View File

@ -229,132 +229,142 @@ declare module "typescript" {
VoidKeyword = 98,
WhileKeyword = 99,
WithKeyword = 100,
ImplementsKeyword = 101,
InterfaceKeyword = 102,
LetKeyword = 103,
PackageKeyword = 104,
PrivateKeyword = 105,
ProtectedKeyword = 106,
PublicKeyword = 107,
StaticKeyword = 108,
YieldKeyword = 109,
AnyKeyword = 110,
BooleanKeyword = 111,
ConstructorKeyword = 112,
DeclareKeyword = 113,
GetKeyword = 114,
ModuleKeyword = 115,
RequireKeyword = 116,
NumberKeyword = 117,
SetKeyword = 118,
StringKeyword = 119,
SymbolKeyword = 120,
TypeKeyword = 121,
OfKeyword = 122,
QualifiedName = 123,
ComputedPropertyName = 124,
TypeParameter = 125,
Parameter = 126,
PropertySignature = 127,
PropertyDeclaration = 128,
MethodSignature = 129,
MethodDeclaration = 130,
Constructor = 131,
GetAccessor = 132,
SetAccessor = 133,
CallSignature = 134,
ConstructSignature = 135,
IndexSignature = 136,
TypeReference = 137,
FunctionType = 138,
ConstructorType = 139,
TypeQuery = 140,
TypeLiteral = 141,
ArrayType = 142,
TupleType = 143,
UnionType = 144,
ParenthesizedType = 145,
ObjectBindingPattern = 146,
ArrayBindingPattern = 147,
BindingElement = 148,
ArrayLiteralExpression = 149,
ObjectLiteralExpression = 150,
PropertyAccessExpression = 151,
ElementAccessExpression = 152,
CallExpression = 153,
NewExpression = 154,
TaggedTemplateExpression = 155,
TypeAssertionExpression = 156,
ParenthesizedExpression = 157,
FunctionExpression = 158,
ArrowFunction = 159,
DeleteExpression = 160,
TypeOfExpression = 161,
VoidExpression = 162,
PrefixUnaryExpression = 163,
PostfixUnaryExpression = 164,
BinaryExpression = 165,
ConditionalExpression = 166,
TemplateExpression = 167,
YieldExpression = 168,
SpreadElementExpression = 169,
OmittedExpression = 170,
TemplateSpan = 171,
Block = 172,
VariableStatement = 173,
EmptyStatement = 174,
ExpressionStatement = 175,
IfStatement = 176,
DoStatement = 177,
WhileStatement = 178,
ForStatement = 179,
ForInStatement = 180,
ForOfStatement = 181,
ContinueStatement = 182,
BreakStatement = 183,
ReturnStatement = 184,
WithStatement = 185,
SwitchStatement = 186,
LabeledStatement = 187,
ThrowStatement = 188,
TryStatement = 189,
DebuggerStatement = 190,
VariableDeclaration = 191,
VariableDeclarationList = 192,
FunctionDeclaration = 193,
ClassDeclaration = 194,
InterfaceDeclaration = 195,
TypeAliasDeclaration = 196,
EnumDeclaration = 197,
ModuleDeclaration = 198,
ModuleBlock = 199,
ImportDeclaration = 200,
ExportAssignment = 201,
ExternalModuleReference = 202,
CaseClause = 203,
DefaultClause = 204,
HeritageClause = 205,
CatchClause = 206,
PropertyAssignment = 207,
ShorthandPropertyAssignment = 208,
EnumMember = 209,
SourceFile = 210,
SyntaxList = 211,
Count = 212,
AsKeyword = 101,
FromKeyword = 102,
ImplementsKeyword = 103,
InterfaceKeyword = 104,
LetKeyword = 105,
PackageKeyword = 106,
PrivateKeyword = 107,
ProtectedKeyword = 108,
PublicKeyword = 109,
StaticKeyword = 110,
YieldKeyword = 111,
AnyKeyword = 112,
BooleanKeyword = 113,
ConstructorKeyword = 114,
DeclareKeyword = 115,
GetKeyword = 116,
ModuleKeyword = 117,
RequireKeyword = 118,
NumberKeyword = 119,
SetKeyword = 120,
StringKeyword = 121,
SymbolKeyword = 122,
TypeKeyword = 123,
OfKeyword = 124,
QualifiedName = 125,
ComputedPropertyName = 126,
TypeParameter = 127,
Parameter = 128,
PropertySignature = 129,
PropertyDeclaration = 130,
MethodSignature = 131,
MethodDeclaration = 132,
Constructor = 133,
GetAccessor = 134,
SetAccessor = 135,
CallSignature = 136,
ConstructSignature = 137,
IndexSignature = 138,
TypeReference = 139,
FunctionType = 140,
ConstructorType = 141,
TypeQuery = 142,
TypeLiteral = 143,
ArrayType = 144,
TupleType = 145,
UnionType = 146,
ParenthesizedType = 147,
ObjectBindingPattern = 148,
ArrayBindingPattern = 149,
BindingElement = 150,
ArrayLiteralExpression = 151,
ObjectLiteralExpression = 152,
PropertyAccessExpression = 153,
ElementAccessExpression = 154,
CallExpression = 155,
NewExpression = 156,
TaggedTemplateExpression = 157,
TypeAssertionExpression = 158,
ParenthesizedExpression = 159,
FunctionExpression = 160,
ArrowFunction = 161,
DeleteExpression = 162,
TypeOfExpression = 163,
VoidExpression = 164,
PrefixUnaryExpression = 165,
PostfixUnaryExpression = 166,
BinaryExpression = 167,
ConditionalExpression = 168,
TemplateExpression = 169,
YieldExpression = 170,
SpreadElementExpression = 171,
OmittedExpression = 172,
TemplateSpan = 173,
Block = 174,
VariableStatement = 175,
EmptyStatement = 176,
ExpressionStatement = 177,
IfStatement = 178,
DoStatement = 179,
WhileStatement = 180,
ForStatement = 181,
ForInStatement = 182,
ForOfStatement = 183,
ContinueStatement = 184,
BreakStatement = 185,
ReturnStatement = 186,
WithStatement = 187,
SwitchStatement = 188,
LabeledStatement = 189,
ThrowStatement = 190,
TryStatement = 191,
DebuggerStatement = 192,
VariableDeclaration = 193,
VariableDeclarationList = 194,
FunctionDeclaration = 195,
ClassDeclaration = 196,
InterfaceDeclaration = 197,
TypeAliasDeclaration = 198,
EnumDeclaration = 199,
ModuleDeclaration = 200,
ModuleBlock = 201,
ImportEqualsDeclaration = 202,
ImportDeclaration = 203,
ImportClause = 204,
NamespaceImport = 205,
NamedImports = 206,
ImportSpecifier = 207,
ExportAssignment = 208,
ExportDeclaration = 209,
NamedExports = 210,
ExportSpecifier = 211,
ExternalModuleReference = 212,
CaseClause = 213,
DefaultClause = 214,
HeritageClause = 215,
CatchClause = 216,
PropertyAssignment = 217,
ShorthandPropertyAssignment = 218,
EnumMember = 219,
SourceFile = 220,
SyntaxList = 221,
Count = 222,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
LastReservedWord = 100,
FirstKeyword = 65,
LastKeyword = 122,
FirstFutureReservedWord = 101,
LastFutureReservedWord = 109,
FirstTypeNode = 137,
LastTypeNode = 145,
LastKeyword = 124,
FirstFutureReservedWord = 103,
LastFutureReservedWord = 111,
FirstTypeNode = 139,
LastTypeNode = 147,
FirstPunctuation = 14,
LastPunctuation = 63,
FirstToken = 0,
LastToken = 122,
LastToken = 124,
FirstTriviaToken = 2,
LastTriviaToken = 6,
FirstLiteralToken = 7,
@ -363,7 +373,7 @@ declare module "typescript" {
LastTemplateToken = 13,
FirstBinaryOperator = 24,
LastBinaryOperator = 63,
FirstNode = 123,
FirstNode = 125,
}
const enum NodeFlags {
Export = 1,
@ -401,13 +411,13 @@ declare module "typescript" {
kind: SyntaxKind;
flags: NodeFlags;
parserContextFlags?: ParserContextFlags;
modifiers?: ModifiersArray;
id?: number;
parent?: Node;
symbol?: Symbol;
locals?: SymbolTable;
nextContainer?: Node;
localSymbol?: Symbol;
modifiers?: ModifiersArray;
}
interface NodeArray<T> extends Array<T>, TextRange {
hasTrailingComma?: boolean;
@ -771,20 +781,49 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ModuleDeclaration extends Declaration, ModuleElement {
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
interface ModuleBlock extends Node, ModuleElement {
statements: NodeArray<ModuleElement>;
}
interface ImportDeclaration extends Declaration, ModuleElement {
interface ImportEqualsDeclaration extends Declaration, ModuleElement {
name: Identifier;
moduleReference: EntityName | ExternalModuleReference;
}
interface ExternalModuleReference extends Node {
expression?: Expression;
}
interface ImportDeclaration extends Statement, ModuleElement {
importClause?: ImportClause;
moduleSpecifier: Expression;
}
interface ImportClause extends Declaration {
name?: Identifier;
namedBindings?: NamespaceImport | NamedImports;
}
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
interface NamedImportsOrExports extends Node {
elements: NodeArray<ImportOrExportSpecifier>;
}
type NamedImports = NamedImportsOrExports;
type NamedExports = NamedImportsOrExports;
interface ImportOrExportSpecifier extends Declaration {
propertyName?: Identifier;
name: Identifier;
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
}
@ -794,7 +833,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration {
interface SourceFile extends Declaration, ExportContainer {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@ -948,7 +987,7 @@ declare module "typescript" {
}
interface SymbolVisibilityResult {
accessibility: SymbolAccessibility;
aliasesToMakeVisible?: ImportDeclaration[];
aliasesToMakeVisible?: ImportEqualsDeclaration[];
errorSymbolName?: string;
errorNode?: Node;
}
@ -956,11 +995,11 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
getExpressionNamePrefix(node: Identifier): string;
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
isReferencedImportDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
@ -1055,8 +1094,10 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignSymbol?: Symbol;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@ -1081,7 +1122,8 @@ declare module "typescript" {
enumMemberValue?: number;
isIllegalTypeReferenceInConstraint?: boolean;
isVisible?: boolean;
localModuleName?: string;
generatedName?: string;
generatedNames?: Map<string>;
assignmentChecks?: Map<boolean>;
hasReportedStatementInAmbientContext?: boolean;
importOnRightSide?: Symbol;

View File

@ -767,340 +767,370 @@ declare module "typescript" {
WithKeyword = 100,
>WithKeyword : SyntaxKind
ImplementsKeyword = 101,
AsKeyword = 101,
>AsKeyword : SyntaxKind
FromKeyword = 102,
>FromKeyword : SyntaxKind
ImplementsKeyword = 103,
>ImplementsKeyword : SyntaxKind
InterfaceKeyword = 102,
InterfaceKeyword = 104,
>InterfaceKeyword : SyntaxKind
LetKeyword = 103,
LetKeyword = 105,
>LetKeyword : SyntaxKind
PackageKeyword = 104,
PackageKeyword = 106,
>PackageKeyword : SyntaxKind
PrivateKeyword = 105,
PrivateKeyword = 107,
>PrivateKeyword : SyntaxKind
ProtectedKeyword = 106,
ProtectedKeyword = 108,
>ProtectedKeyword : SyntaxKind
PublicKeyword = 107,
PublicKeyword = 109,
>PublicKeyword : SyntaxKind
StaticKeyword = 108,
StaticKeyword = 110,
>StaticKeyword : SyntaxKind
YieldKeyword = 109,
YieldKeyword = 111,
>YieldKeyword : SyntaxKind
AnyKeyword = 110,
AnyKeyword = 112,
>AnyKeyword : SyntaxKind
BooleanKeyword = 111,
BooleanKeyword = 113,
>BooleanKeyword : SyntaxKind
ConstructorKeyword = 112,
ConstructorKeyword = 114,
>ConstructorKeyword : SyntaxKind
DeclareKeyword = 113,
DeclareKeyword = 115,
>DeclareKeyword : SyntaxKind
GetKeyword = 114,
GetKeyword = 116,
>GetKeyword : SyntaxKind
ModuleKeyword = 115,
ModuleKeyword = 117,
>ModuleKeyword : SyntaxKind
RequireKeyword = 116,
RequireKeyword = 118,
>RequireKeyword : SyntaxKind
NumberKeyword = 117,
NumberKeyword = 119,
>NumberKeyword : SyntaxKind
SetKeyword = 118,
SetKeyword = 120,
>SetKeyword : SyntaxKind
StringKeyword = 119,
StringKeyword = 121,
>StringKeyword : SyntaxKind
SymbolKeyword = 120,
SymbolKeyword = 122,
>SymbolKeyword : SyntaxKind
TypeKeyword = 121,
TypeKeyword = 123,
>TypeKeyword : SyntaxKind
OfKeyword = 122,
OfKeyword = 124,
>OfKeyword : SyntaxKind
QualifiedName = 123,
QualifiedName = 125,
>QualifiedName : SyntaxKind
ComputedPropertyName = 124,
ComputedPropertyName = 126,
>ComputedPropertyName : SyntaxKind
TypeParameter = 125,
TypeParameter = 127,
>TypeParameter : SyntaxKind
Parameter = 126,
Parameter = 128,
>Parameter : SyntaxKind
PropertySignature = 127,
PropertySignature = 129,
>PropertySignature : SyntaxKind
PropertyDeclaration = 128,
PropertyDeclaration = 130,
>PropertyDeclaration : SyntaxKind
MethodSignature = 129,
MethodSignature = 131,
>MethodSignature : SyntaxKind
MethodDeclaration = 130,
MethodDeclaration = 132,
>MethodDeclaration : SyntaxKind
Constructor = 131,
Constructor = 133,
>Constructor : SyntaxKind
GetAccessor = 132,
GetAccessor = 134,
>GetAccessor : SyntaxKind
SetAccessor = 133,
SetAccessor = 135,
>SetAccessor : SyntaxKind
CallSignature = 134,
CallSignature = 136,
>CallSignature : SyntaxKind
ConstructSignature = 135,
ConstructSignature = 137,
>ConstructSignature : SyntaxKind
IndexSignature = 136,
IndexSignature = 138,
>IndexSignature : SyntaxKind
TypeReference = 137,
TypeReference = 139,
>TypeReference : SyntaxKind
FunctionType = 138,
FunctionType = 140,
>FunctionType : SyntaxKind
ConstructorType = 139,
ConstructorType = 141,
>ConstructorType : SyntaxKind
TypeQuery = 140,
TypeQuery = 142,
>TypeQuery : SyntaxKind
TypeLiteral = 141,
TypeLiteral = 143,
>TypeLiteral : SyntaxKind
ArrayType = 142,
ArrayType = 144,
>ArrayType : SyntaxKind
TupleType = 143,
TupleType = 145,
>TupleType : SyntaxKind
UnionType = 144,
UnionType = 146,
>UnionType : SyntaxKind
ParenthesizedType = 145,
ParenthesizedType = 147,
>ParenthesizedType : SyntaxKind
ObjectBindingPattern = 146,
ObjectBindingPattern = 148,
>ObjectBindingPattern : SyntaxKind
ArrayBindingPattern = 147,
ArrayBindingPattern = 149,
>ArrayBindingPattern : SyntaxKind
BindingElement = 148,
BindingElement = 150,
>BindingElement : SyntaxKind
ArrayLiteralExpression = 149,
ArrayLiteralExpression = 151,
>ArrayLiteralExpression : SyntaxKind
ObjectLiteralExpression = 150,
ObjectLiteralExpression = 152,
>ObjectLiteralExpression : SyntaxKind
PropertyAccessExpression = 151,
PropertyAccessExpression = 153,
>PropertyAccessExpression : SyntaxKind
ElementAccessExpression = 152,
ElementAccessExpression = 154,
>ElementAccessExpression : SyntaxKind
CallExpression = 153,
CallExpression = 155,
>CallExpression : SyntaxKind
NewExpression = 154,
NewExpression = 156,
>NewExpression : SyntaxKind
TaggedTemplateExpression = 155,
TaggedTemplateExpression = 157,
>TaggedTemplateExpression : SyntaxKind
TypeAssertionExpression = 156,
TypeAssertionExpression = 158,
>TypeAssertionExpression : SyntaxKind
ParenthesizedExpression = 157,
ParenthesizedExpression = 159,
>ParenthesizedExpression : SyntaxKind
FunctionExpression = 158,
FunctionExpression = 160,
>FunctionExpression : SyntaxKind
ArrowFunction = 159,
ArrowFunction = 161,
>ArrowFunction : SyntaxKind
DeleteExpression = 160,
DeleteExpression = 162,
>DeleteExpression : SyntaxKind
TypeOfExpression = 161,
TypeOfExpression = 163,
>TypeOfExpression : SyntaxKind
VoidExpression = 162,
VoidExpression = 164,
>VoidExpression : SyntaxKind
PrefixUnaryExpression = 163,
PrefixUnaryExpression = 165,
>PrefixUnaryExpression : SyntaxKind
PostfixUnaryExpression = 164,
PostfixUnaryExpression = 166,
>PostfixUnaryExpression : SyntaxKind
BinaryExpression = 165,
BinaryExpression = 167,
>BinaryExpression : SyntaxKind
ConditionalExpression = 166,
ConditionalExpression = 168,
>ConditionalExpression : SyntaxKind
TemplateExpression = 167,
TemplateExpression = 169,
>TemplateExpression : SyntaxKind
YieldExpression = 168,
YieldExpression = 170,
>YieldExpression : SyntaxKind
SpreadElementExpression = 169,
SpreadElementExpression = 171,
>SpreadElementExpression : SyntaxKind
OmittedExpression = 170,
OmittedExpression = 172,
>OmittedExpression : SyntaxKind
TemplateSpan = 171,
TemplateSpan = 173,
>TemplateSpan : SyntaxKind
Block = 172,
Block = 174,
>Block : SyntaxKind
VariableStatement = 173,
VariableStatement = 175,
>VariableStatement : SyntaxKind
EmptyStatement = 174,
EmptyStatement = 176,
>EmptyStatement : SyntaxKind
ExpressionStatement = 175,
ExpressionStatement = 177,
>ExpressionStatement : SyntaxKind
IfStatement = 176,
IfStatement = 178,
>IfStatement : SyntaxKind
DoStatement = 177,
DoStatement = 179,
>DoStatement : SyntaxKind
WhileStatement = 178,
WhileStatement = 180,
>WhileStatement : SyntaxKind
ForStatement = 179,
ForStatement = 181,
>ForStatement : SyntaxKind
ForInStatement = 180,
ForInStatement = 182,
>ForInStatement : SyntaxKind
ForOfStatement = 181,
ForOfStatement = 183,
>ForOfStatement : SyntaxKind
ContinueStatement = 182,
ContinueStatement = 184,
>ContinueStatement : SyntaxKind
BreakStatement = 183,
BreakStatement = 185,
>BreakStatement : SyntaxKind
ReturnStatement = 184,
ReturnStatement = 186,
>ReturnStatement : SyntaxKind
WithStatement = 185,
WithStatement = 187,
>WithStatement : SyntaxKind
SwitchStatement = 186,
SwitchStatement = 188,
>SwitchStatement : SyntaxKind
LabeledStatement = 187,
LabeledStatement = 189,
>LabeledStatement : SyntaxKind
ThrowStatement = 188,
ThrowStatement = 190,
>ThrowStatement : SyntaxKind
TryStatement = 189,
TryStatement = 191,
>TryStatement : SyntaxKind
DebuggerStatement = 190,
DebuggerStatement = 192,
>DebuggerStatement : SyntaxKind
VariableDeclaration = 191,
VariableDeclaration = 193,
>VariableDeclaration : SyntaxKind
VariableDeclarationList = 192,
VariableDeclarationList = 194,
>VariableDeclarationList : SyntaxKind
FunctionDeclaration = 193,
FunctionDeclaration = 195,
>FunctionDeclaration : SyntaxKind
ClassDeclaration = 194,
ClassDeclaration = 196,
>ClassDeclaration : SyntaxKind
InterfaceDeclaration = 195,
InterfaceDeclaration = 197,
>InterfaceDeclaration : SyntaxKind
TypeAliasDeclaration = 196,
TypeAliasDeclaration = 198,
>TypeAliasDeclaration : SyntaxKind
EnumDeclaration = 197,
EnumDeclaration = 199,
>EnumDeclaration : SyntaxKind
ModuleDeclaration = 198,
ModuleDeclaration = 200,
>ModuleDeclaration : SyntaxKind
ModuleBlock = 199,
ModuleBlock = 201,
>ModuleBlock : SyntaxKind
ImportDeclaration = 200,
ImportEqualsDeclaration = 202,
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 203,
>ImportDeclaration : SyntaxKind
ExportAssignment = 201,
ImportClause = 204,
>ImportClause : SyntaxKind
NamespaceImport = 205,
>NamespaceImport : SyntaxKind
NamedImports = 206,
>NamedImports : SyntaxKind
ImportSpecifier = 207,
>ImportSpecifier : SyntaxKind
ExportAssignment = 208,
>ExportAssignment : SyntaxKind
ExternalModuleReference = 202,
ExportDeclaration = 209,
>ExportDeclaration : SyntaxKind
NamedExports = 210,
>NamedExports : SyntaxKind
ExportSpecifier = 211,
>ExportSpecifier : SyntaxKind
ExternalModuleReference = 212,
>ExternalModuleReference : SyntaxKind
CaseClause = 203,
CaseClause = 213,
>CaseClause : SyntaxKind
DefaultClause = 204,
DefaultClause = 214,
>DefaultClause : SyntaxKind
HeritageClause = 205,
HeritageClause = 215,
>HeritageClause : SyntaxKind
CatchClause = 206,
CatchClause = 216,
>CatchClause : SyntaxKind
PropertyAssignment = 207,
PropertyAssignment = 217,
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 208,
ShorthandPropertyAssignment = 218,
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 209,
EnumMember = 219,
>EnumMember : SyntaxKind
SourceFile = 210,
SourceFile = 220,
>SourceFile : SyntaxKind
SyntaxList = 211,
SyntaxList = 221,
>SyntaxList : SyntaxKind
Count = 212,
Count = 222,
>Count : SyntaxKind
FirstAssignment = 52,
@ -1118,19 +1148,19 @@ declare module "typescript" {
FirstKeyword = 65,
>FirstKeyword : SyntaxKind
LastKeyword = 122,
LastKeyword = 124,
>LastKeyword : SyntaxKind
FirstFutureReservedWord = 101,
FirstFutureReservedWord = 103,
>FirstFutureReservedWord : SyntaxKind
LastFutureReservedWord = 109,
LastFutureReservedWord = 111,
>LastFutureReservedWord : SyntaxKind
FirstTypeNode = 137,
FirstTypeNode = 139,
>FirstTypeNode : SyntaxKind
LastTypeNode = 145,
LastTypeNode = 147,
>LastTypeNode : SyntaxKind
FirstPunctuation = 14,
@ -1142,7 +1172,7 @@ declare module "typescript" {
FirstToken = 0,
>FirstToken : SyntaxKind
LastToken = 122,
LastToken = 124,
>LastToken : SyntaxKind
FirstTriviaToken = 2,
@ -1169,7 +1199,7 @@ declare module "typescript" {
LastBinaryOperator = 63,
>LastBinaryOperator : SyntaxKind
FirstNode = 123,
FirstNode = 125,
>FirstNode : SyntaxKind
}
const enum NodeFlags {
@ -1275,6 +1305,10 @@ declare module "typescript" {
>parserContextFlags : ParserContextFlags
>ParserContextFlags : ParserContextFlags
modifiers?: ModifiersArray;
>modifiers : ModifiersArray
>ModifiersArray : ModifiersArray
id?: number;
>id : number
@ -1297,10 +1331,6 @@ declare module "typescript" {
localSymbol?: Symbol;
>localSymbol : Symbol
>Symbol : Symbol
modifiers?: ModifiersArray;
>modifiers : ModifiersArray
>ModifiersArray : ModifiersArray
}
interface NodeArray<T> extends Array<T>, TextRange {
>NodeArray : NodeArray<T>
@ -2399,10 +2429,18 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}
interface ModuleDeclaration extends Declaration, ModuleElement {
interface ExportContainer {
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;
>name : Identifier | LiteralExpression
@ -2424,8 +2462,8 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>ModuleElement : ModuleElement
}
interface ImportDeclaration extends Declaration, ModuleElement {
>ImportDeclaration : ImportDeclaration
interface ImportEqualsDeclaration extends Declaration, ModuleElement {
>ImportEqualsDeclaration : ImportEqualsDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
@ -2446,6 +2484,90 @@ declare module "typescript" {
>expression : Expression
>Expression : Expression
}
interface ImportDeclaration extends Statement, ModuleElement {
>ImportDeclaration : ImportDeclaration
>Statement : Statement
>ModuleElement : ModuleElement
importClause?: ImportClause;
>importClause : ImportClause
>ImportClause : ImportClause
moduleSpecifier: Expression;
>moduleSpecifier : Expression
>Expression : Expression
}
interface ImportClause extends Declaration {
>ImportClause : ImportClause
>Declaration : Declaration
name?: Identifier;
>name : Identifier
>Identifier : Identifier
namedBindings?: NamespaceImport | NamedImports;
>namedBindings : NamespaceImport | NamedImportsOrExports
>NamespaceImport : NamespaceImport
>NamedImports : NamedImportsOrExports
}
interface NamespaceImport extends Declaration {
>NamespaceImport : NamespaceImport
>Declaration : Declaration
name: Identifier;
>name : Identifier
>Identifier : Identifier
}
interface ExportDeclaration extends Statement, ModuleElement {
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>ModuleElement : ModuleElement
exportClause?: NamedExports;
>exportClause : NamedImportsOrExports
>NamedExports : NamedImportsOrExports
moduleSpecifier?: Expression;
>moduleSpecifier : Expression
>Expression : Expression
}
interface NamedImportsOrExports extends Node {
>NamedImportsOrExports : NamedImportsOrExports
>Node : Node
elements: NodeArray<ImportOrExportSpecifier>;
>elements : NodeArray<ImportOrExportSpecifier>
>NodeArray : NodeArray<T>
>ImportOrExportSpecifier : ImportOrExportSpecifier
}
type NamedImports = NamedImportsOrExports;
>NamedImports : NamedImportsOrExports
>NamedImportsOrExports : NamedImportsOrExports
type NamedExports = NamedImportsOrExports;
>NamedExports : NamedImportsOrExports
>NamedImportsOrExports : NamedImportsOrExports
interface ImportOrExportSpecifier extends Declaration {
>ImportOrExportSpecifier : ImportOrExportSpecifier
>Declaration : Declaration
propertyName?: Identifier;
>propertyName : Identifier
>Identifier : Identifier
name: Identifier;
>name : Identifier
>Identifier : Identifier
}
type ImportSpecifier = ImportOrExportSpecifier;
>ImportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
type ExportSpecifier = ImportOrExportSpecifier;
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {
>ExportAssignment : ExportAssignment
>Statement : Statement
@ -2469,9 +2591,10 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;
>hasTrailingNewLine : boolean
}
interface SourceFile extends Declaration {
interface SourceFile extends Declaration, ExportContainer {
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;
>statements : NodeArray<ModuleElement>
@ -3085,9 +3208,9 @@ declare module "typescript" {
>accessibility : SymbolAccessibility
>SymbolAccessibility : SymbolAccessibility
aliasesToMakeVisible?: ImportDeclaration[];
>aliasesToMakeVisible : ImportDeclaration[]
>ImportDeclaration : ImportDeclaration
aliasesToMakeVisible?: ImportEqualsDeclaration[];
>aliasesToMakeVisible : ImportEqualsDeclaration[]
>ImportEqualsDeclaration : ImportEqualsDeclaration
errorSymbolName?: string;
>errorSymbolName : string
@ -3106,14 +3229,16 @@ declare module "typescript" {
interface EmitResolver {
>EmitResolver : EmitResolver
getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string;
>getLocalNameOfContainer : (container: EnumDeclaration | ModuleDeclaration) => string
>container : EnumDeclaration | ModuleDeclaration
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
>getGeneratedNameForNode : (node: EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration) => string
>node : EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration
>ModuleDeclaration : ModuleDeclaration
>EnumDeclaration : EnumDeclaration
>ImportDeclaration : ImportDeclaration
>ExportDeclaration : ExportDeclaration
getExpressionNamePrefix(node: Identifier): string;
>getExpressionNamePrefix : (node: Identifier) => string
getExpressionNameSubstitution(node: Identifier): string;
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
@ -3122,15 +3247,15 @@ declare module "typescript" {
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: ImportDeclaration): boolean;
>isReferencedImportDeclaration : (node: ImportDeclaration) => boolean
>node : ImportDeclaration
>ImportDeclaration : ImportDeclaration
isReferencedImportDeclaration(node: Node): boolean;
>isReferencedImportDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
>isTopLevelValueImportWithEntityName : (node: ImportDeclaration) => boolean
>node : ImportDeclaration
>ImportDeclaration : ImportDeclaration
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean
>node : ImportEqualsDeclaration
>ImportEqualsDeclaration : ImportEqualsDeclaration
getNodeCheckFlags(node: Node): NodeCheckFlags;
>getNodeCheckFlags : (node: Node) => NodeCheckFlags
@ -3459,13 +3584,20 @@ declare module "typescript" {
referenced?: boolean;
>referenced : boolean
exportAssignSymbol?: Symbol;
>exportAssignSymbol : Symbol
exportAssignmentChecked?: boolean;
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;
>unionType : UnionType
>UnionType : UnionType
resolvedExports?: SymbolTable;
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
}
interface TransientSymbol extends Symbol, SymbolLinks {
>TransientSymbol : TransientSymbol
@ -3534,8 +3666,12 @@ declare module "typescript" {
isVisible?: boolean;
>isVisible : boolean
localModuleName?: string;
>localModuleName : string
generatedName?: string;
>generatedName : string
generatedNames?: Map<string>;
>generatedNames : Map<string>
>Map : Map<T>
assignmentChecks?: Map<boolean>;
>assignmentChecks : Map<boolean>

View File

@ -1,4 +1,4 @@
tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,5): error TS2439: Import declaration in an ambient external module declaration cannot reference external module through relative external module name.
tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,5): error TS2439: Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name.
tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,25): error TS2307: Cannot find external module './SubModule'.
@ -6,7 +6,7 @@ tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.
declare module "OuterModule" {
import m2 = require("./SubModule");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2439: Import declaration in an ambient external module declaration cannot reference external module through relative external module name.
!!! error TS2439: Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name.
~~~~~~~~~~~~~
!!! error TS2307: Cannot find external module './SubModule'.
class SubModule {

View File

@ -63,14 +63,14 @@ var M;
})();
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_1) {
var d = (function () {
function d() {
}
Object.defineProperty(d.prototype, "Z", {
set: function (p) {
var M = 10;
this.y = _M.x;
this.y = _M_1.x;
},
enumerable: true,
configurable: true
@ -94,14 +94,14 @@ var M;
})();
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_2) {
var f = (function () {
function f() {
}
Object.defineProperty(f.prototype, "Z", {
get: function () {
var M = 10;
return _M.x;
return _M_2.x;
},
enumerable: true,
configurable: true

View File

@ -35,21 +35,21 @@ var M;
})();
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_1) {
var d = (function () {
function d(M, p) {
if (p === void 0) { p = _M.x; }
if (p === void 0) { p = _M_1.x; }
this.M = M;
}
return d;
})();
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_2) {
var d2 = (function () {
function d2() {
var M = 10;
var p = _M.x;
var p = _M_2.x;
}
return d2;
})();

View File

@ -26,17 +26,17 @@ var M;
function fn(M, p) { }
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_1) {
function fn2() {
var M;
var p = _M.x;
var p = _M_1.x;
}
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_2) {
function fn3() {
function M() {
var p = _M.x;
var p = _M_2.x;
}
}
})(M || (M = {}));

View File

@ -27,19 +27,19 @@ var m1;
})(m1 || (m1 = {}));
var foo = new m1.m1();
var m2;
(function (__m2) {
(function (_m2_1) {
var m2 = (function () {
function m2() {
}
return m2;
})();
__m2.m2 = m2;
_m2_1.m2 = m2;
var _m2 = (function () {
function _m2() {
}
return _m2;
})();
__m2._m2 = _m2;
_m2_1._m2 = _m2;
})(m2 || (m2 = {}));
var foo = new m2.m2();
var foo = new m2._m2();

View File

@ -44,25 +44,25 @@ var M;
})();
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_1) {
var d = (function () {
function d() {
}
d.prototype.fn2 = function () {
var M;
var p = _M.x;
var p = _M_1.x;
};
return d;
})();
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_2) {
var e = (function () {
function e() {
}
e.prototype.fn3 = function () {
function M() {
var p = _M.x;
var p = _M_2.x;
}
};
return e;

View File

@ -53,7 +53,7 @@ var M;
})(m1 || (m1 = {}));
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_1) {
var m2;
(function (m2) {
var M = (function () {
@ -61,17 +61,17 @@ var M;
}
return M;
})();
var p = _M.x;
var p = _M_1.x;
var p2 = new M();
})(m2 || (m2 = {}));
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_2) {
var m3;
(function (m3) {
function M() {
}
var p = _M.x;
var p = _M_2.x;
var p2 = M();
})(m3 || (m3 = {}));
})(M || (M = {}));
@ -84,12 +84,12 @@ var M;
})(m3 || (m3 = {}));
})(M || (M = {}));
var M;
(function (_M) {
(function (_M_3) {
var m4;
(function (m4) {
var M;
(function (M) {
var p = _M.x;
var p = _M_3.x;
})(M || (M = {}));
})(m4 || (m4 = {}));
})(M || (M = {}));

View File

@ -0,0 +1,11 @@
tests/cases/compiler/es6ImportDefaultBinding_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBinding_0"' has no default export or export assignment.
==== tests/cases/compiler/es6ImportDefaultBinding_0.ts (0 errors) ====
export var a = 10;
==== tests/cases/compiler/es6ImportDefaultBinding_1.ts (1 errors) ====
import defaultBinding from "es6ImportDefaultBinding_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBinding_0"' has no default export or export assignment.

View File

@ -0,0 +1,12 @@
//// [tests/cases/compiler/es6ImportDefaultBinding.ts] ////
//// [es6ImportDefaultBinding_0.ts]
export var a = 10;
//// [es6ImportDefaultBinding_1.ts]
import defaultBinding from "es6ImportDefaultBinding_0";
//// [es6ImportDefaultBinding_0.js]
exports.a = 10;
//// [es6ImportDefaultBinding_1.js]

View File

@ -0,0 +1,51 @@
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(1,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(2,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(2,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(3,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(3,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(4,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(4,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(5,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(5,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(6,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(6,8): error TS2300: Duplicate identifier 'defaultBinding'.
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0.ts (0 errors) ====
export var a = 10;
export var x = a;
export var m = a;
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts (12 errors) ====
import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.

View File

@ -0,0 +1,21 @@
//// [tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport.ts] ////
//// [es6ImportDefaultBindingFollowedWithNamedImport_0.ts]
export var a = 10;
export var x = a;
export var m = a;
//// [es6ImportDefaultBindingFollowedWithNamedImport_1.ts]
import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
//// [es6ImportDefaultBindingFollowedWithNamedImport_0.js]
exports.a = 10;
exports.x = exports.a;
exports.m = exports.a;
//// [es6ImportDefaultBindingFollowedWithNamedImport_1.js]

View File

@ -0,0 +1,51 @@
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(1,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(2,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(2,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(3,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(3,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(4,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(4,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(5,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(5,8): error TS2300: Duplicate identifier 'defaultBinding'.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(6,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(6,8): error TS2300: Duplicate identifier 'defaultBinding'.
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0.ts (0 errors) ====
export var a = 10;
export var x = a;
export var m = a;
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts (12 errors) ====
import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.
import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export or export assignment.
~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'defaultBinding'.

View File

@ -0,0 +1,21 @@
//// [tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5.ts] ////
//// [es6ImportDefaultBindingFollowedWithNamedImportInEs5_0.ts]
export var a = 10;
export var x = a;
export var m = a;
//// [es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts]
import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
//// [es6ImportDefaultBindingFollowedWithNamedImportInEs5_0.js]
exports.a = 10;
exports.x = exports.a;
exports.m = exports.a;
//// [es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.js]

View File

@ -0,0 +1,11 @@
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0"' has no default export or export assignment.
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts (0 errors) ====
export var a = 10;
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts (1 errors) ====
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0"' has no default export or export assignment.

View File

@ -0,0 +1,12 @@
//// [tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding.ts] ////
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts]
export var a = 10;
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts]
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0";
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_0.js]
exports.a = 10;
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_1.js]

View File

@ -0,0 +1,11 @@
tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"' has no default export or export assignment.
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts (0 errors) ====
export var a = 10;
==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts (1 errors) ====
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"' has no default export or export assignment.

View File

@ -0,0 +1,12 @@
//// [tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.ts] ////
//// [es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts]
export var a = 10;
//// [es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts]
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0";
//// [es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.js]
exports.a = 10;
//// [es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.js]

View File

@ -0,0 +1,11 @@
tests/cases/compiler/es6ImportDefaultBindingInEs5_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingInEs5_0"' has no default export or export assignment.
==== tests/cases/compiler/es6ImportDefaultBindingInEs5_0.ts (0 errors) ====
export var a = 10;
==== tests/cases/compiler/es6ImportDefaultBindingInEs5_1.ts (1 errors) ====
import defaultBinding from "es6ImportDefaultBindingInEs5_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingInEs5_0"' has no default export or export assignment.

View File

@ -0,0 +1,12 @@
//// [tests/cases/compiler/es6ImportDefaultBindingInEs5.ts] ////
//// [es6ImportDefaultBindingInEs5_0.ts]
export var a = 10;
//// [es6ImportDefaultBindingInEs5_1.ts]
import defaultBinding from "es6ImportDefaultBindingInEs5_0";
//// [es6ImportDefaultBindingInEs5_0.js]
exports.a = 10;
//// [es6ImportDefaultBindingInEs5_1.js]

View File

@ -0,0 +1,12 @@
//// [tests/cases/compiler/es6ImportNameSpaceImport.ts] ////
//// [es6ImportNameSpaceImport_0.ts]
export var a = 10;
//// [es6ImportNameSpaceImport_1.ts]
import * as nameSpaceBinding from "es6ImportNameSpaceImport_0";
//// [es6ImportNameSpaceImport_0.js]
exports.a = 10;
//// [es6ImportNameSpaceImport_1.js]

View File

@ -0,0 +1,9 @@
=== tests/cases/compiler/es6ImportNameSpaceImport_0.ts ===
export var a = 10;
>a : number
=== tests/cases/compiler/es6ImportNameSpaceImport_1.ts ===
import * as nameSpaceBinding from "es6ImportNameSpaceImport_0";
>nameSpaceBinding : typeof nameSpaceBinding

View File

@ -0,0 +1,12 @@
//// [tests/cases/compiler/es6ImportNameSpaceImportInEs5.ts] ////
//// [es6ImportNameSpaceImportInEs5_0.ts]
export var a = 10;
//// [es6ImportNameSpaceImportInEs5_1.ts]
import * as nameSpaceBinding from "es6ImportNameSpaceImportInEs5_0";
//// [es6ImportNameSpaceImportInEs5_0.js]
exports.a = 10;
//// [es6ImportNameSpaceImportInEs5_1.js]

View File

@ -0,0 +1,9 @@
=== tests/cases/compiler/es6ImportNameSpaceImportInEs5_0.ts ===
export var a = 10;
>a : number
=== tests/cases/compiler/es6ImportNameSpaceImportInEs5_1.ts ===
import * as nameSpaceBinding from "es6ImportNameSpaceImportInEs5_0";
>nameSpaceBinding : typeof nameSpaceBinding

View File

@ -0,0 +1,27 @@
//// [tests/cases/compiler/es6ImportNamedImport.ts] ////
//// [es6ImportNamedImport_0.ts]
export var a = 10;
export var x = a;
export var m = a;
export var a1 = 10;
export var x1 = 10;
//// [es6ImportNamedImport_1.ts]
import { } from "es6ImportNamedImport_0";
import { a } from "es6ImportNamedImport_0";
import { a as b } from "es6ImportNamedImport_0";
import { x, a as y } from "es6ImportNamedImport_0";
import { x as z, } from "es6ImportNamedImport_0";
import { m, } from "es6ImportNamedImport_0";
import { a1, x1 } from "es6ImportNamedImport_0";
import { a1 as a11, x1 as x11 } from "es6ImportNamedImport_0";
//// [es6ImportNamedImport_0.js]
exports.a = 10;
exports.x = exports.a;
exports.m = exports.a;
exports.a1 = 10;
exports.x1 = 10;
//// [es6ImportNamedImport_1.js]

View File

@ -0,0 +1,50 @@
=== tests/cases/compiler/es6ImportNamedImport_0.ts ===
export var a = 10;
>a : number
export var x = a;
>x : number
>a : number
export var m = a;
>m : number
>a : number
export var a1 = 10;
>a1 : number
export var x1 = 10;
>x1 : number
=== tests/cases/compiler/es6ImportNamedImport_1.ts ===
import { } from "es6ImportNamedImport_0";
import { a } from "es6ImportNamedImport_0";
>a : number
import { a as b } from "es6ImportNamedImport_0";
>a : unknown
>b : number
import { x, a as y } from "es6ImportNamedImport_0";
>x : number
>a : unknown
>y : number
import { x as z, } from "es6ImportNamedImport_0";
>x : unknown
>z : number
import { m, } from "es6ImportNamedImport_0";
>m : number
import { a1, x1 } from "es6ImportNamedImport_0";
>a1 : number
>x1 : number
import { a1 as a11, x1 as x11 } from "es6ImportNamedImport_0";
>a1 : unknown
>a11 : number
>x1 : unknown
>x11 : number

View File

@ -0,0 +1,48 @@
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(2,10): error TS2300: Duplicate identifier 'yield'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(2,23): error TS2307: Cannot find external module 'somemodule'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,10): error TS1003: Identifier expected.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,10): error TS2300: Duplicate identifier 'default'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,25): error TS2307: Cannot find external module 'somemodule'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,19): error TS1003: Identifier expected.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,19): error TS2300: Duplicate identifier 'default'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,34): error TS2307: Cannot find external module 'somemodule'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(5,21): error TS2300: Duplicate identifier 'yield'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(5,34): error TS2307: Cannot find external module 'somemodule'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,21): error TS1003: Identifier expected.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,21): error TS2300: Duplicate identifier 'default'.
tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,36): error TS2307: Cannot find external module 'somemodule'.
==== tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts (13 errors) ====
import { yield } from "somemodule"; // Allowed
~~~~~
!!! error TS2300: Duplicate identifier 'yield'.
~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'somemodule'.
import { default } from "somemodule"; // Error - as this is keyword that is not allowed as identifier
~~~~~~~
!!! error TS1003: Identifier expected.
~~~~~~~
!!! error TS2300: Duplicate identifier 'default'.
~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'somemodule'.
import { yield as default } from "somemodule"; // error to use default as binding name
~~~~~~~
!!! error TS1003: Identifier expected.
~~~~~~~
!!! error TS2300: Duplicate identifier 'default'.
~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'somemodule'.
import { default as yield } from "somemodule"; // no error
~~~~~
!!! error TS2300: Duplicate identifier 'yield'.
~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'somemodule'.
import { default as default } from "somemodule"; // default as is ok, error of default binding name
~~~~~~~
!!! error TS1003: Identifier expected.
~~~~~~~
!!! error TS2300: Duplicate identifier 'default'.
~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'somemodule'.

View File

@ -0,0 +1,9 @@
//// [es6ImportNamedImportIdentifiersParsing.ts]
import { yield } from "somemodule"; // Allowed
import { default } from "somemodule"; // Error - as this is keyword that is not allowed as identifier
import { yield as default } from "somemodule"; // error to use default as binding name
import { default as yield } from "somemodule"; // no error
import { default as default } from "somemodule"; // default as is ok, error of default binding name
//// [es6ImportNamedImportIdentifiersParsing.js]

View File

@ -0,0 +1,27 @@
//// [tests/cases/compiler/es6ImportNamedImportInEs5.ts] ////
//// [es6ImportNamedImportInEs5_0.ts]
export var a = 10;
export var x = a;
export var m = a;
export var a1 = 10;
export var x1 = 10;
//// [es6ImportNamedImportInEs5_1.ts]
import { } from "es6ImportNamedImportInEs5_0";
import { a } from "es6ImportNamedImportInEs5_0";
import { a as b } from "es6ImportNamedImportInEs5_0";
import { x, a as y } from "es6ImportNamedImportInEs5_0";
import { x as z, } from "es6ImportNamedImportInEs5_0";
import { m, } from "es6ImportNamedImportInEs5_0";
import { a1, x1 } from "es6ImportNamedImportInEs5_0";
import { a1 as a11, x1 as x11 } from "es6ImportNamedImportInEs5_0";
//// [es6ImportNamedImportInEs5_0.js]
exports.a = 10;
exports.x = exports.a;
exports.m = exports.a;
exports.a1 = 10;
exports.x1 = 10;
//// [es6ImportNamedImportInEs5_1.js]

View File

@ -0,0 +1,50 @@
=== tests/cases/compiler/es6ImportNamedImportInEs5_0.ts ===
export var a = 10;
>a : number
export var x = a;
>x : number
>a : number
export var m = a;
>m : number
>a : number
export var a1 = 10;
>a1 : number
export var x1 = 10;
>x1 : number
=== tests/cases/compiler/es6ImportNamedImportInEs5_1.ts ===
import { } from "es6ImportNamedImportInEs5_0";
import { a } from "es6ImportNamedImportInEs5_0";
>a : number
import { a as b } from "es6ImportNamedImportInEs5_0";
>a : unknown
>b : number
import { x, a as y } from "es6ImportNamedImportInEs5_0";
>x : number
>a : unknown
>y : number
import { x as z, } from "es6ImportNamedImportInEs5_0";
>x : unknown
>z : number
import { m, } from "es6ImportNamedImportInEs5_0";
>m : number
import { a1, x1 } from "es6ImportNamedImportInEs5_0";
>a1 : number
>x1 : number
import { a1 as a11, x1 as x11 } from "es6ImportNamedImportInEs5_0";
>a1 : unknown
>a11 : number
>x1 : unknown
>x11 : number

View File

@ -0,0 +1,55 @@
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,10): error TS1003: Identifier expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,10): error TS1141: String literal expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,12): error TS1109: Expression expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,14): error TS2304: Cannot find name 'from'.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,19): error TS1005: ';' expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(2,8): error TS1192: External module '"tests/cases/compiler/es6ImportNamedImportParsingError_0"' has no default export or export assignment.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(2,24): error TS1005: '{' expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,8): error TS1128: Declaration or statement expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,16): error TS2304: Cannot find name 'from'.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,21): error TS1005: ';' expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,13): error TS1005: 'from' expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,13): error TS1141: String literal expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,20): error TS1005: ';' expected.
==== tests/cases/compiler/es6ImportNamedImportParsingError_0.ts (0 errors) ====
export var a = 10;
export var x = a;
export var m = a;
==== tests/cases/compiler/es6ImportNamedImportParsingError_1.ts (14 errors) ====
import { * } from "es6ImportNamedImportParsingError_0";
~
!!! error TS1003: Identifier expected.
~
!!! error TS1141: String literal expected.
~
!!! error TS1109: Expression expected.
~~~~
!!! error TS2304: Cannot find name 'from'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1005: ';' expected.
import defaultBinding, from "es6ImportNamedImportParsingError_0";
~~~~~~~~~~~~~~
!!! error TS1192: External module '"tests/cases/compiler/es6ImportNamedImportParsingError_0"' has no default export or export assignment.
~~~~
!!! error TS1005: '{' expected.
import , { a } from "es6ImportNamedImportParsingError_0";
~~~~~~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS1128: Declaration or statement expected.
~~~~
!!! error TS2304: Cannot find name 'from'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1005: ';' expected.
import { a }, from "es6ImportNamedImportParsingError_0";
~
!!! error TS1005: 'from' expected.
~~~~~~
!!! error TS1141: String literal expected.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1005: ';' expected.

View File

@ -0,0 +1,28 @@
//// [tests/cases/compiler/es6ImportNamedImportParsingError.ts] ////
//// [es6ImportNamedImportParsingError_0.ts]
export var a = 10;
export var x = a;
export var m = a;
//// [es6ImportNamedImportParsingError_1.ts]
import { * } from "es6ImportNamedImportParsingError_0";
import defaultBinding, from "es6ImportNamedImportParsingError_0";
import , { a } from "es6ImportNamedImportParsingError_0";
import { a }, from "es6ImportNamedImportParsingError_0";
//// [es6ImportNamedImportParsingError_0.js]
exports.a = 10;
exports.x = exports.a;
exports.m = exports.a;
//// [es6ImportNamedImportParsingError_1.js]
from;
"es6ImportNamedImportParsingError_0";
{
_module_1.a;
}
from;
"es6ImportNamedImportParsingError_0";
var _module_1 = require();
"es6ImportNamedImportParsingError_0";

View File

@ -0,0 +1,8 @@
tests/cases/compiler/es6ImportParseErrors.ts(2,1): error TS1128: Declaration or statement expected.
==== tests/cases/compiler/es6ImportParseErrors.ts (1 errors) ====
import 10;
~~~~~~
!!! error TS1128: Declaration or statement expected.

View File

@ -0,0 +1,6 @@
//// [es6ImportParseErrors.ts]
import 10;
//// [es6ImportParseErrors.js]
10;

View File

@ -0,0 +1,13 @@
//// [tests/cases/compiler/es6ImportWithoutFromClause.ts] ////
//// [es6ImportWithoutFromClause_0.ts]
export var a = 10;
//// [es6ImportWithoutFromClause_1.ts]
import "es6ImportWithoutFromClause_0";
//// [es6ImportWithoutFromClause_0.js]
exports.a = 10;
//// [es6ImportWithoutFromClause_1.js]
require("es6ImportWithoutFromClause_0");

View File

@ -0,0 +1,8 @@
=== tests/cases/compiler/es6ImportWithoutFromClause_0.ts ===
export var a = 10;
>a : number
=== tests/cases/compiler/es6ImportWithoutFromClause_1.ts ===
import "es6ImportWithoutFromClause_0";
No type information for this code.

View File

@ -0,0 +1,13 @@
//// [tests/cases/compiler/es6ImportWithoutFromClauseInEs5.ts] ////
//// [es6ImportWithoutFromClauseInEs5_0.ts]
export var a = 10;
//// [es6ImportWithoutFromClauseInEs5_1.ts]
import "es6ImportWithoutFromClauseInEs5_0";
//// [es6ImportWithoutFromClauseInEs5_0.js]
exports.a = 10;
//// [es6ImportWithoutFromClauseInEs5_1.js]
require("es6ImportWithoutFromClauseInEs5_0");

View File

@ -0,0 +1,8 @@
=== tests/cases/compiler/es6ImportWithoutFromClauseInEs5_0.ts ===
export var a = 10;
>a : number
=== tests/cases/compiler/es6ImportWithoutFromClauseInEs5_1.ts ===
import "es6ImportWithoutFromClauseInEs5_0";
No type information for this code.

View File

@ -143,8 +143,8 @@ var moduleType1;
moduleType1.baz1;
})(moduleType1 || (moduleType1 = {}));
var moduleType\u0032;
(function (moduleType\u0032) {
moduleType\u0032.baz2;
(function (moduleType2) {
moduleType2.baz2;
})(moduleType\u0032 || (moduleType\u0032 = {}));
moduleType1.baz1 = 3;
moduleType\u0031.baz1 = 3;

View File

@ -12,6 +12,5 @@ export module myModule {
//// [importInsideModule_file2.js]
var myModule;
(function (myModule) {
var foo = require("importInsideModule_file1");
var a = foo.x;
})(myModule = exports.myModule || (exports.myModule = {}));

View File

@ -80,59 +80,59 @@ var schema;
})(schema || (schema = {}));
// Constructor types
var schema;
(function (_schema) {
(function (_schema_1) {
function createValidator2(schema) {
return undefined;
}
_schema.createValidator2 = createValidator2;
_schema_1.createValidator2 = createValidator2;
})(schema || (schema = {}));
// union types
var schema;
(function (_schema) {
(function (_schema_2) {
function createValidator3(schema) {
return undefined;
}
_schema.createValidator3 = createValidator3;
_schema_2.createValidator3 = createValidator3;
})(schema || (schema = {}));
// Array types
var schema;
(function (_schema) {
(function (_schema_3) {
function createValidator4(schema) {
return undefined;
}
_schema.createValidator4 = createValidator4;
_schema_3.createValidator4 = createValidator4;
})(schema || (schema = {}));
// TypeLiterals
var schema;
(function (_schema) {
(function (_schema_4) {
function createValidator5(schema) {
return undefined;
}
_schema.createValidator5 = createValidator5;
_schema_4.createValidator5 = createValidator5;
})(schema || (schema = {}));
// Tuple types
var schema;
(function (_schema) {
(function (_schema_5) {
function createValidator6(schema) {
return undefined;
}
_schema.createValidator6 = createValidator6;
_schema_5.createValidator6 = createValidator6;
})(schema || (schema = {}));
// Paren Types
var schema;
(function (_schema) {
(function (_schema_6) {
function createValidator7(schema) {
return undefined;
}
_schema.createValidator7 = createValidator7;
_schema_6.createValidator7 = createValidator7;
})(schema || (schema = {}));
// Type reference
var schema;
(function (_schema) {
(function (_schema_7) {
function createValidator8(schema) {
return undefined;
}
_schema.createValidator8 = createValidator8;
_schema_7.createValidator8 = createValidator8;
})(schema || (schema = {}));
var schema;
(function (schema) {

View File

@ -30,10 +30,10 @@ var Z;
var A;
(function (A) {
var M;
(function (M) {
(function (_M) {
function bar() {
}
M.bar = bar;
_M.bar = bar;
M.bar(); // Should call Z.M.bar
})(M = A.M || (A.M = {}));
})(A || (A = {}));

View File

@ -24,9 +24,9 @@ var Z;
var A;
(function (A) {
var M;
(function (M) {
(function (_M) {
function bar() {
}
M.bar = bar;
_M.bar = bar;
})(M = A.M || (A.M = {}));
})(A || (A = {}));

View File

@ -48,7 +48,7 @@ module D {
//// [nameCollision.js]
var A;
(function (__A) {
(function (_A_1) {
// these 2 statements force an underscore before the 'A'
// in the generated function call.
var A = 12;
@ -83,15 +83,15 @@ var X;
})(Y = _X.Y || (_X.Y = {}));
})(X || (X = {}));
var Y;
(function (_Y) {
(function (_Y_1) {
var Y;
(function (_Y) {
(function (_Y_2) {
(function (Y) {
Y[Y["Red"] = 0] = "Red";
Y[Y["Blue"] = 1] = "Blue";
})(_Y.Y || (_Y.Y = {}));
var Y = _Y.Y;
})(Y = _Y.Y || (_Y.Y = {}));
})(_Y_2.Y || (_Y_2.Y = {}));
var Y = _Y_2.Y;
})(Y = _Y_1.Y || (_Y_1.Y = {}));
})(Y || (Y = {}));
// no collision, since interface doesn't
// generate code.

View File

@ -7,9 +7,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(69,37): error TS1147: Import
tests/cases/compiler/privacyGloImportParseErrors.ts(69,37): error TS2307: Cannot find external module 'm1_M4_private'.
tests/cases/compiler/privacyGloImportParseErrors.ts(80,35): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'.
tests/cases/compiler/privacyGloImportParseErrors.ts(81,43): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyGloImportParseErrors.ts(81,43): error TS2307: Cannot find external module 'm1_M3_public'.
tests/cases/compiler/privacyGloImportParseErrors.ts(82,43): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyGloImportParseErrors.ts(82,43): error TS2307: Cannot find external module 'm1_M4_private'.
tests/cases/compiler/privacyGloImportParseErrors.ts(121,38): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyGloImportParseErrors.ts(125,45): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyGloImportParseErrors.ts(133,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
@ -20,7 +18,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(146,25): error TS1147: Impor
tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in an internal module cannot reference an external module.
==== tests/cases/compiler/privacyGloImportParseErrors.ts (20 errors) ====
==== tests/cases/compiler/privacyGloImportParseErrors.ts (18 errors) ====
module m1 {
export module m1_M1_public {
export class c1 {
@ -120,13 +118,9 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor
export import m1_im3_public = require("m1_M3_public");
~~~~~~~~~~~~~~
!!! error TS1147: Import declarations in an internal module cannot reference an external module.
~~~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'm1_M3_public'.
export import m1_im4_public = require("m1_M4_private");
~~~~~~~~~~~~~~~
!!! error TS1147: Import declarations in an internal module cannot reference an external module.
~~~~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'm1_M4_private'.
}
module glo_M1_public {

View File

@ -203,7 +203,6 @@ var m1;
var m1_im2_private_v2_private = new m1_im2_private.c1();
var m1_im2_private_v3_private = m1_im2_private.f1;
var m1_im2_private_v4_private = m1_im2_private.f1();
var m1_im3_private = require("m1_M3_public");
m1.m1_im3_private_v1_public = m1_im3_private.c1;
m1.m1_im3_private_v2_public = new m1_im3_private.c1();
m1.m1_im3_private_v3_public = m1_im3_private.f1;
@ -212,7 +211,6 @@ var m1;
var m1_im3_private_v2_private = new m1_im3_private.c1();
var m1_im3_private_v3_private = m1_im3_private.f1;
var m1_im3_private_v4_private = m1_im3_private.f1();
var m1_im4_private = require("m1_M4_private");
m1.m1_im4_private_v1_public = m1_im4_private.c1;
m1.m1_im4_private_v2_public = new m1_im4_private.c1();
m1.m1_im4_private_v3_public = m1_im4_private.f1;
@ -240,7 +238,7 @@ var glo_M1_public;
glo_M1_public.v2;
})(glo_M1_public || (glo_M1_public = {}));
var m2;
(function (m2) {
(function (_m2) {
var m4;
(function (m4) {
var a = 10;

View File

@ -5,9 +5,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS2307: Cannot fi
tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS2307: Cannot find external module 'm1_M4_private'.
tests/cases/compiler/privacyImportParseErrors.ts(81,43): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyImportParseErrors.ts(81,43): error TS2307: Cannot find external module 'm1_M3_public'.
tests/cases/compiler/privacyImportParseErrors.ts(82,43): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyImportParseErrors.ts(82,43): error TS2307: Cannot find external module 'm1_M4_private'.
tests/cases/compiler/privacyImportParseErrors.ts(106,27): error TS2435: Ambient external modules cannot be nested in other modules.
tests/cases/compiler/privacyImportParseErrors.ts(114,20): error TS2435: Ambient external modules cannot be nested in other modules.
tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS1147: Import declarations in an internal module cannot reference an external module.
@ -15,9 +13,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS2307: Cannot f
tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS2307: Cannot find external module 'm2_M4_private'.
tests/cases/compiler/privacyImportParseErrors.ts(166,43): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyImportParseErrors.ts(166,43): error TS2307: Cannot find external module 'm2_M3_public'.
tests/cases/compiler/privacyImportParseErrors.ts(167,43): error TS1147: Import declarations in an internal module cannot reference an external module.
tests/cases/compiler/privacyImportParseErrors.ts(167,43): error TS2307: Cannot find external module 'm2_M4_private'.
tests/cases/compiler/privacyImportParseErrors.ts(180,23): error TS2435: Ambient external modules cannot be nested in other modules.
tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2435: Ambient external modules cannot be nested in other modules.
tests/cases/compiler/privacyImportParseErrors.ts(218,34): error TS2307: Cannot find external module 'glo_M2_public'.
@ -53,7 +49,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(350,25): error TS1147: Import d
tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in an internal module cannot reference an external module.
==== tests/cases/compiler/privacyImportParseErrors.ts (53 errors) ====
==== tests/cases/compiler/privacyImportParseErrors.ts (49 errors) ====
export module m1 {
export module m1_M1_public {
export class c1 {
@ -149,13 +145,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d
export import m1_im3_public = require("m1_M3_public");
~~~~~~~~~~~~~~
!!! error TS1147: Import declarations in an internal module cannot reference an external module.
~~~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'm1_M3_public'.
export import m1_im4_public = require("m1_M4_private");
~~~~~~~~~~~~~~~
!!! error TS1147: Import declarations in an internal module cannot reference an external module.
~~~~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'm1_M4_private'.
}
module m2 {
@ -254,13 +246,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d
export import m1_im3_public = require("m2_M3_public");
~~~~~~~~~~~~~~
!!! error TS1147: Import declarations in an internal module cannot reference an external module.
~~~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'm2_M3_public'.
export import m1_im4_public = require("m2_M4_private");
~~~~~~~~~~~~~~~
!!! error TS1147: Import declarations in an internal module cannot reference an external module.
~~~~~~~~~~~~~~~
!!! error TS2307: Cannot find external module 'm2_M4_private'.
}
export module glo_M1_public {

View File

@ -407,7 +407,6 @@ var m1;
var m1_im2_private_v2_private = new m1_im2_private.c1();
var m1_im2_private_v3_private = m1_im2_private.f1;
var m1_im2_private_v4_private = m1_im2_private.f1();
var m1_im3_private = require("m1_M3_public");
m1.m1_im3_private_v1_public = m1_im3_private.c1;
m1.m1_im3_private_v2_public = new m1_im3_private.c1();
m1.m1_im3_private_v3_public = m1_im3_private.f1;
@ -416,7 +415,6 @@ var m1;
var m1_im3_private_v2_private = new m1_im3_private.c1();
var m1_im3_private_v3_private = m1_im3_private.f1;
var m1_im3_private_v4_private = m1_im3_private.f1();
var m1_im4_private = require("m1_M4_private");
m1.m1_im4_private_v1_public = m1_im4_private.c1;
m1.m1_im4_private_v2_public = new m1_im4_private.c1();
m1.m1_im4_private_v3_public = m1_im4_private.f1;
@ -478,7 +476,6 @@ var m2;
var m1_im2_private_v2_private = new m1_im2_private.c1();
var m1_im2_private_v3_private = m1_im2_private.f1;
var m1_im2_private_v4_private = m1_im2_private.f1();
var m1_im3_private = require("m2_M3_public");
m2.m1_im3_private_v1_public = m1_im3_private.c1;
m2.m1_im3_private_v2_public = new m1_im3_private.c1();
m2.m1_im3_private_v3_public = m1_im3_private.f1;
@ -487,7 +484,6 @@ var m2;
var m1_im3_private_v2_private = new m1_im3_private.c1();
var m1_im3_private_v3_private = m1_im3_private.f1;
var m1_im3_private_v4_private = m1_im3_private.f1();
var m1_im4_private = require("m2_M4_private");
m2.m1_im4_private_v1_public = m1_im4_private.c1;
m2.m1_im4_private_v2_public = new m1_im4_private.c1();
m2.m1_im4_private_v3_public = m1_im4_private.f1;
@ -570,14 +566,14 @@ var glo_im4_private_v4_private = glo_im4_private.f1();
exports.glo_im1_public = glo_M1_public;
exports.glo_im2_public = glo_M3_private;
var m2;
(function (m2) {
(function (_m2) {
var m4;
(function (m4) {
var a = 10;
})(m4 || (m4 = {}));
})(m2 || (m2 = {}));
var m3;
(function (m3) {
(function (_m3) {
var m4;
(function (m4) {
var a = 10;

View File

@ -6,7 +6,6 @@ var __extends = this.__extends || function (d, b) {
};
var m2;
(function (m2) {
m2.mExported = require("mExported");
m2.c1 = new m2.mExported.me.class1;
function f1() {
return new m2.mExported.me.class1();
@ -33,7 +32,6 @@ var m2;
}
return class2;
})(mExported.me.class1);
var mNonExported = require("mNonExported");
m2.c3 = new mNonExported.mne.class1;
function f3() {
return new mNonExported.mne.class1();

View File

@ -6,7 +6,6 @@ var __extends = this.__extends || function (d, b) {
};
var m2;
(function (m2) {
m2.mExported = require("mExported");
m2.c1 = new m2.mExported.me.class1;
function f1() {
return new m2.mExported.me.class1();
@ -33,7 +32,6 @@ var m2;
}
return class2;
})(mExported.me.class1);
var mNonExported = require("mNonExported");
m2.c3 = new mNonExported.mne.class1;
function f3() {
return new mNonExported.mne.class1();

View File

@ -116,7 +116,7 @@ var Sample;
var Actions;
(function (Actions) {
var Thing;
(function (_Thing) {
(function (_Thing_1) {
var Find;
(function (Find) {
var StartFindAction = (function () {
@ -129,7 +129,7 @@ var Sample;
return StartFindAction;
})();
Find.StartFindAction = StartFindAction;
})(Find = _Thing.Find || (_Thing.Find = {}));
})(Find = _Thing_1.Find || (_Thing_1.Find = {}));
})(Thing = Actions.Thing || (Actions.Thing = {}));
})(Actions = Sample.Actions || (Sample.Actions = {}));
})(Sample || (Sample = {}));

View File

@ -1,2 +1,2 @@
//// [recursiveClassReferenceTest.js.map]
{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,MAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC,IAAaA,eAAeA;oBAA5BC,SAAaA,eAAeA;oBAQ5BC,CAACA;oBANOD,+BAAKA,GAAZA,cAAiBE,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,GAAfA,eAQZA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,WAAIA,KAAJA,WAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC,IAAaA,UAAUA;gBAKtBC,SALYA,UAAUA,CAKFA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,AADAA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA,IAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBAAAA,CAACA,CAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,GAAVA,UAkBZA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD,IAAM,YAAY;IAAlBe,SAAMA,YAAYA;IAAqEC,CAACA;IAA3CD,sCAAeA,GAAtBA,cAAmCE,MAAMA,CAACA,IAAIA,CAACA,CAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACU,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC,IAAaA,KAAKA;oBACXC,SADMA,KAAKA,CACSA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA,cAA0BI,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,GAALA,KAWZA,CAAAA;gBAEDA,IAAaA,IAAIA;oBAASM,UAAbA,IAAIA,UAAqBA;oBAAtCA,SAAaA,IAAIA;wBAASC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,GAAJA,IAQZA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBV,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"}
{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,QAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC,IAAaA,eAAeA;oBAA5BC,SAAaA,eAAeA;oBAQ5BC,CAACA;oBANOD,+BAAKA,GAAZA,cAAiBE,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,GAAfA,eAQZA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,aAAIA,KAAJA,aAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC,IAAaA,UAAUA;gBAKtBC,SALYA,UAAUA,CAKFA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,AADAA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA,IAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBAAAA,CAACA,CAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,GAAVA,UAkBZA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD,IAAM,YAAY;IAAlBe,SAAMA,YAAYA;IAAqEC,CAACA;IAA3CD,sCAAeA,GAAtBA,cAAmCE,MAAMA,CAACA,IAAIA,CAACA,CAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACU,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC,IAAaA,KAAKA;oBACXC,SADMA,KAAKA,CACSA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA,cAA0BI,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,GAALA,KAWZA,CAAAA;gBAEDA,IAAaA,IAAIA;oBAASM,UAAbA,IAAIA,UAAqBA;oBAAtCA,SAAaA,IAAIA;wBAASC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,GAAJA,IAQZA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBV,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"}

View File

@ -139,7 +139,7 @@ sourceFile:recursiveClassReferenceTest.ts
2 > ^^^^
3 > ^^^^^
4 > ^
5 > ^^^^^^^^^^^->
5 > ^^^^^^^^^^^^^->
1 >.
2 >
3 > Thing
@ -159,16 +159,16 @@ sourceFile:recursiveClassReferenceTest.ts
3 >Emitted(13, 18) Source(32, 28) + SourceIndex(0) name (Sample.Actions)
4 >Emitted(13, 19) Source(42, 2) + SourceIndex(0) name (Sample.Actions)
---
>>> (function (_Thing) {
>>> (function (_Thing_1) {
1->^^^^^^^^
2 > ^^^^^^^^^^^
3 > ^^^^^^
3 > ^^^^^^^^
1->
2 >
3 > Thing
1->Emitted(14, 9) Source(32, 23) + SourceIndex(0) name (Sample.Actions)
2 >Emitted(14, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions)
3 >Emitted(14, 26) Source(32, 28) + SourceIndex(0) name (Sample.Actions)
3 >Emitted(14, 28) Source(32, 28) + SourceIndex(0) name (Sample.Actions)
---
>>> var Find;
1 >^^^^^^^^^^^^
@ -372,7 +372,7 @@ sourceFile:recursiveClassReferenceTest.ts
3 > ^^^
4 > ^^^^^^^^^^^^^^^
5 > ^
6 > ^^^->
6 > ^^^^^^^->
1->
2 > StartFindAction
3 >
@ -392,17 +392,16 @@ sourceFile:recursiveClassReferenceTest.ts
4 >Emitted(26, 55) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find)
5 >Emitted(26, 56) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find)
---
>>> })(Find = _Thing.Find || (_Thing.Find = {}));
>>> })(Find = _Thing_1.Find || (_Thing_1.Find = {}));
1->^^^^^^^^^^^^
2 > ^
3 > ^^
4 > ^^^^
5 > ^^^
6 > ^^^^^^^^^^^
7 > ^^^^^
8 > ^^^^^^^^^^^
9 > ^^^^^^^^
10> ^^->
6 > ^^^^^^^^^^^^^
7 > ^^^^^
8 > ^^^^^^^^^^^^^
9 > ^^^^^^^^
1->
>
2 > }
@ -410,31 +409,31 @@ sourceFile:recursiveClassReferenceTest.ts
4 > Find
5 >
6 > Find
7 >
8 > Find
9 > {
> export class StartFindAction implements Sample.Thing.IAction {
>
> public getId() { return "yo"; }
>
> public run(Thing:Sample.Thing.ICodeThing):boolean {
>
> return true;
> }
> }
> }
7 >
8 > Find
9 > {
> export class StartFindAction implements Sample.Thing.IAction {
>
> public getId() { return "yo"; }
>
> public run(Thing:Sample.Thing.ICodeThing):boolean {
>
> return true;
> }
> }
> }
1->Emitted(27, 13) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing.Find)
2 >Emitted(27, 14) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find)
3 >Emitted(27, 16) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing)
4 >Emitted(27, 20) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
5 >Emitted(27, 23) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing)
6 >Emitted(27, 34) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
7 >Emitted(27, 39) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing)
8 >Emitted(27, 50) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
9 >Emitted(27, 58) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing)
6 >Emitted(27, 36) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
7 >Emitted(27, 41) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing)
8 >Emitted(27, 54) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
9 >Emitted(27, 62) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing)
---
>>> })(Thing = Actions.Thing || (Actions.Thing = {}));
1->^^^^^^^^
1 >^^^^^^^^
2 > ^
3 > ^^
4 > ^^^^^
@ -444,7 +443,7 @@ sourceFile:recursiveClassReferenceTest.ts
8 > ^^^^^^^^^^^^^
9 > ^^^^^^^^
10> ^->
1->
1 >
2 > }
3 >
4 > Thing
@ -463,7 +462,7 @@ sourceFile:recursiveClassReferenceTest.ts
> }
> }
> }
1->Emitted(28, 9) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing)
1 >Emitted(28, 9) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing)
2 >Emitted(28, 10) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing)
3 >Emitted(28, 12) Source(32, 23) + SourceIndex(0) name (Sample.Actions)
4 >Emitted(28, 17) Source(32, 28) + SourceIndex(0) name (Sample.Actions)

View File

@ -0,0 +1,8 @@
// @target: es6
// @module: commonjs
// @filename: es6ImportDefaultBinding_0.ts
export var a = 10;
// @filename: es6ImportDefaultBinding_1.ts
import defaultBinding from "es6ImportDefaultBinding_0";

View File

@ -0,0 +1,15 @@
// @target: es6
// @module: commonjs
// @filename: es6ImportDefaultBindingFollowedWithNamedImport_0.ts
export var a = 10;
export var x = a;
export var m = a;
// @filename: es6ImportDefaultBindingFollowedWithNamedImport_1.ts
import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImport_0";
import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImport_0";

View File

@ -0,0 +1,15 @@
// @target: es5
// @module: commonjs
// @filename: es6ImportDefaultBindingFollowedWithNamedImportInEs5_0.ts
export var a = 10;
export var x = a;
export var m = a;
// @filename: es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts
import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";
import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0";

View File

@ -0,0 +1,8 @@
// @target: es6
// @module: commonjs
// @filename: es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts
export var a = 10;
// @filename: es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0";

View File

@ -0,0 +1,8 @@
// @target: es5
// @module: commonjs
// @filename: es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts
export var a = 10;
// @filename: es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts
import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0";

View File

@ -0,0 +1,8 @@
// @target: es5
// @module: commonjs
// @filename: es6ImportDefaultBindingInEs5_0.ts
export var a = 10;
// @filename: es6ImportDefaultBindingInEs5_1.ts
import defaultBinding from "es6ImportDefaultBindingInEs5_0";

View File

@ -0,0 +1,8 @@
// @target: es6
// @module: commonjs
// @filename: es6ImportNameSpaceImport_0.ts
export var a = 10;
// @filename: es6ImportNameSpaceImport_1.ts
import * as nameSpaceBinding from "es6ImportNameSpaceImport_0";

View File

@ -0,0 +1,8 @@
// @target: es5
// @module: commonjs
// @filename: es6ImportNameSpaceImportInEs5_0.ts
export var a = 10;
// @filename: es6ImportNameSpaceImportInEs5_1.ts
import * as nameSpaceBinding from "es6ImportNameSpaceImportInEs5_0";

View File

@ -0,0 +1,19 @@
// @target: es6
// @module: commonjs
// @filename: es6ImportNamedImport_0.ts
export var a = 10;
export var x = a;
export var m = a;
export var a1 = 10;
export var x1 = 10;
// @filename: es6ImportNamedImport_1.ts
import { } from "es6ImportNamedImport_0";
import { a } from "es6ImportNamedImport_0";
import { a as b } from "es6ImportNamedImport_0";
import { x, a as y } from "es6ImportNamedImport_0";
import { x as z, } from "es6ImportNamedImport_0";
import { m, } from "es6ImportNamedImport_0";
import { a1, x1 } from "es6ImportNamedImport_0";
import { a1 as a11, x1 as x11 } from "es6ImportNamedImport_0";

View File

@ -0,0 +1,8 @@
// @target: es6
// @module: commonjs
import { yield } from "somemodule"; // Allowed
import { default } from "somemodule"; // Error - as this is keyword that is not allowed as identifier
import { yield as default } from "somemodule"; // error to use default as binding name
import { default as yield } from "somemodule"; // no error
import { default as default } from "somemodule"; // default as is ok, error of default binding name

View File

@ -0,0 +1,19 @@
// @target: es5
// @module: commonjs
// @filename: es6ImportNamedImportInEs5_0.ts
export var a = 10;
export var x = a;
export var m = a;
export var a1 = 10;
export var x1 = 10;
// @filename: es6ImportNamedImportInEs5_1.ts
import { } from "es6ImportNamedImportInEs5_0";
import { a } from "es6ImportNamedImportInEs5_0";
import { a as b } from "es6ImportNamedImportInEs5_0";
import { x, a as y } from "es6ImportNamedImportInEs5_0";
import { x as z, } from "es6ImportNamedImportInEs5_0";
import { m, } from "es6ImportNamedImportInEs5_0";
import { a1, x1 } from "es6ImportNamedImportInEs5_0";
import { a1 as a11, x1 as x11 } from "es6ImportNamedImportInEs5_0";

View File

@ -0,0 +1,13 @@
// @target: es6
// @module: commonjs
// @filename: es6ImportNamedImportParsingError_0.ts
export var a = 10;
export var x = a;
export var m = a;
// @filename: es6ImportNamedImportParsingError_1.ts
import { * } from "es6ImportNamedImportParsingError_0";
import defaultBinding, from "es6ImportNamedImportParsingError_0";
import , { a } from "es6ImportNamedImportParsingError_0";
import { a }, from "es6ImportNamedImportParsingError_0";

View File

@ -0,0 +1,4 @@
// @target: es6
// @module: commonjs
import 10;

View File

@ -0,0 +1,8 @@
// @target: es6
// @module: commonjs
// @filename: es6ImportWithoutFromClause_0.ts
export var a = 10;
// @filename: es6ImportWithoutFromClause_1.ts
import "es6ImportWithoutFromClause_0";

View File

@ -0,0 +1,8 @@
// @target: es5
// @module: commonjs
// @filename: es6ImportWithoutFromClauseInEs5_0.ts
export var a = 10;
// @filename: es6ImportWithoutFromClauseInEs5_1.ts
import "es6ImportWithoutFromClauseInEs5_0";