Merge pull request #2197 from Microsoft/exportDefault

Complete support for ES6 modules
This commit is contained in:
Anders Hejlsberg committed 2015-03-06 17:36:33 -08:00
commit 865f67e738
1411 files changed
+16277 -34982

No files matched your search

+33 -16
View File
@@ -120,6 +120,13 @@ module ts {
return "__new";
case SyntaxKind.IndexSignature:
return "__index";
case SyntaxKind.ExportDeclaration:
return "__export";
case SyntaxKind.ExportAssignment:
return "default";
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.ClassDeclaration:
return node.flags & NodeFlags.Default ? "default" : undefined;
}
}
@@ -130,7 +137,9 @@ module ts {
function declareSymbol(symbols: SymbolTable, parent: Symbol, node: Declaration, includes: SymbolFlags, excludes: SymbolFlags): Symbol {
Debug.assert(!hasDynamicName(node));
var name = getDeclarationName(node);
// The exported symbol for an export default function/class node is always named "default"
var name = node.flags & NodeFlags.Default && parent ? "default" : getDeclarationName(node);
if (name !== undefined) {
var symbol = hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name));
if (symbol.flags & excludes) {
@@ -145,9 +154,9 @@ module ts {
: Diagnostics.Duplicate_identifier_0;
forEach(symbol.declarations, declaration => {
file.bindDiagnostics.push(createDiagnosticForNode(declaration.name, message, getDisplayName(declaration)));
file.bindDiagnostics.push(createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration)));
});
file.bindDiagnostics.push(createDiagnosticForNode(node.name, message, getDisplayName(node)));
file.bindDiagnostics.push(createDiagnosticForNode(node.name || node, message, getDisplayName(node)));
symbol = createSymbol(0, name);
}
@@ -188,7 +197,7 @@ module ts {
function declareModuleMember(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags) {
var hasExportModifier = getCombinedNodeFlags(node) & NodeFlags.Export;
if (symbolKind & SymbolFlags.Import) {
if (symbolKind & SymbolFlags.Alias) {
if (node.kind === SyntaxKind.ExportSpecifier || (node.kind === SyntaxKind.ImportEqualsDeclaration && hasExportModifier)) {
declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes);
}
@@ -324,13 +333,6 @@ 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 }
@@ -484,19 +486,34 @@ module ts {
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);
bindDeclaration(<Declaration>node, SymbolFlags.Alias, SymbolFlags.AliasExcludes, /*isBlockScopeContainer*/ false);
break;
case SyntaxKind.ImportClause:
if ((<ImportClause>node).name) {
bindDeclaration(<Declaration>node, SymbolFlags.Import, SymbolFlags.ImportExcludes, /*isBlockScopeContainer*/ false);
bindDeclaration(<Declaration>node, SymbolFlags.Alias, SymbolFlags.AliasExcludes, /*isBlockScopeContainer*/ false);
}
else {
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
}
break;
case SyntaxKind.ExportDeclaration:
if (!(<ExportDeclaration>node).exportClause) {
// All export * declarations are collected in an __export symbol
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.ExportStar, 0);
}
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
break;
case SyntaxKind.ExportAssignment:
if ((<ExportAssignment>node).expression.kind === SyntaxKind.Identifier) {
// An export default clause with an identifier exports all meanings of that identifier
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.Alias, SymbolFlags.AliasExcludes);
}
else {
// An export default clause with an expression exports a value
declareSymbol(container.symbol.exports, container.symbol, <Declaration>node, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
}
bindChildren(node, 0, /*isBlockScopeContainer*/ false);
break;
case SyntaxKind.SourceFile:
if (isExternalModule(<SourceFile>node)) {
bindAnonymousDeclaration(<SourceFile>node, SymbolFlags.ValueModule, '"' + removeFileExtension((<SourceFile>node).fileName) + '"', /*isBlockScopeContainer*/ true);
+286 -275
View File
@@ -54,7 +54,7 @@ module ts {
isValidPropertyAccess,
getSignatureFromDeclaration,
isImplementationOfOverload,
getAliasedSymbol: resolveImport,
getAliasedSymbol: resolveAlias,
getEmitResolver,
getExportsOfExternalModule,
};
@@ -167,7 +167,7 @@ module ts {
if (flags & SymbolFlags.SetAccessor) result |= SymbolFlags.SetAccessorExcludes;
if (flags & SymbolFlags.TypeParameter) result |= SymbolFlags.TypeParameterExcludes;
if (flags & SymbolFlags.TypeAlias) result |= SymbolFlags.TypeAliasExcludes;
if (flags & SymbolFlags.Import) result |= SymbolFlags.ImportExcludes;
if (flags & SymbolFlags.Alias) result |= SymbolFlags.AliasExcludes;
return result;
}
@@ -248,14 +248,6 @@ module ts {
}
}
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++;
@@ -283,10 +275,9 @@ module ts {
return symbol;
}
if (symbol.flags & SymbolFlags.Import) {
var target = resolveImport(symbol);
// unknown symbol will mean that there were reported error during import resolution
// treat it as positive answer to avoid cascading errors
if (symbol.flags & SymbolFlags.Alias) {
var target = resolveAlias(symbol);
// Unknown symbol means an error occurred in alias resolution, treat it as positive answer to avoid cascading errors
if (target === unknownSymbol || target.flags & meaning) {
return symbol;
}
@@ -333,7 +324,7 @@ module ts {
if (!isExternalModule(<SourceFile>location)) break;
case SyntaxKind.ModuleDeclaration:
if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.ModuleMember)) {
if (!(result.flags & SymbolFlags.Import && getDeclarationOfImportSymbol(result).kind === SyntaxKind.ExportSpecifier)) {
if (!(result.flags & SymbolFlags.Alias && getDeclarationOfAliasSymbol(result).kind === SyntaxKind.ExportSpecifier)) {
break loop;
}
result = undefined;
@@ -456,16 +447,24 @@ module ts {
return result;
}
function isImportSymbolDeclaration(node: Node): boolean {
// An alias symbol is created by one of the following declarations:
// import <symbol> = ...
// import <symbol> from ...
// import * as <symbol> from ...
// import { x as <symbol> } from ...
// export { x as <symbol> } from ...
// export default ...
function isAliasSymbolDeclaration(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;
node.kind === SyntaxKind.ExportSpecifier ||
node.kind === SyntaxKind.ExportAssignment;
}
function getDeclarationOfImportSymbol(symbol: Symbol): Declaration {
return forEach(symbol.declarations, d => isImportSymbolDeclaration(d) ? d : undefined);
function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration {
return forEach(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined);
}
function getTargetOfImportEqualsDeclaration(node: ImportEqualsDeclaration): Symbol {
@@ -502,7 +501,7 @@ module ts {
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);
return symbol.flags & (SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace) ? symbol : resolveAlias(symbol);
}
}
}
@@ -514,7 +513,11 @@ module ts {
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);
resolveEntityName(node.propertyName || node.name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
}
function getTargetOfExportAssignment(node: ExportAssignment): Symbol {
return resolveEntityName(<Identifier>node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
}
function getTargetOfImportDeclaration(node: Declaration): Symbol {
@@ -529,15 +532,17 @@ module ts {
return getTargetOfImportSpecifier(<ImportSpecifier>node);
case SyntaxKind.ExportSpecifier:
return getTargetOfExportSpecifier(<ExportSpecifier>node);
case SyntaxKind.ExportAssignment:
return getTargetOfExportAssignment(<ExportAssignment>node);
}
}
function resolveImport(symbol: Symbol): Symbol {
Debug.assert((symbol.flags & SymbolFlags.Import) !== 0, "Should only get Imports here.");
function resolveAlias(symbol: Symbol): Symbol {
Debug.assert((symbol.flags & SymbolFlags.Alias) !== 0, "Should only get Alias here.");
var links = getSymbolLinks(symbol);
if (!links.target) {
links.target = resolvingSymbol;
var node = getDeclarationOfImportSymbol(symbol);
var node = getDeclarationOfAliasSymbol(symbol);
var target = getTargetOfImportDeclaration(node);
if (links.target === resolvingSymbol) {
links.target = target || unknownSymbol;
@@ -552,6 +557,37 @@ module ts {
return links.target;
}
function markExportAsReferenced(node: ImportEqualsDeclaration | ExportAssignment | ExportSpecifier) {
var symbol = getSymbolOfNode(node);
var target = resolveAlias(symbol);
if (target && target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target)) {
markAliasSymbolAsReferenced(symbol);
}
}
// When an alias symbol is referenced, we need to mark the entity it references as referenced and in turn repeat that until
// we reach a non-alias or an exported entity (which is always considered referenced). We do this by checking the target of
// the alias as an expression (which recursively takes us back here if the target references another alias).
function markAliasSymbolAsReferenced(symbol: Symbol) {
var links = getSymbolLinks(symbol);
if (!links.referenced) {
links.referenced = true;
var node = getDeclarationOfAliasSymbol(symbol);
if (node.kind === SyntaxKind.ExportAssignment) {
// export default <symbol>
checkExpressionCached((<ExportAssignment>node).expression);
}
else if (node.kind === SyntaxKind.ExportSpecifier) {
// export { <symbol> } or export { <symbol> as foo }
checkExpressionCached((<ExportSpecifier>node).propertyName || (<ExportSpecifier>node).name);
}
else if (isInternalModuleImportEqualsDeclaration(node)) {
// import foo = <symbol>
checkExpressionCached(<Expression>(<ImportEqualsDeclaration>node).moduleReference);
}
}
}
// This function is only for imports with entity names
function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, importDeclaration?: ImportEqualsDeclaration): Symbol {
if (!importDeclaration) {
@@ -569,13 +605,13 @@ module ts {
}
// Check for case 1 and 3 in the above example
if (entityName.kind === SyntaxKind.Identifier || entityName.parent.kind === SyntaxKind.QualifiedName) {
return resolveEntityName(importDeclaration, entityName, SymbolFlags.Namespace);
return resolveEntityName(entityName, SymbolFlags.Namespace);
}
else {
// Case 2 in above example
// entityName.kind could be a QualifiedName or a Missing identifier
Debug.assert(entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration);
return resolveEntityName(importDeclaration, entityName, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
return resolveEntityName(entityName, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
}
}
@@ -583,31 +619,31 @@ module ts {
return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol);
}
// Resolves a qualified name and any involved import aliases
function resolveEntityName(location: Node, name: EntityName, meaning: SymbolFlags): Symbol {
// Resolves a qualified name and any involved aliases
function resolveEntityName(name: EntityName, meaning: SymbolFlags): Symbol {
if (getFullWidth(name) === 0) {
return undefined;
}
if (name.kind === SyntaxKind.Identifier) {
var symbol = resolveName(location, (<Identifier>name).text, meaning, Diagnostics.Cannot_find_name_0, <Identifier>name);
var symbol = resolveName(name, (<Identifier>name).text, meaning, Diagnostics.Cannot_find_name_0, <Identifier>name);
if (!symbol) {
return;
return undefined;
}
}
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(getExportsOfSymbol(namespace), (<QualifiedName>name).right.text, meaning);
var namespace = resolveEntityName((<QualifiedName>name).left, SymbolFlags.Namespace);
if (!namespace || namespace === unknownSymbol || getFullWidth((<QualifiedName>name).right) === 0) {
return undefined;
}
var right = (<QualifiedName>name).right;
var symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning);
if (!symbol) {
error(location, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace),
declarationNameToString((<QualifiedName>name).right));
return;
error(right, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right));
return undefined;
}
}
Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0, "Should never get an instantiated symbol here.");
return symbol.flags & meaning ? symbol : resolveImport(symbol);
return symbol.flags & meaning ? symbol : resolveAlias(symbol);
}
function isExternalModuleNameRelative(moduleName: string): boolean {
@@ -654,71 +690,22 @@ module ts {
error(moduleReferenceLiteral, Diagnostics.Cannot_find_external_module_0, moduleName);
}
function getExportAssignmentSymbol(moduleSymbol: Symbol): Symbol {
return moduleSymbol.exports["default"];
}
function getResolvedExportAssignmentSymbol(moduleSymbol: Symbol): Symbol {
var symbol = getExportAssignmentSymbol(moduleSymbol);
if (symbol) {
if (symbol.flags & (SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace)) {
return symbol;
}
if (symbol.flags & SymbolFlags.Import) {
return resolveImport(symbol);
if (symbol.flags & SymbolFlags.Alias) {
return resolveAlias(symbol);
}
}
}
function getExportAssignmentSymbol(symbol: Symbol): Symbol {
checkTypeOfExportAssignmentSymbol(symbol);
return getSymbolLinks(symbol).exportAssignmentSymbol;
}
function checkTypeOfExportAssignmentSymbol(containerSymbol: Symbol): void {
var symbolLinks = getSymbolLinks(containerSymbol);
if (!symbolLinks.exportAssignmentChecked) {
var exportInformation = collectExportInformationForSourceFileOrModule(containerSymbol);
if (exportInformation.exportAssignments.length) {
if (exportInformation.exportAssignments.length > 1) {
// TypeScript 1.0 spec (April 2014): 11.2.4
// It is an error for an external module to contain more than one export assignment.
forEach(exportInformation.exportAssignments, node => error(node, Diagnostics.A_module_cannot_have_more_than_one_export_assignment));
}
var node = exportInformation.exportAssignments[0];
if (exportInformation.hasExportedMember) {
// TypeScript 1.0 spec (April 2014): 11.2.3
// If an external module contains an export assignment it is an error
// for the external module to also contain export declarations.
// The two types of exports are mutually exclusive.
error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
}
if (node.exportName.text) {
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.exportAssignmentChecked = true;
}
}
function collectExportInformationForSourceFileOrModule(symbol: Symbol) {
var seenExportedMember = false;
var result: ExportAssignment[] = [];
forEach(symbol.declarations, declaration => {
var block = <Block>(declaration.kind === SyntaxKind.SourceFile ? declaration : (<ModuleDeclaration>declaration).body);
forEach(block.statements, node => {
if (node.kind === SyntaxKind.ExportAssignment) {
result.push(<ExportAssignment>node);
}
else {
seenExportedMember = seenExportedMember || (node.flags & NodeFlags.Export) !== 0;
}
});
});
return {
hasExportedMember: seenExportedMember,
exportAssignments: result
};
}
function getExportsOfSymbol(symbol: Symbol): SymbolTable {
return symbol.flags & SymbolFlags.Module ? getExportsOfModule(symbol) : symbol.exports;
}
@@ -728,12 +715,31 @@ module ts {
return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol));
}
function extendExportSymbols(target: SymbolTable, source: SymbolTable) {
for (var id in source) {
if (id !== "default" && !hasProperty(target, id)) {
target[id] = source[id];
}
}
}
function getExportsForModule(moduleSymbol: Symbol): SymbolTable {
if (compilerOptions.target < ScriptTarget.ES6) {
// A default export hides all other exports in CommonJS and AMD modules
var defaultSymbol = getExportAssignmentSymbol(moduleSymbol);
if (defaultSymbol) {
return {
"default": defaultSymbol
};
}
}
var result: SymbolTable;
var visitedSymbols: Symbol[] = [];
visit(moduleSymbol);
return result || moduleSymbol.exports;
// The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example,
// module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error.
function visit(symbol: Symbol) {
if (!contains(visitedSymbols, symbol)) {
visitedSymbols.push(symbol);
@@ -741,18 +747,15 @@ module ts {
if (!result) {
result = cloneSymbolTable(moduleSymbol.exports);
}
extendSymbolTable(result, symbol.exports);
extendExportSymbols(result, symbol.exports);
}
// All export * declarations are collected in an __export symbol by the binder
var exportStars = symbol.exports["__export"];
if (exportStars) {
forEach(exportStars.declarations, node => {
visit(resolveExternalModuleName(node, (<ExportDeclaration>node).moduleSpecifier));
});
}
forEach(symbol.declarations, node => {
if (node.kind === SyntaxKind.SourceFile || node.kind === SyntaxKind.ModuleDeclaration) {
forEach((<ExportContainer>node).exportStars, exportStar => {
var moduleSymbol = resolveExternalModuleName(exportStar, exportStar.moduleSpecifier);
if (moduleSymbol) {
visit(moduleSymbol);
}
});
}
});
}
}
}
@@ -788,9 +791,9 @@ module ts {
return true;
}
// If it is an import, then it is a value if the symbol it resolves to is a value.
if (symbol.flags & SymbolFlags.Import) {
return (resolveImport(symbol).flags & SymbolFlags.Value) !== 0;
// If it is an alias, then it is a value if the symbol it resolves to is a value.
if (symbol.flags & SymbolFlags.Alias) {
return (resolveAlias(symbol).flags & SymbolFlags.Value) !== 0;
}
return false;
@@ -932,13 +935,13 @@ module ts {
// Check if symbol is any of the alias
return forEachValue(symbols, symbolFromSymbolTable => {
if (symbolFromSymbolTable.flags & SymbolFlags.Import) {
if (symbolFromSymbolTable.flags & SymbolFlags.Alias) {
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, isExternalModuleImportEqualsDeclaration)) {
var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable);
if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) {
var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) {
return [symbolFromSymbolTable];
}
@@ -974,7 +977,7 @@ module ts {
}
// Qualify if the symbol from symbol table has same meaning as expected
symbolFromSymbolTable = (symbolFromSymbolTable.flags & SymbolFlags.Import) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable;
symbolFromSymbolTable = (symbolFromSymbolTable.flags & SymbolFlags.Alias) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
if (symbolFromSymbolTable.flags & meaning) {
qualify = true;
return true;
@@ -1671,9 +1674,9 @@ module ts {
return true;
}
// if symbolOfNode is import declaration, resolve the symbol declaration and check
if (symbolOfNode.flags & SymbolFlags.Import) {
return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode));
// if symbolOfNode is alias declaration, resolve the symbol declaration and check
if (symbolOfNode.flags & SymbolFlags.Alias) {
return isSymbolUsedInExportAssignment(resolveAlias(symbolOfNode));
}
}
@@ -1683,9 +1686,9 @@ module ts {
return true;
}
if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & SymbolFlags.Import)) {
// if export assigned symbol is import declaration, resolve the import
resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol);
if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & SymbolFlags.Alias)) {
// if export assigned symbol is alias declaration, resolve the alias
resolvedExportSymbol = resolvedExportSymbol || resolveAlias(exportAssignmentSymbol);
if (resolvedExportSymbol === symbol) {
return true;
}
@@ -1998,6 +2001,10 @@ module ts {
if (declaration.parent.kind === SyntaxKind.CatchClause) {
return links.type = anyType;
}
// Handle export default expressions
if (declaration.kind === SyntaxKind.ExportAssignment) {
return links.type = checkExpression((<ExportAssignment>declaration).expression);
}
// Handle variable, parameter or property
links.type = resolvingType;
var type = getWidenedTypeForVariableLikeDeclaration(<VariableLikeDeclaration>declaration, /*reportErrors*/ true);
@@ -2105,10 +2112,10 @@ module ts {
return links.type;
}
function getTypeOfImport(symbol: Symbol): Type {
function getTypeOfAlias(symbol: Symbol): Type {
var links = getSymbolLinks(symbol);
if (!links.type) {
links.type = getTypeOfSymbol(resolveImport(symbol));
links.type = getTypeOfSymbol(resolveAlias(symbol));
}
return links.type;
}
@@ -2137,8 +2144,8 @@ module ts {
if (symbol.flags & SymbolFlags.Accessor) {
return getTypeOfAccessors(symbol);
}
if (symbol.flags & SymbolFlags.Import) {
return getTypeOfImport(symbol);
if (symbol.flags & SymbolFlags.Alias) {
return getTypeOfAlias(symbol);
}
return unknownType;
}
@@ -2304,10 +2311,10 @@ module ts {
return <TypeParameter>links.declaredType;
}
function getDeclaredTypeOfImport(symbol: Symbol): Type {
function getDeclaredTypeOfAlias(symbol: Symbol): Type {
var links = getSymbolLinks(symbol);
if (!links.declaredType) {
links.declaredType = getDeclaredTypeOfSymbol(resolveImport(symbol));
links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol));
}
return links.declaredType;
}
@@ -2329,8 +2336,8 @@ module ts {
if (symbol.flags & SymbolFlags.TypeParameter) {
return getDeclaredTypeOfTypeParameter(symbol);
}
if (symbol.flags & SymbolFlags.Import) {
return getDeclaredTypeOfImport(symbol);
if (symbol.flags & SymbolFlags.Alias) {
return getDeclaredTypeOfAlias(symbol);
}
return unknownType;
}
@@ -3065,7 +3072,7 @@ module ts {
function getTypeFromTypeReferenceNode(node: TypeReferenceNode): Type {
var links = getNodeLinks(node);
if (!links.resolvedType) {
var symbol = resolveEntityName(node, node.typeName, SymbolFlags.Type);
var symbol = resolveEntityName(node.typeName, SymbolFlags.Type);
if (symbol) {
var type: Type;
if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) {
@@ -5011,22 +5018,6 @@ module ts {
}
}
/*Transitively mark all linked imports as referenced*/
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);
nodeLinks = getNodeLinks(getDeclarationOfKind(rightSide, SyntaxKind.ImportEqualsDeclaration))
}
}
}
function checkIdentifier(node: Identifier): Type {
var symbol = getResolvedSymbol(node);
@@ -5040,44 +5031,8 @@ module ts {
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 = getLeftSideOfImportEqualsOrExportAssignment(node);
// decision about whether import is referenced can be made now if
// - import that are used anywhere except right side of import declarations
// - imports that are used on the right side of exported import declarations
// for other cases defer decision until the check of left side
if (!importOrExportAssignment ||
(importOrExportAssignment.flags & NodeFlags.Export) ||
(importOrExportAssignment.kind === SyntaxKind.ExportAssignment)) {
// Mark the import as referenced so that we emit it in the final .js file.
// exception: identifiers that appear in type queries, const enums, modules that contain only const enums
symbolLinks.referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol));
}
else {
var nodeLinks = getNodeLinks(importOrExportAssignment);
Debug.assert(!nodeLinks.importOnRightSide);
nodeLinks.importOnRightSide = symbol;
}
}
if (symbolLinks.referenced) {
markLinkedImportsAsReferenced(<ImportEqualsDeclaration>getDeclarationOfKind(symbol, SyntaxKind.ImportEqualsDeclaration));
}
if (symbol.flags & SymbolFlags.Alias && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) {
markAliasSymbolAsReferenced(symbol);
}
checkCollisionWithCapturedSuperVariable(node, node);
@@ -8364,7 +8319,7 @@ module ts {
return SymbolFlags.ExportType | SymbolFlags.ExportValue;
case SyntaxKind.ImportEqualsDeclaration:
var result: SymbolFlags = 0;
var target = resolveImport(getSymbolOfNode(d));
var target = resolveAlias(getSymbolOfNode(d));
forEach(target.declarations, d => { result |= getDeclarationSpaces(d); });
return result;
default:
@@ -8392,7 +8347,7 @@ module ts {
// Do not use hasDynamicName here, because that returns false for well known symbols.
// We want to perform checkComputedPropertyName for all computed properties, including
// well known symbols.
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
if (node.name && node.name.kind === SyntaxKind.ComputedPropertyName) {
// This check will account for methods in class/interface declarations,
// as well as accessors in classes/object literals
checkComputedPropertyName(<ComputedPropertyName>node.name);
@@ -9306,10 +9261,12 @@ module ts {
// Grammar checking
checkGrammarClassDeclarationHeritageClauses(node);
checkTypeNameIsReserved(node.name, Diagnostics.Class_name_cannot_be_0);
if (node.name) {
checkTypeNameIsReserved(node.name, Diagnostics.Class_name_cannot_be_0);
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
}
checkTypeParameters(node.typeParameters);
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
checkExportsOnMergedDeclarations(node);
var symbol = getSymbolOfNode(node);
var type = <InterfaceType>getDeclaredTypeOfSymbol(symbol);
@@ -9322,11 +9279,11 @@ module ts {
if (type.baseTypes.length) {
if (produceDiagnostics) {
var baseType = type.baseTypes[0];
checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1);
checkTypeAssignableTo(type, baseType, node.name || node, Diagnostics.Class_0_incorrectly_extends_base_class_1);
var staticBaseType = getTypeOfSymbol(baseType.symbol);
checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name,
checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node,
Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
if (baseType.symbol !== resolveEntityName(node, baseTypeNode.typeName, SymbolFlags.Value)) {
if (baseType.symbol !== resolveEntityName(baseTypeNode.typeName, SymbolFlags.Value)) {
error(baseTypeNode, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType));
}
@@ -9346,7 +9303,7 @@ module ts {
if (t !== unknownType) {
var declaredType = (t.flags & TypeFlags.Reference) ? (<TypeReference>t).target : t;
if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) {
checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1);
checkTypeAssignableTo(type, t, node.name || node, Diagnostics.Class_0_incorrectly_implements_interface_1);
}
else {
error(typeRefNode, Diagnostics.A_class_may_only_implement_another_class_or_interface);
@@ -9787,19 +9744,6 @@ module ts {
if (!isInAmbientContext(node) && node.name.kind === SyntaxKind.StringLiteral) {
grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names);
}
else if (node.name.kind === SyntaxKind.Identifier && node.body.kind === SyntaxKind.ModuleBlock) {
var statements = (<ModuleBlock>node.body).statements;
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);
}
}
}
}
checkCollisionWithCapturedThisVariable(node, node.name);
@@ -9867,9 +9811,9 @@ module ts {
return true;
}
function checkImportSymbol(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportSpecifier | ExportSpecifier) {
function checkAliasSymbol(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportSpecifier | ExportSpecifier) {
var symbol = getSymbolOfNode(node);
var target = resolveImport(symbol);
var target = resolveAlias(symbol);
if (target !== unknownSymbol) {
var excludedMeanings =
(symbol.flags & SymbolFlags.Value ? SymbolFlags.Value : 0) |
@@ -9887,7 +9831,7 @@ module ts {
function checkImportBinding(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportSpecifier) {
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
checkImportSymbol(node);
checkAliasSymbol(node);
}
function checkImportDeclaration(node: ImportDeclaration) {
@@ -9914,30 +9858,25 @@ module ts {
function checkImportEqualsDeclaration(node: ImportEqualsDeclaration) {
checkGrammarModifiers(node);
if (isInternalModuleImportEqualsDeclaration(node)) {
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(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
// ensure it can be evaluated as an expression
var moduleName = getFirstIdentifier(<EntityName>node.moduleReference);
if (resolveEntityName(node, moduleName, SymbolFlags.Value | SymbolFlags.Namespace).flags & SymbolFlags.Namespace) {
checkExpressionOrQualifiedName(<EntityName>node.moduleReference);
}
else {
error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName));
}
}
if (target.flags & SymbolFlags.Type) {
checkTypeNameIsReserved(node.name, Diagnostics.Import_name_cannot_be_0);
}
if (node.flags & NodeFlags.Export) {
markExportAsReferenced(node);
}
}
else {
if (checkExternalImportOrExportDeclaration(node)) {
checkImportBinding(node);
if (isInternalModuleImportEqualsDeclaration(node)) {
var target = resolveAlias(getSymbolOfNode(node));
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
var moduleName = getFirstIdentifier(<EntityName>node.moduleReference);
if (!(resolveEntityName(moduleName, SymbolFlags.Value | SymbolFlags.Namespace).flags & SymbolFlags.Namespace)) {
error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName));
}
}
if (target.flags & SymbolFlags.Type) {
checkTypeNameIsReserved(node.name, Diagnostics.Import_name_cannot_be_0);
}
}
}
}
}
@@ -9948,23 +9887,86 @@ module ts {
}
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause) {
forEach(node.exportClause.elements, checkImportSymbol);
forEach(node.exportClause.elements, checkExportSpecifier);
}
}
}
function checkExportSpecifier(node: ExportSpecifier) {
checkAliasSymbol(node);
if (!(<ExportDeclaration>node.parent.parent).moduleSpecifier) {
markExportAsReferenced(node);
}
}
function checkExportAssignment(node: ExportAssignment) {
var container = node.parent.kind === SyntaxKind.SourceFile ? <SourceFile>node.parent : <ModuleDeclaration>node.parent.parent;
if (container.kind === SyntaxKind.ModuleDeclaration && (<ModuleDeclaration>container).name.kind === SyntaxKind.Identifier) {
error(node, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module);
return;
}
// Grammar checking
if (!checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) {
grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers);
}
if (node.expression.kind === SyntaxKind.Identifier) {
markExportAsReferenced(node);
}
else {
checkExpressionCached(node.expression);
}
checkExternalModuleExports(container);
}
var container = node.parent;
if (container.kind !== SyntaxKind.SourceFile) {
// In a module, the immediate parent will be a block, so climb up one more parent
container = container.parent;
function getModuleStatements(node: Declaration): ModuleElement[] {
if (node.kind === SyntaxKind.SourceFile) {
return (<SourceFile>node).statements;
}
if (node.kind === SyntaxKind.ModuleDeclaration && (<ModuleDeclaration>node).body.kind === SyntaxKind.ModuleBlock) {
return (<ModuleBlock>(<ModuleDeclaration>node).body).statements;
}
return emptyArray;
}
function hasExportedMembers(moduleSymbol: Symbol) {
var declarations = moduleSymbol.declarations;
for (var i = 0; i < declarations.length; i++) {
var statements = getModuleStatements(declarations[i]);
for (var j = 0; j < statements.length; j++) {
var node = statements[j];
if (node.kind === SyntaxKind.ExportDeclaration) {
var exportClause = (<ExportDeclaration>node).exportClause;
if (!exportClause) {
return true;
}
var specifiers = exportClause.elements;
for (var k = 0; k < specifiers.length; k++) {
var specifier = specifiers[k];
if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) {
return true;
}
}
}
else if (node.kind !== SyntaxKind.ExportAssignment && node.flags & NodeFlags.Export && !(node.flags & NodeFlags.Default)) {
return true;
}
}
}
}
function checkExternalModuleExports(node: SourceFile | ModuleDeclaration) {
var moduleSymbol = getSymbolOfNode(node);
var links = getSymbolLinks(moduleSymbol);
if (!links.exportsChecked) {
var defaultSymbol = getExportAssignmentSymbol(moduleSymbol);
if (defaultSymbol) {
if (hasExportedMembers(moduleSymbol)) {
var declaration = getDeclarationOfAliasSymbol(defaultSymbol) || defaultSymbol.valueDeclaration;
error(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
}
}
links.exportsChecked = true;
}
checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container));
}
function checkSourceElement(node: Node): void {
@@ -10156,6 +10158,7 @@ module ts {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.EnumMember:
case SyntaxKind.ExportAssignment:
case SyntaxKind.SourceFile:
forEachChild(node, checkFunctionExpressionBodies);
break;
@@ -10182,13 +10185,7 @@ module ts {
checkFunctionExpressionBodies(node);
if (isExternalModule(node)) {
var symbol = getExportAssignmentSymbol(node.symbol);
if (symbol && symbol.flags & SymbolFlags.Import) {
// 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(<ImportEqualsDeclaration>getDeclarationOfKind(symbol, SyntaxKind.ImportEqualsDeclaration))
}
checkExternalModuleExports(node);
}
if (potentialThisCollisions.length) {
@@ -10410,7 +10407,7 @@ module ts {
}
if (nodeOnRightSide.parent.kind === SyntaxKind.ExportAssignment) {
return (<ExportAssignment>nodeOnRightSide.parent).exportName === nodeOnRightSide && <ExportAssignment>nodeOnRightSide.parent;
return (<ExportAssignment>nodeOnRightSide.parent).expression === <Node>nodeOnRightSide && <ExportAssignment>nodeOnRightSide.parent;
}
return undefined;
@@ -10431,8 +10428,8 @@ module ts {
}
if (entityName.parent.kind === SyntaxKind.ExportAssignment) {
return resolveEntityName(/*location*/ entityName.parent.parent, <Identifier>entityName,
/*all meanings*/ SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Import);
return resolveEntityName(<Identifier>entityName,
/*all meanings*/ SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias);
}
if (entityName.kind !== SyntaxKind.PropertyAccessExpression) {
@@ -10453,10 +10450,10 @@ module ts {
}
if (entityName.kind === SyntaxKind.Identifier) {
// Include Import in the meaning, this ensures that we do not follow aliases to where they point and instead
// Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead
// return the alias symbol.
var meaning: SymbolFlags = SymbolFlags.Value | SymbolFlags.Import;
return resolveEntityName(entityName, <Identifier>entityName, meaning);
var meaning: SymbolFlags = SymbolFlags.Value | SymbolFlags.Alias;
return resolveEntityName(<Identifier>entityName, meaning);
}
else if (entityName.kind === SyntaxKind.PropertyAccessExpression) {
var symbol = getNodeLinks(entityName).resolvedSymbol;
@@ -10475,10 +10472,10 @@ module ts {
}
else if (isTypeReferenceIdentifier(<EntityName>entityName)) {
var meaning = entityName.parent.kind === SyntaxKind.TypeReference ? SymbolFlags.Type : SymbolFlags.Namespace;
// Include Import in the meaning, this ensures that we do not follow aliases to where they point and instead
// Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead
// return the alias symbol.
meaning |= SymbolFlags.Import;
return resolveEntityName(entityName, <EntityName>entityName, meaning);
meaning |= SymbolFlags.Alias;
return resolveEntityName(<EntityName>entityName, meaning);
}
// Do we want to return undefined here?
@@ -10551,7 +10548,7 @@ module ts {
// This is necessary as an identifier in short-hand property assignment can contains two meaning:
// property name and property value.
if (location && location.kind === SyntaxKind.ShorthandPropertyAssignment) {
return resolveEntityName(location, (<ShorthandPropertyAssignment>location).name, SymbolFlags.Value);
return resolveEntityName((<ShorthandPropertyAssignment>location).name, SymbolFlags.Value);
}
return undefined;
}
@@ -10658,8 +10655,8 @@ 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)) {
// 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)) {
// We conservatively include alias symbols to cover cases where they're emitted as locals
if (node.locals[name].flags & (SymbolFlags.Value | SymbolFlags.ExportValue | SymbolFlags.Alias)) {
return false;
}
}
@@ -10678,6 +10675,10 @@ module ts {
function generateNames(node: Node) {
switch (node.kind) {
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.ClassDeclaration:
generateNameForFunctionOrClassDeclaration(<Declaration>node);
break;
case SyntaxKind.ModuleDeclaration:
generateNameForModuleOrEnum(<ModuleDeclaration>node);
generateNames((<ModuleDeclaration>node).body);
@@ -10691,6 +10692,9 @@ module ts {
case SyntaxKind.ExportDeclaration:
generateNameForExportDeclaration(<ExportDeclaration>node);
break;
case SyntaxKind.ExportAssignment:
generateNameForExportAssignment(<ExportAssignment>node);
break;
case SyntaxKind.SourceFile:
case SyntaxKind.ModuleBlock:
forEach((<SourceFile | ModuleBlock>node).statements, generateNames);
@@ -10711,6 +10715,12 @@ module ts {
getNodeLinks(node).generatedName = unescapeIdentifier(name);
}
function generateNameForFunctionOrClassDeclaration(node: Declaration) {
if (!node.name) {
assignGeneratedName(node, makeUniqueName("default"));
}
}
function generateNameForModuleOrEnum(node: ModuleDeclaration | EnumDeclaration) {
if (node.name.kind === SyntaxKind.Identifier) {
var name = node.name.text;
@@ -10737,9 +10747,15 @@ module ts {
generateNameForImportOrExportDeclaration(node);
}
}
function generateNameForExportAssignment(node: ExportAssignment) {
if (node.expression.kind !== SyntaxKind.Identifier) {
assignGeneratedName(node, makeUniqueName("default"));
}
}
}
function getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration) {
function getGeneratedNameForNode(node: Node) {
var links = getNodeLinks(node);
if (!links.generatedName) {
getGeneratedNamesForSourceFile(getSourceFile(node));
@@ -10755,8 +10771,8 @@ module ts {
return getGeneratedNameForNode(node);
}
function getImportNameSubstitution(symbol: Symbol): string {
var declaration = getDeclarationOfImportSymbol(symbol);
function getAliasNameSubstitution(symbol: Symbol): string {
var declaration = getDeclarationOfAliasSymbol(symbol);
if (declaration && declaration.kind === SyntaxKind.ImportSpecifier) {
var moduleName = getGeneratedNameForNode(<ImportDeclaration>declaration.parent.parent.parent);
var propertyName = (<ImportSpecifier>declaration).propertyName || (<ImportSpecifier>declaration).name;
@@ -10794,15 +10810,15 @@ module ts {
return getExportNameSubstitution(exportSymbol, node.parent);
}
// Named imports from ES6 import declarations are rewritten
if (symbol.flags & SymbolFlags.Import) {
return getImportNameSubstitution(symbol);
if (symbol.flags & SymbolFlags.Alias) {
return getAliasNameSubstitution(symbol);
}
}
}
function getExportAssignmentName(node: SourceFile): string {
var symbol = getExportAssignmentSymbol(getSymbolOfNode(node));
return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol): undefined;
function hasExportDefaultValue(node: SourceFile): boolean {
var symbol = getResolvedExportAssignmentSymbol(getSymbolOfNode(node));
return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol);
}
function isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean {
@@ -10810,11 +10826,11 @@ module ts {
// parent is not source file or it is not reference to internal module
return false;
}
return isImportResolvedToValue(getSymbolOfNode(node));
return isAliasResolvedToValue(getSymbolOfNode(node));
}
function isImportResolvedToValue(symbol: Symbol): boolean {
var target = resolveImport(symbol);
function isAliasResolvedToValue(symbol: Symbol): boolean {
var target = resolveAlias(symbol);
// const enums and modules that contain only const enums are not considered values from the emit perespective
return target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target);
}
@@ -10823,19 +10839,14 @@ module ts {
return isConstEnumSymbol(s) || s.constEnumOnlyModule;
}
function isReferencedImportDeclaration(node: Node): boolean {
if (isImportSymbolDeclaration(node)) {
function isReferencedAliasDeclaration(node: Node): boolean {
if (isAliasSymbolDeclaration(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;
}
}
return forEachChild(node, isReferencedImportDeclaration);
return forEachChild(node, isReferencedAliasDeclaration);
}
function isImplementationOfOverload(node: FunctionLikeDeclaration) {
@@ -10929,7 +10940,7 @@ module ts {
var symbol = declarationSymbol ||
getNodeLinks(n).resolvedSymbol ||
resolveName(n, n.text, SymbolFlags.BlockScopedVariable | SymbolFlags.Import, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
resolveName(n, n.text, SymbolFlags.BlockScopedVariable | SymbolFlags.Alias, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
var isLetOrConst =
symbol &&
@@ -10949,8 +10960,8 @@ module ts {
return {
getGeneratedNameForNode,
getExpressionNameSubstitution,
getExportAssignmentName,
isReferencedImportDeclaration,
hasExportDefaultValue,
isReferencedAliasDeclaration,
getNodeCheckFlags,
isTopLevelValueImportEqualsWithEntityName,
isDeclarationVisible,
+62 -43
View File
@@ -700,8 +700,8 @@ module ts {
}
function emitExportAssignment(node: ExportAssignment) {
write("export = ");
writeTextOfNode(currentSourceFile, node.exportName);
write(node.isExportEquals ? "export = " : "export default ");
writeTextOfNode(currentSourceFile, node.expression);
write(";");
writeLine();
}
@@ -1585,6 +1585,7 @@ module ts {
var tempParameters: Identifier[];
var externalImports: ExternalImportInfo[];
var exportSpecifiers: Map<ExportSpecifier[]>;
var exportDefault: FunctionDeclaration | ClassDeclaration | ExportAssignment | ExportSpecifier;
/** write emitted output to disk*/
var writeEmittedFiles = writeJavaScriptFile;
@@ -3610,7 +3611,7 @@ module ts {
}
function emitExportMemberAssignments(name: Identifier) {
if (exportSpecifiers && hasProperty(exportSpecifiers, name.text)) {
if (!exportDefault && exportSpecifiers && hasProperty(exportSpecifiers, name.text)) {
forEach(exportSpecifiers[name.text], specifier => {
writeLine();
emitStart(specifier.name);
@@ -4073,6 +4074,15 @@ module ts {
return node.kind === SyntaxKind.ArrowFunction && languageVersion >= ScriptTarget.ES6;
}
function emitDeclarationName(node: Declaration) {
if (node.name) {
emitNode(node.name);
}
else {
write(resolver.getGeneratedNameForNode(node));
}
}
function emitFunctionDeclaration(node: FunctionLikeDeclaration) {
if (nodeIsMissing(node.body)) {
return emitPinnedOrTripleSlashComments(node);
@@ -4090,10 +4100,10 @@ module ts {
}
if (node.kind === SyntaxKind.FunctionDeclaration || (node.kind === SyntaxKind.FunctionExpression && node.name)) {
emit(node.name);
emitDeclarationName(node);
}
emitSignatureAndBody(node);
if (languageVersion < ScriptTarget.ES6 && node.kind === SyntaxKind.FunctionDeclaration && node.parent === currentSourceFile) {
if (languageVersion < ScriptTarget.ES6 && node.kind === SyntaxKind.FunctionDeclaration && node.parent === currentSourceFile && node.name) {
emitExportMemberAssignments((<FunctionDeclaration>node).name);
}
if (node.kind !== SyntaxKind.MethodDeclaration && node.kind !== SyntaxKind.MethodSignature) {
@@ -4162,12 +4172,12 @@ module ts {
emitExpressionFunctionBody(node, <Expression>node.body);
}
if (node.flags & NodeFlags.Export) {
if (node.flags & NodeFlags.Export && !(node.flags & NodeFlags.Default)) {
writeLine();
emitStart(node);
emitModuleMemberName(node);
write(" = ");
emit(node.name);
emitDeclarationName(node);
emitEnd(node);
write(";");
}
@@ -4340,7 +4350,7 @@ module ts {
emitStart(member);
emitStart((<PropertyDeclaration>member).name);
if (staticFlag) {
emitNode(node.name);
emitDeclarationName(node);
}
else {
write("this");
@@ -4367,7 +4377,7 @@ module ts {
emitLeadingComments(member);
emitStart(member);
emitStart((<MethodDeclaration>member).name);
emitNode(node.name); // TODO (shkamat,drosen): comment for why emitNode instead of emit.
emitDeclarationName(node);
if (!(member.flags & NodeFlags.Static)) {
write(".prototype");
}
@@ -4389,7 +4399,7 @@ module ts {
emitStart(member);
write("Object.defineProperty(");
emitStart((<AccessorDeclaration>member).name);
emitNode(node.name);
emitDeclarationName(node);
if (!(member.flags & NodeFlags.Static)) {
write(".prototype");
}
@@ -4436,7 +4446,7 @@ module ts {
function emitClassDeclaration(node: ClassDeclaration) {
write("var ");
emit(node.name);
emitDeclarationName(node);
write(" = (function (");
var baseTypeNode = getClassBaseTypeNode(node);
if (baseTypeNode) {
@@ -4449,7 +4459,7 @@ module ts {
writeLine();
emitStart(baseTypeNode);
write("__extends(");
emit(node.name);
emitDeclarationName(node);
write(", _super);");
emitEnd(baseTypeNode);
}
@@ -4458,11 +4468,10 @@ module ts {
emitMemberFunctions(node);
emitMemberAssignments(node, NodeFlags.Static);
writeLine();
function emitClassReturnStatement() {
emitToken(SyntaxKind.CloseBraceToken, node.members.end, () => {
write("return ");
emitNode(node.name);
}
emitToken(SyntaxKind.CloseBraceToken, node.members.end, emitClassReturnStatement);
emitDeclarationName(node);
});
write(";");
decreaseIndent();
writeLine();
@@ -4475,16 +4484,16 @@ module ts {
}
write(");");
emitEnd(node);
if (node.flags & NodeFlags.Export) {
if (node.flags & NodeFlags.Export && !(node.flags & NodeFlags.Default)) {
writeLine();
emitStart(node);
emitModuleMemberName(node);
write(" = ");
emit(node.name);
emitDeclarationName(node);
emitEnd(node);
write(";");
}
if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile) {
if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile && node.name) {
emitExportMemberAssignments(node.name);
}
@@ -4511,7 +4520,7 @@ module ts {
}
emitStart(<Node>ctor || node);
write("function ");
emit(node.name);
emitDeclarationName(node);
emitSignatureParameters(ctor);
write(" {");
scopeEmitStart(node, "constructor");
@@ -4791,7 +4800,7 @@ module ts {
// 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) ||
if (resolver.isReferencedAliasDeclaration(node) ||
(!isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) {
emitLeadingComments(node);
emitStart(node);
@@ -4891,17 +4900,29 @@ module ts {
function createExternalModuleInfo(sourceFile: SourceFile) {
externalImports = [];
exportSpecifiers = {};
exportDefault = undefined;
forEach(sourceFile.statements, node => {
if (node.kind === SyntaxKind.ExportDeclaration && !(<ExportDeclaration>node).moduleSpecifier) {
forEach((<ExportDeclaration>node).exportClause.elements, specifier => {
if (specifier.name.text === "default") {
exportDefault = exportDefault || specifier;
}
var name = (specifier.propertyName || specifier.name).text;
(exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier);
});
}
else if (node.kind === SyntaxKind.ExportAssignment) {
exportDefault = exportDefault || <ExportAssignment>node;
}
else if (node.kind === SyntaxKind.FunctionDeclaration || node.kind === SyntaxKind.ClassDeclaration) {
if (node.flags & NodeFlags.Export && node.flags & NodeFlags.Default) {
exportDefault = exportDefault || <FunctionDeclaration | ClassDeclaration>node;
}
}
else {
var info = createExternalImportInfo(node);
if (info) {
if ((!info.declarationNode && !info.namedImports) || resolver.isReferencedImportDeclaration(node)) {
if ((!info.declarationNode && !info.namedImports) || resolver.isReferencedAliasDeclaration(node)) {
externalImports.push(info);
}
}
@@ -4985,18 +5006,7 @@ module ts {
emitCaptureThisForNodeIfNecessary(node);
emitLinesStartingAt(node.statements, startIndex);
emitTempDeclarations(/*newLine*/ true);
var exportName = resolver.getExportAssignmentName(node);
if (exportName) {
writeLine();
var exportAssignment = getFirstExportAssignment(node);
emitStart(exportAssignment);
write("return ");
emitStart(exportAssignment.exportName);
write(exportName);
emitEnd(exportAssignment.exportName);
write(";");
emitEnd(exportAssignment);
}
emitExportDefault(node, /*emitAsReturn*/ true);
decreaseIndent();
writeLine();
write("});");
@@ -5006,17 +5016,25 @@ module ts {
emitCaptureThisForNodeIfNecessary(node);
emitLinesStartingAt(node.statements, startIndex);
emitTempDeclarations(/*newLine*/ true);
var exportName = resolver.getExportAssignmentName(node);
if (exportName) {
emitExportDefault(node, /*emitAsReturn*/ false);
}
function emitExportDefault(sourceFile: SourceFile, emitAsReturn: boolean) {
if (exportDefault && resolver.hasExportDefaultValue(sourceFile)) {
writeLine();
var exportAssignment = getFirstExportAssignment(node);
emitStart(exportAssignment);
write("module.exports = ");
emitStart(exportAssignment.exportName);
write(exportName);
emitEnd(exportAssignment.exportName);
emitStart(exportDefault);
write(emitAsReturn ? "return " : "module.exports = ");
if (exportDefault.kind === SyntaxKind.ExportAssignment) {
emit((<ExportAssignment>exportDefault).expression);
}
else if (exportDefault.kind === SyntaxKind.ExportSpecifier) {
emit((<ExportSpecifier>exportDefault).propertyName);
}
else {
emitDeclarationName(<Declaration>exportDefault);
}
write(";");
emitEnd(exportAssignment);
emitEnd(exportDefault);
}
}
@@ -5073,6 +5091,7 @@ module ts {
else {
externalImports = undefined;
exportSpecifiers = undefined;
exportDefault = undefined;
emitCaptureThisForNodeIfNecessary(node);
emitLinesStartingAt(node.statements, startIndex);
emitTempDeclarations(/*newLine*/ true);
+27 -8
View File
@@ -277,7 +277,7 @@ module ts {
visitNode(cbNode, (<ImportOrExportSpecifier>node).name);
case SyntaxKind.ExportAssignment:
return visitNodes(cbNodes, node.modifiers) ||
visitNode(cbNode, (<ExportAssignment>node).exportName);
visitNode(cbNode, (<ExportAssignment>node).expression);
case SyntaxKind.TemplateExpression:
return visitNode(cbNode, (<TemplateExpression>node).head) || visitNodes(cbNodes, (<TemplateExpression>node).templateSpans);
case SyntaxKind.TemplateSpan:
@@ -357,6 +357,7 @@ module ts {
case SyntaxKind.ExportKeyword: return NodeFlags.Export;
case SyntaxKind.DeclareKeyword: return NodeFlags.Ambient;
case SyntaxKind.ConstKeyword: return NodeFlags.Const;
case SyntaxKind.DefaultKeyword: return NodeFlags.Default;
}
return 0;
}
@@ -1499,8 +1500,14 @@ module ts {
}
if (token === SyntaxKind.ExportKeyword) {
nextToken();
if (token === SyntaxKind.DefaultKeyword) {
return lookAhead(nextTokenIsClassOrFunction);
}
return token !== SyntaxKind.AsteriskToken && token !== SyntaxKind.OpenBraceToken && canFollowModifier();
}
if (token === SyntaxKind.DefaultKeyword) {
return nextTokenIsClassOrFunction();
}
nextToken();
return canFollowModifier();
}
@@ -1512,6 +1519,11 @@ module ts {
|| isLiteralPropertyName();
}
function nextTokenIsClassOrFunction(): boolean {
nextToken();
return token === SyntaxKind.ClassKeyword || token === SyntaxKind.FunctionKeyword;
}
// True if positioned at the start of a list element
function isListElement(parsingContext: ParsingContext, inErrorRecovery: boolean): boolean {
var node = currentNode(parsingContext);
@@ -4323,7 +4335,7 @@ module ts {
setModifiers(node, modifiers);
parseExpected(SyntaxKind.FunctionKeyword);
node.asteriskToken = parseOptionalToken(SyntaxKind.AsteriskToken);
node.name = parseIdentifier();
node.name = node.flags & NodeFlags.Default ? parseOptionalIdentifier() : parseIdentifier();
fillSignature(SyntaxKind.ColonToken, /*yieldAndGeneratorParameterContext:*/ !!node.asteriskToken, /*requireCompleteParameterList:*/ false, node);
node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, Diagnostics.or_expected);
return finishNode(node);
@@ -4499,7 +4511,7 @@ module ts {
var node = <ClassDeclaration>createNode(SyntaxKind.ClassDeclaration, fullStart);
setModifiers(node, modifiers);
parseExpected(SyntaxKind.ClassKeyword);
node.name = parseIdentifier();
node.name = node.flags & NodeFlags.Default ? parseOptionalIdentifier() : parseIdentifier();
node.typeParameters = parseTypeParameters();
node.heritageClauses = parseHeritageClauses(/*isClassHeritageClause:*/ true);
@@ -4832,10 +4844,17 @@ module ts {
return finishNode(node);
}
function parseExportAssignmentTail(fullStart: number, modifiers: ModifiersArray): ExportAssignment {
function parseExportAssignment(fullStart: number, modifiers: ModifiersArray): ExportAssignment {
var node = <ExportAssignment>createNode(SyntaxKind.ExportAssignment, fullStart);
setModifiers(node, modifiers);
node.exportName = parseIdentifier();
if (parseOptional(SyntaxKind.EqualsToken)) {
node.isExportEquals = true;
}
else {
parseExpected(SyntaxKind.DefaultKeyword);
}
//node.exportName = parseIdentifier();
node.expression = parseAssignmentExpressionOrHigher();
parseSemicolon();
return finishNode(node);
}
@@ -4902,7 +4921,7 @@ module ts {
function nextTokenCanFollowExportKeyword() {
nextToken();
return token === SyntaxKind.EqualsToken || token === SyntaxKind.AsteriskToken ||
token === SyntaxKind.OpenBraceToken || isDeclarationStart();
token === SyntaxKind.OpenBraceToken || token === SyntaxKind.DefaultKeyword || isDeclarationStart();
}
function nextTokenIsDeclarationStart() {
@@ -4919,8 +4938,8 @@ module ts {
var modifiers = parseModifiers();
if (token === SyntaxKind.ExportKeyword) {
nextToken();
if (parseOptional(SyntaxKind.EqualsToken)) {
return parseExportAssignmentTail(fullStart, modifiers);
if (token === SyntaxKind.DefaultKeyword || token === SyntaxKind.EqualsToken) {
return parseExportAssignment(fullStart, modifiers);
}
if (token === SyntaxKind.AsteriskToken || token === SyntaxKind.OpenBraceToken) {
return parseExportDeclaration(fullStart, modifiers);
+27 -31
View File
@@ -299,14 +299,15 @@ module ts {
Private = 0x00000020, // Property/Method
Protected = 0x00000040, // Property/Method
Static = 0x00000080, // Property/Method
MultiLine = 0x00000100, // Multi-line array or object literal
Synthetic = 0x00000200, // Synthetic node (for full fidelity)
DeclarationFile = 0x00000400, // Node is a .d.ts file
Let = 0x00000800, // Variable declaration
Const = 0x00001000, // Variable declaration
OctalLiteral = 0x00002000,
Default = 0x00000100, // Function/Class (export default declaration)
MultiLine = 0x00000200, // Multi-line array or object literal
Synthetic = 0x00000400, // Synthetic node (for full fidelity)
DeclarationFile = 0x00000800, // Node is a .d.ts file
Let = 0x00001000, // Variable declaration
Const = 0x00002000, // Variable declaration
OctalLiteral = 0x00004000,
Modifier = Export | Ambient | Public | Private | Protected | Static,
Modifier = Export | Ambient | Public | Private | Protected | Static | Default,
AccessibilityModifier = Public | Private | Protected,
BlockScoped = Let | Const
}
@@ -501,7 +502,7 @@ module ts {
}
export interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
@@ -825,7 +826,7 @@ module ts {
}
export interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -864,11 +865,7 @@ module ts {
members: NodeArray<EnumMember>;
}
export interface ExportContainer {
exportStars?: ExportDeclaration[]; // List of 'export *' statements (initialized by binding)
}
export interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
export interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -913,7 +910,7 @@ module ts {
name: Identifier;
}
export interface ExportDeclaration extends Statement, ModuleElement {
export interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -933,8 +930,9 @@ module ts {
export type ImportSpecifier = ImportOrExportSpecifier;
export type ExportSpecifier = ImportOrExportSpecifier;
export interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
export interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression: Expression;
}
export interface FileReference extends TextRange {
@@ -946,7 +944,7 @@ module ts {
}
// Source files are declarations when they are external modules.
export interface SourceFile extends Declaration, ExportContainer {
export interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
@@ -1190,10 +1188,10 @@ module ts {
}
export interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -1229,18 +1227,17 @@ module ts {
Signature = 0x00020000, // Call, construct, or index signature
TypeParameter = 0x00040000, // Type parameter
TypeAlias = 0x00080000, // Type alias
// Export markers (see comment in declareModuleMember in binder)
ExportValue = 0x00100000, // Exported value marker
ExportType = 0x00200000, // Exported type marker
ExportNamespace = 0x00400000, // Exported namespace marker
Import = 0x00800000, // Import
ExportValue = 0x00100000, // Exported value marker (see comment in declareModuleMember in binder)
ExportType = 0x00200000, // Exported type marker (see comment in declareModuleMember in binder)
ExportNamespace = 0x00400000, // Exported namespace marker (see comment in declareModuleMember in binder)
Alias = 0x00800000, // An alias for another symbol (see comment in isAliasSymbolDeclaration in checker)
Instantiated = 0x01000000, // Instantiated symbol
Merged = 0x02000000, // Merged symbol (created during program binding)
Transient = 0x04000000, // Transient symbol (created during type check)
Prototype = 0x08000000, // Prototype property (no source representation)
UnionProperty = 0x10000000, // Property in union type
Optional = 0x20000000, // Optional property
ExportStar = 0x40000000, // Export * declaration
Enum = RegularEnum | ConstEnum,
Variable = FunctionScopedVariable | BlockScopedVariable,
@@ -1273,9 +1270,9 @@ module ts {
SetAccessorExcludes = Value & ~GetAccessor,
TypeParameterExcludes = Type & ~TypeParameter,
TypeAliasExcludes = Type,
ImportExcludes = Import, // Imports collide with all other imports with the same name
AliasExcludes = Alias,
ModuleMember = Variable | Function | Class | Interface | Enum | Module | TypeAlias | Import,
ModuleMember = Variable | Function | Class | Interface | Enum | Module | TypeAlias | Alias,
ExportHasLocal = Function | Class | Enum | ValueModule,
@@ -1308,10 +1305,9 @@ module ts {
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
exportsChecked?: boolean; // True if exports of external module have been checked
}
export interface TransientSymbol extends Symbol, SymbolLinks { }
+1
View File
@@ -933,6 +933,7 @@ module ts {
case SyntaxKind.ExportKeyword:
case SyntaxKind.DeclareKeyword:
case SyntaxKind.ConstKeyword:
case SyntaxKind.DefaultKeyword:
return true;
}
return false;
+1 -1
View File
@@ -174,7 +174,7 @@ module ts.BreakpointResolver {
case SyntaxKind.ExportAssignment:
// span on export = id
return textSpan(node, (<ExportAssignment>node).exportName);
return textSpan(node, (<ExportAssignment>node).expression);
case SyntaxKind.ImportEqualsDeclaration:
// import statement without including semicolon
+5
View File
@@ -458,6 +458,11 @@ module ts.NavigationBar {
}
function createClassItem(node: ClassDeclaration): ts.NavigationBarItem {
if (!node.name) {
// An export default class may be nameless
return undefined;
}
var childItems: NavigationBarItem[];
if (node.members) {
+9 -9
View File
@@ -2530,7 +2530,7 @@ module ts {
var symbol = typeInfoResolver.getSymbolAtLocation(node);
// This is an alias, follow what it aliases
if (symbol && symbol.flags & SymbolFlags.Import) {
if (symbol && symbol.flags & SymbolFlags.Alias) {
symbol = typeInfoResolver.getAliasedSymbol(symbol);
}
@@ -2594,7 +2594,7 @@ module ts {
isNewIdentifierLocation = isNewIdentifierDefinitionLocation(previousToken);
/// TODO filter meaning based on the current context
var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Import;
var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias;
var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings);
getCompletionEntriesFromSymbols(symbols, activeCompletionSession);
@@ -2971,7 +2971,7 @@ module ts {
if (result === ScriptElementKind.unknown) {
if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement;
if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement;
if (flags & SymbolFlags.Import) return ScriptElementKind.alias;
if (flags & SymbolFlags.Alias) return ScriptElementKind.alias;
if (flags & SymbolFlags.Module) return ScriptElementKind.moduleElement;
}
@@ -3059,7 +3059,7 @@ module ts {
var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location);
var hasAddedSymbolInfo: boolean;
// Class at constructor site need to be shown as constructor apart from property,method, vars
if (symbolKind !== ScriptElementKind.unknown || symbolFlags & SymbolFlags.Class || symbolFlags & SymbolFlags.Import) {
if (symbolKind !== ScriptElementKind.unknown || symbolFlags & SymbolFlags.Class || symbolFlags & SymbolFlags.Alias) {
// If it is accessor they are allowed only if location is at name of the accessor
if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) {
symbolKind = ScriptElementKind.memberVariableElement;
@@ -3106,7 +3106,7 @@ module ts {
symbolKind = ScriptElementKind.constructorImplementationElement;
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
}
else if (symbolFlags & SymbolFlags.Import) {
else if (symbolFlags & SymbolFlags.Alias) {
symbolKind = ScriptElementKind.alias;
displayParts.push(punctuationPart(SyntaxKind.OpenParenToken));
displayParts.push(textPart(symbolKind));
@@ -3259,7 +3259,7 @@ module ts {
}
}
}
if (symbolFlags & SymbolFlags.Import) {
if (symbolFlags & SymbolFlags.Alias) {
addNewLineIfDisplayPartsExist();
displayParts.push(keywordPart(SyntaxKind.ImportKeyword));
displayParts.push(spacePart());
@@ -3468,7 +3468,7 @@ module ts {
// get the aliased symbol instead. This allows for goto def on an import e.g.
// import {A, B} from "mod";
// to jump to the implementation directelly.
if (symbol.flags & SymbolFlags.Import) {
if (symbol.flags & SymbolFlags.Alias) {
var declaration = symbol.declarations[0];
if (node.kind === SyntaxKind.Identifier && node.parent === declaration) {
symbol = typeInfoResolver.getAliasedSymbol(symbol);
@@ -4224,7 +4224,7 @@ module ts {
}
function isImportOrExportSpecifierImportSymbol(symbol: Symbol) {
return (symbol.flags & SymbolFlags.Import) && forEach(symbol.declarations, declaration => {
return (symbol.flags & SymbolFlags.Alias) && forEach(symbol.declarations, declaration => {
return declaration.kind === SyntaxKind.ImportSpecifier || declaration.kind === SyntaxKind.ExportSpecifier;
});
}
@@ -4299,7 +4299,7 @@ module ts {
// If the symbol is an import we would like to find it if we are looking for what it imports.
// So consider it visibile outside its declaration scope.
if (symbol.flags & SymbolFlags.Import) {
if (symbol.flags & SymbolFlags.Alias) {
return undefined;
}
+1 -1
View File
@@ -414,7 +414,7 @@ module ts {
else if (flags & SymbolFlags.Method) { return SymbolDisplayPartKind.methodName; }
else if (flags & SymbolFlags.TypeParameter) { return SymbolDisplayPartKind.typeParameterName; }
else if (flags & SymbolFlags.TypeAlias) { return SymbolDisplayPartKind.aliasName; }
else if (flags & SymbolFlags.Import) { return SymbolDisplayPartKind.aliasName; }
else if (flags & SymbolFlags.Alias) { return SymbolDisplayPartKind.aliasName; }
return SymbolDisplayPartKind.text;
+24 -25
View File
@@ -313,15 +313,16 @@ declare module "typescript" {
Private = 32,
Protected = 64,
Static = 128,
MultiLine = 256,
Synthetic = 512,
DeclarationFile = 1024,
Let = 2048,
Const = 4096,
OctalLiteral = 8192,
Modifier = 243,
Default = 256,
MultiLine = 512,
Synthetic = 1024,
DeclarationFile = 2048,
Let = 4096,
Const = 8192,
OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112,
BlockScoped = 6144,
BlockScoped = 12288,
}
const enum ParserContextFlags {
StrictMode = 1,
@@ -449,7 +450,7 @@ declare module "typescript" {
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -682,7 +683,7 @@ declare module "typescript" {
_moduleElementBrand: any;
}
interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -712,10 +713,7 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -740,7 +738,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -755,8 +753,9 @@ declare module "typescript" {
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression: Expression;
}
interface FileReference extends TextRange {
fileName: string;
@@ -764,7 +763,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@@ -927,10 +926,10 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -967,13 +966,14 @@ declare module "typescript" {
ExportValue = 1048576,
ExportType = 2097152,
ExportNamespace = 4194304,
Import = 8388608,
Alias = 8388608,
Instantiated = 16777216,
Merged = 33554432,
Transient = 67108864,
Prototype = 134217728,
UnionProperty = 268435456,
Optional = 536870912,
ExportStar = 1073741824,
Enum = 384,
Variable = 3,
Value = 107455,
@@ -998,7 +998,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056,
ImportExcludes = 8388608,
AliasExcludes = 8388608,
ModuleMember = 8914931,
ExportHasLocal = 944,
HasLocals = 255504,
@@ -1027,10 +1027,9 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
exportsChecked?: boolean;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@@ -954,31 +954,34 @@ declare module "typescript" {
Static = 128,
>Static : NodeFlags
MultiLine = 256,
Default = 256,
>Default : NodeFlags
MultiLine = 512,
>MultiLine : NodeFlags
Synthetic = 512,
Synthetic = 1024,
>Synthetic : NodeFlags
DeclarationFile = 1024,
DeclarationFile = 2048,
>DeclarationFile : NodeFlags
Let = 2048,
Let = 4096,
>Let : NodeFlags
Const = 4096,
Const = 8192,
>Const : NodeFlags
OctalLiteral = 8192,
OctalLiteral = 16384,
>OctalLiteral : NodeFlags
Modifier = 243,
Modifier = 499,
>Modifier : NodeFlags
AccessibilityModifier = 112,
>AccessibilityModifier : NodeFlags
BlockScoped = 6144,
BlockScoped = 12288,
>BlockScoped : NodeFlags
}
const enum ParserContextFlags {
@@ -1370,7 +1373,7 @@ declare module "typescript" {
>FunctionLikeDeclaration : FunctionLikeDeclaration
>Statement : Statement
name: Identifier;
name?: Identifier;
>name : Identifier
>Identifier : Identifier
@@ -2057,7 +2060,7 @@ declare module "typescript" {
>Declaration : Declaration
>ModuleElement : ModuleElement
name: Identifier;
name?: Identifier;
>name : Identifier
>Identifier : Identifier
@@ -2159,18 +2162,10 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}
interface ExportContainer {
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;
>name : Identifier | LiteralExpression
@@ -2248,9 +2243,9 @@ declare module "typescript" {
>name : Identifier
>Identifier : Identifier
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportClause?: NamedExports;
@@ -2298,14 +2293,17 @@ declare module "typescript" {
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {
interface ExportAssignment extends Declaration, ModuleElement {
>ExportAssignment : ExportAssignment
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportName: Identifier;
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;
>isExportEquals : boolean
expression: Expression;
>expression : Expression
>Expression : Expression
}
interface FileReference extends TextRange {
>FileReference : FileReference
@@ -2321,10 +2319,9 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;
>hasTrailingNewLine : boolean
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;
>statements : NodeArray<ModuleElement>
@@ -2965,26 +2962,23 @@ declare module "typescript" {
interface EmitResolver {
>EmitResolver : EmitResolver
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
getGeneratedNameForNode(node: Node): string;
>getGeneratedNameForNode : (node: Node) => string
>node : Node
>Node : Node
getExpressionNameSubstitution(node: Identifier): string;
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
getExportAssignmentName(node: SourceFile): string;
>getExportAssignmentName : (node: SourceFile) => string
hasExportDefaultValue(node: SourceFile): boolean;
>hasExportDefaultValue : (node: SourceFile) => boolean
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: Node): boolean;
>isReferencedImportDeclaration : (node: Node) => boolean
isReferencedAliasDeclaration(node: Node): boolean;
>isReferencedAliasDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
@@ -3140,8 +3134,8 @@ declare module "typescript" {
ExportNamespace = 4194304,
>ExportNamespace : SymbolFlags
Import = 8388608,
>Import : SymbolFlags
Alias = 8388608,
>Alias : SymbolFlags
Instantiated = 16777216,
>Instantiated : SymbolFlags
@@ -3161,6 +3155,9 @@ declare module "typescript" {
Optional = 536870912,
>Optional : SymbolFlags
ExportStar = 1073741824,
>ExportStar : SymbolFlags
Enum = 384,
>Enum : SymbolFlags
@@ -3233,8 +3230,8 @@ declare module "typescript" {
TypeAliasExcludes = 793056,
>TypeAliasExcludes : SymbolFlags
ImportExcludes = 8388608,
>ImportExcludes : SymbolFlags
AliasExcludes = 8388608,
>AliasExcludes : SymbolFlags
ModuleMember = 8914931,
>ModuleMember : SymbolFlags
@@ -3325,13 +3322,6 @@ declare module "typescript" {
referenced?: boolean;
>referenced : boolean
exportAssignmentChecked?: boolean;
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;
>unionType : UnionType
>UnionType : UnionType
@@ -3339,6 +3329,9 @@ declare module "typescript" {
resolvedExports?: SymbolTable;
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
exportsChecked?: boolean;
>exportsChecked : boolean
}
interface TransientSymbol extends Symbol, SymbolLinks {
>TransientSymbol : TransientSymbol
+24 -25
View File
@@ -344,15 +344,16 @@ declare module "typescript" {
Private = 32,
Protected = 64,
Static = 128,
MultiLine = 256,
Synthetic = 512,
DeclarationFile = 1024,
Let = 2048,
Const = 4096,
OctalLiteral = 8192,
Modifier = 243,
Default = 256,
MultiLine = 512,
Synthetic = 1024,
DeclarationFile = 2048,
Let = 4096,
Const = 8192,
OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112,
BlockScoped = 6144,
BlockScoped = 12288,
}
const enum ParserContextFlags {
StrictMode = 1,
@@ -480,7 +481,7 @@ declare module "typescript" {
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -713,7 +714,7 @@ declare module "typescript" {
_moduleElementBrand: any;
}
interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -743,10 +744,7 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -771,7 +769,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -786,8 +784,9 @@ declare module "typescript" {
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression: Expression;
}
interface FileReference extends TextRange {
fileName: string;
@@ -795,7 +794,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@@ -958,10 +957,10 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -998,13 +997,14 @@ declare module "typescript" {
ExportValue = 1048576,
ExportType = 2097152,
ExportNamespace = 4194304,
Import = 8388608,
Alias = 8388608,
Instantiated = 16777216,
Merged = 33554432,
Transient = 67108864,
Prototype = 134217728,
UnionProperty = 268435456,
Optional = 536870912,
ExportStar = 1073741824,
Enum = 384,
Variable = 3,
Value = 107455,
@@ -1029,7 +1029,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056,
ImportExcludes = 8388608,
AliasExcludes = 8388608,
ModuleMember = 8914931,
ExportHasLocal = 944,
HasLocals = 255504,
@@ -1058,10 +1058,9 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
exportsChecked?: boolean;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@@ -1100,31 +1100,34 @@ declare module "typescript" {
Static = 128,
>Static : NodeFlags
MultiLine = 256,
Default = 256,
>Default : NodeFlags
MultiLine = 512,
>MultiLine : NodeFlags
Synthetic = 512,
Synthetic = 1024,
>Synthetic : NodeFlags
DeclarationFile = 1024,
DeclarationFile = 2048,
>DeclarationFile : NodeFlags
Let = 2048,
Let = 4096,
>Let : NodeFlags
Const = 4096,
Const = 8192,
>Const : NodeFlags
OctalLiteral = 8192,
OctalLiteral = 16384,
>OctalLiteral : NodeFlags
Modifier = 243,
Modifier = 499,
>Modifier : NodeFlags
AccessibilityModifier = 112,
>AccessibilityModifier : NodeFlags
BlockScoped = 6144,
BlockScoped = 12288,
>BlockScoped : NodeFlags
}
const enum ParserContextFlags {
@@ -1516,7 +1519,7 @@ declare module "typescript" {
>FunctionLikeDeclaration : FunctionLikeDeclaration
>Statement : Statement
name: Identifier;
name?: Identifier;
>name : Identifier
>Identifier : Identifier
@@ -2203,7 +2206,7 @@ declare module "typescript" {
>Declaration : Declaration
>ModuleElement : ModuleElement
name: Identifier;
name?: Identifier;
>name : Identifier
>Identifier : Identifier
@@ -2305,18 +2308,10 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}
interface ExportContainer {
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;
>name : Identifier | LiteralExpression
@@ -2394,9 +2389,9 @@ declare module "typescript" {
>name : Identifier
>Identifier : Identifier
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportClause?: NamedExports;
@@ -2444,14 +2439,17 @@ declare module "typescript" {
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {
interface ExportAssignment extends Declaration, ModuleElement {
>ExportAssignment : ExportAssignment
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportName: Identifier;
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;
>isExportEquals : boolean
expression: Expression;
>expression : Expression
>Expression : Expression
}
interface FileReference extends TextRange {
>FileReference : FileReference
@@ -2467,10 +2465,9 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;
>hasTrailingNewLine : boolean
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;
>statements : NodeArray<ModuleElement>
@@ -3111,26 +3108,23 @@ declare module "typescript" {
interface EmitResolver {
>EmitResolver : EmitResolver
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
getGeneratedNameForNode(node: Node): string;
>getGeneratedNameForNode : (node: Node) => string
>node : Node
>Node : Node
getExpressionNameSubstitution(node: Identifier): string;
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
getExportAssignmentName(node: SourceFile): string;
>getExportAssignmentName : (node: SourceFile) => string
hasExportDefaultValue(node: SourceFile): boolean;
>hasExportDefaultValue : (node: SourceFile) => boolean
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: Node): boolean;
>isReferencedImportDeclaration : (node: Node) => boolean
isReferencedAliasDeclaration(node: Node): boolean;
>isReferencedAliasDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
@@ -3286,8 +3280,8 @@ declare module "typescript" {
ExportNamespace = 4194304,
>ExportNamespace : SymbolFlags
Import = 8388608,
>Import : SymbolFlags
Alias = 8388608,
>Alias : SymbolFlags
Instantiated = 16777216,
>Instantiated : SymbolFlags
@@ -3307,6 +3301,9 @@ declare module "typescript" {
Optional = 536870912,
>Optional : SymbolFlags
ExportStar = 1073741824,
>ExportStar : SymbolFlags
Enum = 384,
>Enum : SymbolFlags
@@ -3379,8 +3376,8 @@ declare module "typescript" {
TypeAliasExcludes = 793056,
>TypeAliasExcludes : SymbolFlags
ImportExcludes = 8388608,
>ImportExcludes : SymbolFlags
AliasExcludes = 8388608,
>AliasExcludes : SymbolFlags
ModuleMember = 8914931,
>ModuleMember : SymbolFlags
@@ -3471,13 +3468,6 @@ declare module "typescript" {
referenced?: boolean;
>referenced : boolean
exportAssignmentChecked?: boolean;
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;
>unionType : UnionType
>UnionType : UnionType
@@ -3485,6 +3475,9 @@ declare module "typescript" {
resolvedExports?: SymbolTable;
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
exportsChecked?: boolean;
>exportsChecked : boolean
}
interface TransientSymbol extends Symbol, SymbolLinks {
>TransientSymbol : TransientSymbol
@@ -345,15 +345,16 @@ declare module "typescript" {
Private = 32,
Protected = 64,
Static = 128,
MultiLine = 256,
Synthetic = 512,
DeclarationFile = 1024,
Let = 2048,
Const = 4096,
OctalLiteral = 8192,
Modifier = 243,
Default = 256,
MultiLine = 512,
Synthetic = 1024,
DeclarationFile = 2048,
Let = 4096,
Const = 8192,
OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112,
BlockScoped = 6144,
BlockScoped = 12288,
}
const enum ParserContextFlags {
StrictMode = 1,
@@ -481,7 +482,7 @@ declare module "typescript" {
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -714,7 +715,7 @@ declare module "typescript" {
_moduleElementBrand: any;
}
interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -744,10 +745,7 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -772,7 +770,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -787,8 +785,9 @@ declare module "typescript" {
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression: Expression;
}
interface FileReference extends TextRange {
fileName: string;
@@ -796,7 +795,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@@ -959,10 +958,10 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -999,13 +998,14 @@ declare module "typescript" {
ExportValue = 1048576,
ExportType = 2097152,
ExportNamespace = 4194304,
Import = 8388608,
Alias = 8388608,
Instantiated = 16777216,
Merged = 33554432,
Transient = 67108864,
Prototype = 134217728,
UnionProperty = 268435456,
Optional = 536870912,
ExportStar = 1073741824,
Enum = 384,
Variable = 3,
Value = 107455,
@@ -1030,7 +1030,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056,
ImportExcludes = 8388608,
AliasExcludes = 8388608,
ModuleMember = 8914931,
ExportHasLocal = 944,
HasLocals = 255504,
@@ -1059,10 +1059,9 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
exportsChecked?: boolean;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@@ -1050,31 +1050,34 @@ declare module "typescript" {
Static = 128,
>Static : NodeFlags
MultiLine = 256,
Default = 256,
>Default : NodeFlags
MultiLine = 512,
>MultiLine : NodeFlags
Synthetic = 512,
Synthetic = 1024,
>Synthetic : NodeFlags
DeclarationFile = 1024,
DeclarationFile = 2048,
>DeclarationFile : NodeFlags
Let = 2048,
Let = 4096,
>Let : NodeFlags
Const = 4096,
Const = 8192,
>Const : NodeFlags
OctalLiteral = 8192,
OctalLiteral = 16384,
>OctalLiteral : NodeFlags
Modifier = 243,
Modifier = 499,
>Modifier : NodeFlags
AccessibilityModifier = 112,
>AccessibilityModifier : NodeFlags
BlockScoped = 6144,
BlockScoped = 12288,
>BlockScoped : NodeFlags
}
const enum ParserContextFlags {
@@ -1466,7 +1469,7 @@ declare module "typescript" {
>FunctionLikeDeclaration : FunctionLikeDeclaration
>Statement : Statement
name: Identifier;
name?: Identifier;
>name : Identifier
>Identifier : Identifier
@@ -2153,7 +2156,7 @@ declare module "typescript" {
>Declaration : Declaration
>ModuleElement : ModuleElement
name: Identifier;
name?: Identifier;
>name : Identifier
>Identifier : Identifier
@@ -2255,18 +2258,10 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}
interface ExportContainer {
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;
>name : Identifier | LiteralExpression
@@ -2344,9 +2339,9 @@ declare module "typescript" {
>name : Identifier
>Identifier : Identifier
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportClause?: NamedExports;
@@ -2394,14 +2389,17 @@ declare module "typescript" {
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {
interface ExportAssignment extends Declaration, ModuleElement {
>ExportAssignment : ExportAssignment
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportName: Identifier;
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;
>isExportEquals : boolean
expression: Expression;
>expression : Expression
>Expression : Expression
}
interface FileReference extends TextRange {
>FileReference : FileReference
@@ -2417,10 +2415,9 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;
>hasTrailingNewLine : boolean
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;
>statements : NodeArray<ModuleElement>
@@ -3061,26 +3058,23 @@ declare module "typescript" {
interface EmitResolver {
>EmitResolver : EmitResolver
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
getGeneratedNameForNode(node: Node): string;
>getGeneratedNameForNode : (node: Node) => string
>node : Node
>Node : Node
getExpressionNameSubstitution(node: Identifier): string;
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
getExportAssignmentName(node: SourceFile): string;
>getExportAssignmentName : (node: SourceFile) => string
hasExportDefaultValue(node: SourceFile): boolean;
>hasExportDefaultValue : (node: SourceFile) => boolean
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: Node): boolean;
>isReferencedImportDeclaration : (node: Node) => boolean
isReferencedAliasDeclaration(node: Node): boolean;
>isReferencedAliasDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
@@ -3236,8 +3230,8 @@ declare module "typescript" {
ExportNamespace = 4194304,
>ExportNamespace : SymbolFlags
Import = 8388608,
>Import : SymbolFlags
Alias = 8388608,
>Alias : SymbolFlags
Instantiated = 16777216,
>Instantiated : SymbolFlags
@@ -3257,6 +3251,9 @@ declare module "typescript" {
Optional = 536870912,
>Optional : SymbolFlags
ExportStar = 1073741824,
>ExportStar : SymbolFlags
Enum = 384,
>Enum : SymbolFlags
@@ -3329,8 +3326,8 @@ declare module "typescript" {
TypeAliasExcludes = 793056,
>TypeAliasExcludes : SymbolFlags
ImportExcludes = 8388608,
>ImportExcludes : SymbolFlags
AliasExcludes = 8388608,
>AliasExcludes : SymbolFlags
ModuleMember = 8914931,
>ModuleMember : SymbolFlags
@@ -3421,13 +3418,6 @@ declare module "typescript" {
referenced?: boolean;
>referenced : boolean
exportAssignmentChecked?: boolean;
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;
>unionType : UnionType
>UnionType : UnionType
@@ -3435,6 +3425,9 @@ declare module "typescript" {
resolvedExports?: SymbolTable;
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
exportsChecked?: boolean;
>exportsChecked : boolean
}
interface TransientSymbol extends Symbol, SymbolLinks {
>TransientSymbol : TransientSymbol
+24 -25
View File
@@ -382,15 +382,16 @@ declare module "typescript" {
Private = 32,
Protected = 64,
Static = 128,
MultiLine = 256,
Synthetic = 512,
DeclarationFile = 1024,
Let = 2048,
Const = 4096,
OctalLiteral = 8192,
Modifier = 243,
Default = 256,
MultiLine = 512,
Synthetic = 1024,
DeclarationFile = 2048,
Let = 4096,
Const = 8192,
OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112,
BlockScoped = 6144,
BlockScoped = 12288,
}
const enum ParserContextFlags {
StrictMode = 1,
@@ -518,7 +519,7 @@ declare module "typescript" {
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -751,7 +752,7 @@ declare module "typescript" {
_moduleElementBrand: any;
}
interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -781,10 +782,7 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -809,7 +807,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -824,8 +822,9 @@ declare module "typescript" {
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression: Expression;
}
interface FileReference extends TextRange {
fileName: string;
@@ -833,7 +832,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@@ -996,10 +995,10 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -1036,13 +1035,14 @@ declare module "typescript" {
ExportValue = 1048576,
ExportType = 2097152,
ExportNamespace = 4194304,
Import = 8388608,
Alias = 8388608,
Instantiated = 16777216,
Merged = 33554432,
Transient = 67108864,
Prototype = 134217728,
UnionProperty = 268435456,
Optional = 536870912,
ExportStar = 1073741824,
Enum = 384,
Variable = 3,
Value = 107455,
@@ -1067,7 +1067,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056,
ImportExcludes = 8388608,
AliasExcludes = 8388608,
ModuleMember = 8914931,
ExportHasLocal = 944,
HasLocals = 255504,
@@ -1096,10 +1096,9 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
exportsChecked?: boolean;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@@ -1223,31 +1223,34 @@ declare module "typescript" {
Static = 128,
>Static : NodeFlags
MultiLine = 256,
Default = 256,
>Default : NodeFlags
MultiLine = 512,
>MultiLine : NodeFlags
Synthetic = 512,
Synthetic = 1024,
>Synthetic : NodeFlags
DeclarationFile = 1024,
DeclarationFile = 2048,
>DeclarationFile : NodeFlags
Let = 2048,
Let = 4096,
>Let : NodeFlags
Const = 4096,
Const = 8192,
>Const : NodeFlags
OctalLiteral = 8192,
OctalLiteral = 16384,
>OctalLiteral : NodeFlags
Modifier = 243,
Modifier = 499,
>Modifier : NodeFlags
AccessibilityModifier = 112,
>AccessibilityModifier : NodeFlags
BlockScoped = 6144,
BlockScoped = 12288,
>BlockScoped : NodeFlags
}
const enum ParserContextFlags {
@@ -1639,7 +1642,7 @@ declare module "typescript" {
>FunctionLikeDeclaration : FunctionLikeDeclaration
>Statement : Statement
name: Identifier;
name?: Identifier;
>name : Identifier
>Identifier : Identifier
@@ -2326,7 +2329,7 @@ declare module "typescript" {
>Declaration : Declaration
>ModuleElement : ModuleElement
name: Identifier;
name?: Identifier;
>name : Identifier
>Identifier : Identifier
@@ -2428,18 +2431,10 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}
interface ExportContainer {
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;
>name : Identifier | LiteralExpression
@@ -2517,9 +2512,9 @@ declare module "typescript" {
>name : Identifier
>Identifier : Identifier
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportClause?: NamedExports;
@@ -2567,14 +2562,17 @@ declare module "typescript" {
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {
interface ExportAssignment extends Declaration, ModuleElement {
>ExportAssignment : ExportAssignment
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportName: Identifier;
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;
>isExportEquals : boolean
expression: Expression;
>expression : Expression
>Expression : Expression
}
interface FileReference extends TextRange {
>FileReference : FileReference
@@ -2590,10 +2588,9 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;
>hasTrailingNewLine : boolean
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;
>statements : NodeArray<ModuleElement>
@@ -3234,26 +3231,23 @@ declare module "typescript" {
interface EmitResolver {
>EmitResolver : EmitResolver
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
getGeneratedNameForNode(node: Node): string;
>getGeneratedNameForNode : (node: Node) => string
>node : Node
>Node : Node
getExpressionNameSubstitution(node: Identifier): string;
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
getExportAssignmentName(node: SourceFile): string;
>getExportAssignmentName : (node: SourceFile) => string
hasExportDefaultValue(node: SourceFile): boolean;
>hasExportDefaultValue : (node: SourceFile) => boolean
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: Node): boolean;
>isReferencedImportDeclaration : (node: Node) => boolean
isReferencedAliasDeclaration(node: Node): boolean;
>isReferencedAliasDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
@@ -3409,8 +3403,8 @@ declare module "typescript" {
ExportNamespace = 4194304,
>ExportNamespace : SymbolFlags
Import = 8388608,
>Import : SymbolFlags
Alias = 8388608,
>Alias : SymbolFlags
Instantiated = 16777216,
>Instantiated : SymbolFlags
@@ -3430,6 +3424,9 @@ declare module "typescript" {
Optional = 536870912,
>Optional : SymbolFlags
ExportStar = 1073741824,
>ExportStar : SymbolFlags
Enum = 384,
>Enum : SymbolFlags
@@ -3502,8 +3499,8 @@ declare module "typescript" {
TypeAliasExcludes = 793056,
>TypeAliasExcludes : SymbolFlags
ImportExcludes = 8388608,
>ImportExcludes : SymbolFlags
AliasExcludes = 8388608,
>AliasExcludes : SymbolFlags
ModuleMember = 8914931,
>ModuleMember : SymbolFlags
@@ -3594,13 +3591,6 @@ declare module "typescript" {
referenced?: boolean;
>referenced : boolean
exportAssignmentChecked?: boolean;
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;
>unionType : UnionType
>UnionType : UnionType
@@ -3608,6 +3598,9 @@ declare module "typescript" {
resolvedExports?: SymbolTable;
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
exportsChecked?: boolean;
>exportsChecked : boolean
}
interface TransientSymbol extends Symbol, SymbolLinks {
>TransientSymbol : TransientSymbol
@@ -1,6 +1,6 @@
tests/cases/compiler/ExportAssignment7.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/compiler/ExportAssignment7.ts(4,1): error TS2304: Cannot find name 'B'.
tests/cases/compiler/ExportAssignment7.ts(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
tests/cases/compiler/ExportAssignment7.ts(4,10): error TS2304: Cannot find name 'B'.
==== tests/cases/compiler/ExportAssignment7.ts (3 errors) ====
@@ -11,6 +11,6 @@ tests/cases/compiler/ExportAssignment7.ts(4,1): error TS2309: An export assignme
export = B;
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'B'.
~~~~~~~~~~~
!!! error TS2309: An export assignment cannot be used in a module with other exported elements.
!!! error TS2309: An export assignment cannot be used in a module with other exported elements.
~
!!! error TS2304: Cannot find name 'B'.
@@ -1,6 +1,6 @@
tests/cases/compiler/ExportAssignment8.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/compiler/ExportAssignment8.ts(1,1): error TS2304: Cannot find name 'B'.
tests/cases/compiler/ExportAssignment8.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
tests/cases/compiler/ExportAssignment8.ts(1,10): error TS2304: Cannot find name 'B'.
==== tests/cases/compiler/ExportAssignment8.ts (3 errors) ====
@@ -8,9 +8,9 @@ tests/cases/compiler/ExportAssignment8.ts(1,1): error TS2309: An export assignme
~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'B'.
~~~~~~~~~~~
!!! error TS2309: An export assignment cannot be used in a module with other exported elements.
~
!!! error TS2304: Cannot find name 'B'.
export class C {
}
@@ -1,4 +1,4 @@
tests/cases/compiler/aliasBug.ts(17,10): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
tests/cases/compiler/aliasBug.ts(17,15): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
==== tests/cases/compiler/aliasBug.ts (1 errors) ====
@@ -19,7 +19,7 @@ tests/cases/compiler/aliasBug.ts(17,10): error TS2305: Module 'foo.bar.baz' has
var p1: provide.Provide; // error here, but should be okay
var p2: foo.Provide;
var p3:booz.bar;
~~~~~~~~
~~~
!!! error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
var p22 = new provide.Provide();
}
@@ -1,10 +1,10 @@
tests/cases/compiler/aliasErrors.ts(11,1): error TS2304: Cannot find name 'no'.
tests/cases/compiler/aliasErrors.ts(12,1): error TS2304: Cannot find name 'no'.
tests/cases/compiler/aliasErrors.ts(11,12): error TS2304: Cannot find name 'no'.
tests/cases/compiler/aliasErrors.ts(12,13): error TS2304: Cannot find name 'no'.
tests/cases/compiler/aliasErrors.ts(13,12): error TS1003: Identifier expected.
tests/cases/compiler/aliasErrors.ts(14,12): error TS1003: Identifier expected.
tests/cases/compiler/aliasErrors.ts(15,12): error TS1003: Identifier expected.
tests/cases/compiler/aliasErrors.ts(16,1): error TS2304: Cannot find name 'undefined'.
tests/cases/compiler/aliasErrors.ts(26,10): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
tests/cases/compiler/aliasErrors.ts(16,12): error TS2304: Cannot find name 'undefined'.
tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
==== tests/cases/compiler/aliasErrors.ts (7 errors) ====
@@ -19,10 +19,10 @@ tests/cases/compiler/aliasErrors.ts(26,10): error TS2305: Module 'foo.bar.baz' h
import beez = foo.bar;
import m = no;
~~~~~~~~~~~~~~
~~
!!! error TS2304: Cannot find name 'no'.
import m2 = no.mod;
~~~~~~~~~~~~~~~~~~~
~~
!!! error TS2304: Cannot find name 'no'.
import n = 5;
~
@@ -34,7 +34,7 @@ tests/cases/compiler/aliasErrors.ts(26,10): error TS2305: Module 'foo.bar.baz' h
~~~~
!!! error TS1003: Identifier expected.
import r = undefined;
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~
!!! error TS2304: Cannot find name 'undefined'.
@@ -46,7 +46,7 @@ tests/cases/compiler/aliasErrors.ts(26,10): error TS2305: Module 'foo.bar.baz' h
var p1: provide.Provide;
var p2: foo.Provide;
var p3:booz.bar;
~~~~~~~~
~~~
!!! error TS2305: Module 'foo.bar.baz' has no exported member 'bar'.
var p22 = new provide.Provide();
}
@@ -1,4 +1,4 @@
tests/cases/compiler/classExtendingQualifiedName.ts(5,21): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/compiler/classExtendingQualifiedName.ts(5,23): error TS2305: Module 'M' has no exported member 'C'.
==== tests/cases/compiler/classExtendingQualifiedName.ts (1 errors) ====
@@ -7,7 +7,7 @@ tests/cases/compiler/classExtendingQualifiedName.ts(5,21): error TS2305: Module
}
class D extends M.C {
~~~
~
!!! error TS2305: Module 'M' has no exported member 'C'.
}
}
@@ -1,7 +1,7 @@
tests/cases/compiler/complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters.
tests/cases/compiler/complicatedPrivacy.ts(35,5): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol.
tests/cases/compiler/complicatedPrivacy.ts(35,6): error TS2304: Cannot find name 'number'.
tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5' has no exported member 'i6'.
tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2305: Module 'mglo5' has no exported member 'i6'.
==== tests/cases/compiler/complicatedPrivacy.ts (4 errors) ====
@@ -84,7 +84,7 @@ tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5'
export module m3 {
export class c_pr implements mglo5.i5, mglo5.i6 {
~~~~~~~~
~~
!!! error TS2305: Module 'mglo5' has no exported member 'i6'.
f1() {
return "Hello";
@@ -1,2 +1,2 @@
//// [computedPropertyNamesSourceMap1_ES5.js.map]
{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":["C","C.constructor","C[\"hello\"]"],"mappings":"AAAA,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAIPC,CAACA;IAHGD,YAACA,OAAOA,CAACA,GAATA;QACIE,QAAQA,CAACA;IACbA,CAACA;IACLF,QAACA;AAADA,CAACA,AAJD,IAIC"}
{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":["C","C.constructor","C[\"hello\"]"],"mappings":"AAAA;IAAAA;IAIAC,CAACA;IAHGD,YAACA,OAAOA,CAACA,GAATA;QACIE,QAAQA,CAACA;IACbA,CAACA;IACLF,QAACA;AAADA,CAACA,AAJD,IAIC"}
@@ -10,38 +10,27 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts
-------------------------------------------------------------------
>>>var C = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
2 >class
3 > C
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(1, 8) + SourceIndex(0)
---
>>> function C() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
2 > ^^->
1->
2 > class
3 > C
1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
2 >Emitted(2, 14) Source(1, 7) + SourceIndex(0) name (C)
3 >Emitted(2, 15) Source(1, 8) + SourceIndex(0) name (C)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 > {
1->class C {
> ["hello"]() {
> debugger;
> }
>
2 > }
1 >Emitted(3, 5) Source(5, 1) + SourceIndex(0) name (C.constructor)
1->Emitted(3, 5) Source(5, 1) + SourceIndex(0) name (C.constructor)
2 >Emitted(3, 6) Source(5, 2) + SourceIndex(0) name (C.constructor)
---
>>> C.prototype["hello"] = function () {
@@ -1,2 +1,2 @@
//// [computedPropertyNamesSourceMap1_ES6.js.map]
{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":["C","C.constructor","C[\"hello\"]"],"mappings":"AAAA,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAIPC,CAACA;IAHGD,YAACA,OAAOA,CAACA,GAATA;QACIE,QAAQA,CAACA;IACbA,CAACA;IACLF,QAACA;AAADA,CAACA,AAJD,IAIC"}
{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":["C","C.constructor","C[\"hello\"]"],"mappings":"AAAA;IAAAA;IAIAC,CAACA;IAHGD,YAACA,OAAOA,CAACA,GAATA;QACIE,QAAQA,CAACA;IACbA,CAACA;IACLF,QAACA;AAADA,CAACA,AAJD,IAIC"}
@@ -10,38 +10,27 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts
-------------------------------------------------------------------
>>>var C = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
2 >class
3 > C
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(1, 8) + SourceIndex(0)
---
>>> function C() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
2 > ^^->
1->
2 > class
3 > C
1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
2 >Emitted(2, 14) Source(1, 7) + SourceIndex(0) name (C)
3 >Emitted(2, 15) Source(1, 8) + SourceIndex(0) name (C)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 > {
1->class C {
> ["hello"]() {
> debugger;
> }
>
2 > }
1 >Emitted(3, 5) Source(5, 1) + SourceIndex(0) name (C.constructor)
1->Emitted(3, 5) Source(5, 1) + SourceIndex(0) name (C.constructor)
2 >Emitted(3, 6) Source(5, 2) + SourceIndex(0) name (C.constructor)
---
>>> C.prototype["hello"] = function () {
@@ -1,4 +1,4 @@
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,1): error TS2304: Cannot find name 'module'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2304: Cannot find name 'module'.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected.
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
@@ -96,7 +96,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS
}
import fs = module("fs");
~~~~~~~~~~~~~~~~~~
~~~~~~
!!! error TS2304: Cannot find name 'module'.
~
!!! error TS1005: ';' expected.
@@ -1,2 +1,2 @@
//// [contextualTyping.js.map]
{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":["C1T5","C1T5.constructor","C2T5","C4T5","C4T5.constructor","C5T5","c9t5","C11t5","C11t5.constructor","EF1","Point"],"mappings":"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 truncated
{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":["C1T5","C1T5.constructor","C2T5","C4T5","C4T5.constructor","C5T5","c9t5","C11t5","C11t5.constructor","EF1","Point"],"mappings":"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 truncated
@@ -33,26 +33,12 @@ sourceFile:contextualTyping.ts
3 >Emitted(1, 39) Source(13, 39) + SourceIndex(0)
---
>>>var C1T5 = (function () {
1 >^^^^
2 > ^^^^
3 > ^^^^^^^^^^^^^^->
1 >
>class
2 > C1T5
1 >Emitted(2, 5) Source(14, 7) + SourceIndex(0)
2 >Emitted(2, 9) Source(14, 11) + SourceIndex(0)
---
>>> function C1T5() {
1->^^^^
2 > ^^^^^^^^^
3 > ^^^^
4 > ^^^^^^^^^^^^^^^^^->
1->
2 > class
3 > C1T5
1->Emitted(3, 5) Source(14, 1) + SourceIndex(0) name (C1T5)
2 >Emitted(3, 14) Source(14, 7) + SourceIndex(0) name (C1T5)
3 >Emitted(3, 18) Source(14, 11) + SourceIndex(0) name (C1T5)
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(3, 5) Source(14, 1) + SourceIndex(0) name (C1T5)
---
>>> this.foo = function (i) {
1->^^^^^^^^
@@ -60,7 +46,7 @@ sourceFile:contextualTyping.ts
3 > ^^^
4 > ^^^^^^^^^^
5 > ^
1-> {
1->class C1T5 {
>
2 > foo
3 > : (i: number, s: string) => number =
@@ -972,28 +958,14 @@ sourceFile:contextualTyping.ts
3 >Emitted(40, 38) Source(55, 38) + SourceIndex(0)
---
>>>var C4T5 = (function () {
1 >^^^^
2 > ^^^^
3 > ^^^^^^^^^^^^^^->
1 >
>class
2 > C4T5
1 >Emitted(41, 5) Source(56, 7) + SourceIndex(0)
2 >Emitted(41, 9) Source(56, 11) + SourceIndex(0)
---
>>> function C4T5() {
1->^^^^
2 > ^^^^^^^^^
3 > ^^^^
4 > ^^^^^^^^^^^^^^^^^^^^->
1-> {
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>class C4T5 {
> foo: (i: number, s: string) => string;
>
2 >
3 > C4T5
1->Emitted(42, 5) Source(58, 5) + SourceIndex(0) name (C4T5)
2 >Emitted(42, 14) Source(56, 7) + SourceIndex(0) name (C4T5)
3 >Emitted(42, 18) Source(56, 11) + SourceIndex(0) name (C4T5)
1 >Emitted(42, 5) Source(58, 5) + SourceIndex(0) name (C4T5)
---
>>> this.foo = function (i, s) {
1->^^^^^^^^
@@ -1005,9 +977,7 @@ sourceFile:contextualTyping.ts
7 > ^
8 > ^^
9 > ^
1-> {
> foo: (i: number, s: string) => string;
> constructor() {
1->constructor() {
>
2 > this
3 > .
@@ -2193,25 +2163,19 @@ sourceFile:contextualTyping.ts
3 >Emitted(86, 26) Source(145, 26) + SourceIndex(0)
---
>>>function c9t5(f) { }
1 >^^^^^^^^^
2 > ^^^^
3 > ^
4 > ^
5 > ^^^^
6 > ^
1 >^^^^^^^^^^^^^^
2 > ^
3 > ^^^^
4 > ^
1 >
>function
2 > c9t5
3 > (
4 > f: (n: number) => IFoo
5 > ) {
6 > }
1 >Emitted(87, 10) Source(146, 10) + SourceIndex(0)
2 >Emitted(87, 14) Source(146, 14) + SourceIndex(0)
3 >Emitted(87, 15) Source(146, 15) + SourceIndex(0)
4 >Emitted(87, 16) Source(146, 37) + SourceIndex(0)
5 >Emitted(87, 20) Source(146, 40) + SourceIndex(0) name (c9t5)
6 >Emitted(87, 21) Source(146, 41) + SourceIndex(0) name (c9t5)
>function c9t5(
2 > f: (n: number) => IFoo
3 > ) {
4 > }
1 >Emitted(87, 15) Source(146, 15) + SourceIndex(0)
2 >Emitted(87, 16) Source(146, 37) + SourceIndex(0)
3 >Emitted(87, 20) Source(146, 40) + SourceIndex(0) name (c9t5)
4 >Emitted(87, 21) Source(146, 41) + SourceIndex(0) name (c9t5)
---
>>>;
1 >
@@ -2378,31 +2342,17 @@ sourceFile:contextualTyping.ts
3 >Emitted(94, 27) Source(154, 27) + SourceIndex(0)
---
>>>var C11t5 = (function () {
1->^^^^
2 > ^^^^^
3 > ^^^^^^^^^^^^^^^->
1->
>class
2 > C11t5
1->Emitted(95, 5) Source(155, 7) + SourceIndex(0)
2 >Emitted(95, 10) Source(155, 12) + SourceIndex(0)
---
>>> function C11t5(f) {
1->^^^^
2 > ^^^^^^^^^
3 > ^^^^^
4 > ^
5 > ^
1-> {
2 >
3 > C11t5
4 > { constructor(
5 > f: (n: number) => IFoo
2 > ^^^^^^^^^^^^^^^
3 > ^
1->
>class C11t5 {
2 > constructor(
3 > f: (n: number) => IFoo
1->Emitted(96, 5) Source(155, 15) + SourceIndex(0) name (C11t5)
2 >Emitted(96, 14) Source(155, 7) + SourceIndex(0) name (C11t5)
3 >Emitted(96, 19) Source(155, 12) + SourceIndex(0) name (C11t5)
4 >Emitted(96, 20) Source(155, 27) + SourceIndex(0) name (C11t5)
5 >Emitted(96, 21) Source(155, 49) + SourceIndex(0) name (C11t5)
2 >Emitted(96, 20) Source(155, 27) + SourceIndex(0) name (C11t5)
3 >Emitted(96, 21) Source(155, 49) + SourceIndex(0) name (C11t5)
---
>>> }
1 >^^^^
@@ -3197,21 +3147,19 @@ sourceFile:contextualTyping.ts
---
>>>function EF1(a, b) { return a + b; }
1->
2 >^^^^^^^^^
3 > ^^^
4 > ^
5 > ^
6 > ^^
7 > ^
8 > ^^^^
9 > ^^^^^^
10> ^
11> ^
12> ^^^
13> ^
14> ^
15> ^
16> ^
2 >^^^^^^^^^^^^^
3 > ^
4 > ^^
5 > ^
6 > ^^^^
7 > ^^^^^^
8 > ^
9 > ^
10> ^^^
11> ^
12> ^
13> ^
14> ^
1->
>
>// CONTEXT: Contextual typing declarations
@@ -3220,37 +3168,33 @@ sourceFile:contextualTyping.ts
>declare function EF1(a:number, b:number):number;
>
>
2 >function
3 > EF1
4 > (
5 > a
6 > ,
7 > b
8 > ) {
9 > return
10>
11> a
12> +
13> b
14> ;
15>
16> }
2 >function EF1(
3 > a
4 > ,
5 > b
6 > ) {
7 > return
8 >
9 > a
10> +
11> b
12> ;
13>
14> }
1->Emitted(125, 1) Source(191, 1) + SourceIndex(0)
2 >Emitted(125, 10) Source(191, 10) + SourceIndex(0)
3 >Emitted(125, 13) Source(191, 13) + SourceIndex(0)
4 >Emitted(125, 14) Source(191, 14) + SourceIndex(0)
5 >Emitted(125, 15) Source(191, 15) + SourceIndex(0)
6 >Emitted(125, 17) Source(191, 16) + SourceIndex(0)
7 >Emitted(125, 18) Source(191, 17) + SourceIndex(0)
8 >Emitted(125, 22) Source(191, 21) + SourceIndex(0) name (EF1)
9 >Emitted(125, 28) Source(191, 27) + SourceIndex(0) name (EF1)
10>Emitted(125, 29) Source(191, 28) + SourceIndex(0) name (EF1)
11>Emitted(125, 30) Source(191, 29) + SourceIndex(0) name (EF1)
12>Emitted(125, 33) Source(191, 30) + SourceIndex(0) name (EF1)
13>Emitted(125, 34) Source(191, 31) + SourceIndex(0) name (EF1)
14>Emitted(125, 35) Source(191, 32) + SourceIndex(0) name (EF1)
15>Emitted(125, 36) Source(191, 33) + SourceIndex(0) name (EF1)
16>Emitted(125, 37) Source(191, 34) + SourceIndex(0) name (EF1)
2 >Emitted(125, 14) Source(191, 14) + SourceIndex(0)
3 >Emitted(125, 15) Source(191, 15) + SourceIndex(0)
4 >Emitted(125, 17) Source(191, 16) + SourceIndex(0)
5 >Emitted(125, 18) Source(191, 17) + SourceIndex(0)
6 >Emitted(125, 22) Source(191, 21) + SourceIndex(0) name (EF1)
7 >Emitted(125, 28) Source(191, 27) + SourceIndex(0) name (EF1)
8 >Emitted(125, 29) Source(191, 28) + SourceIndex(0) name (EF1)
9 >Emitted(125, 30) Source(191, 29) + SourceIndex(0) name (EF1)
10>Emitted(125, 33) Source(191, 30) + SourceIndex(0) name (EF1)
11>Emitted(125, 34) Source(191, 31) + SourceIndex(0) name (EF1)
12>Emitted(125, 35) Source(191, 32) + SourceIndex(0) name (EF1)
13>Emitted(125, 36) Source(191, 33) + SourceIndex(0) name (EF1)
14>Emitted(125, 37) Source(191, 34) + SourceIndex(0) name (EF1)
---
>>>var efv = EF1(1, 2);
1 >
@@ -3292,12 +3236,10 @@ sourceFile:contextualTyping.ts
---
>>>function Point(x, y) {
1->
2 >^^^^^^^^^
3 > ^^^^^
4 > ^
5 > ^
6 > ^^
7 > ^
2 >^^^^^^^^^^^^^^^
3 > ^
4 > ^^
5 > ^
1->
>
>
@@ -3313,19 +3255,15 @@ sourceFile:contextualTyping.ts
>}
>
>
2 >function
3 > Point
4 > (
5 > x
6 > ,
7 > y
2 >function Point(
3 > x
4 > ,
5 > y
1->Emitted(127, 1) Source(207, 1) + SourceIndex(0)
2 >Emitted(127, 10) Source(207, 10) + SourceIndex(0)
3 >Emitted(127, 15) Source(207, 15) + SourceIndex(0)
4 >Emitted(127, 16) Source(207, 16) + SourceIndex(0)
5 >Emitted(127, 17) Source(207, 17) + SourceIndex(0)
6 >Emitted(127, 19) Source(207, 19) + SourceIndex(0)
7 >Emitted(127, 20) Source(207, 20) + SourceIndex(0)
2 >Emitted(127, 16) Source(207, 16) + SourceIndex(0)
3 >Emitted(127, 17) Source(207, 17) + SourceIndex(0)
4 >Emitted(127, 19) Source(207, 19) + SourceIndex(0)
5 >Emitted(127, 20) Source(207, 20) + SourceIndex(0)
---
>>> this.x = x;
1 >^^^^
@@ -42,23 +42,23 @@ module m2 {
}
var m2: {
>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; }
>m2 : { (): default.connectExport; test1: default.connectModule; test2(): default.connectModule; }
(): m2.connectExport;
>m2 : unknown
>connectExport : m2.connectExport
>connectExport : default.connectExport
test1: m2.connectModule;
>test1 : m2.connectModule
>test1 : default.connectModule
>m2 : unknown
>connectModule : m2.connectModule
>connectModule : default.connectModule
test2(): m2.connectModule;
>test2 : () => m2.connectModule
>test2 : () => default.connectModule
>m2 : unknown
>connectModule : m2.connectModule
>connectModule : default.connectModule
};
export = m2;
>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; }
>m2 : { (): default.connectExport; test1: default.connectModule; test2(): default.connectModule; }
@@ -7,7 +7,7 @@ declare module "express" {
function express(): express.ExpressServer;
>express : typeof express
>express : unknown
>ExpressServer : express.ExpressServer
>ExpressServer : default.ExpressServer
module express {
>express : typeof express
@@ -27,24 +27,24 @@ module m2 {
}
var m2: {
>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; }
>m2 : { (): default.connectExport; test1: default.connectModule; test2(): default.connectModule; }
(): m2.connectExport;
>m2 : unknown
>connectExport : m2.connectExport
>connectExport : default.connectExport
test1: m2.connectModule;
>test1 : m2.connectModule
>test1 : default.connectModule
>m2 : unknown
>connectModule : m2.connectModule
>connectModule : default.connectModule
test2(): m2.connectModule;
>test2 : () => m2.connectModule
>test2 : () => default.connectModule
>m2 : unknown
>connectModule : m2.connectModule
>connectModule : default.connectModule
};
export = m2;
>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; }
>m2 : { (): default.connectExport; test1: default.connectModule; test2(): default.connectModule; }
@@ -28,24 +28,24 @@ module m2 {
var x = 10, m2: {
>x : number
>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; }
>m2 : { (): default.connectExport; test1: default.connectModule; test2(): default.connectModule; }
(): m2.connectExport;
>m2 : unknown
>connectExport : m2.connectExport
>connectExport : default.connectExport
test1: m2.connectModule;
>test1 : m2.connectModule
>test1 : default.connectModule
>m2 : unknown
>connectModule : m2.connectModule
>connectModule : default.connectModule
test2(): m2.connectModule;
>test2 : () => m2.connectModule
>test2 : () => default.connectModule
>m2 : unknown
>connectModule : m2.connectModule
>connectModule : default.connectModule
};
export = m2;
>m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; }
>m2 : { (): default.connectExport; test1: default.connectModule; test2(): default.connectModule; }
@@ -1,10 +1,10 @@
tests/cases/compiler/declareModifierOnImport1.ts(1,1): error TS1079: A 'declare' modifier cannot be used with an import declaration.
tests/cases/compiler/declareModifierOnImport1.ts(1,1): error TS2304: Cannot find name 'b'.
tests/cases/compiler/declareModifierOnImport1.ts(1,20): error TS2304: Cannot find name 'b'.
==== tests/cases/compiler/declareModifierOnImport1.ts (2 errors) ====
declare import a = b;
~~~~~~~
!!! error TS1079: A 'declare' modifier cannot be used with an import declaration.
~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS2304: Cannot find name 'b'.
@@ -1,15 +1,15 @@
tests/cases/conformance/externalModules/foo1.ts(3,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/externalModules/foo1.ts(3,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo1.ts(4,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo2.ts(3,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo2.ts(4,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo3.ts(7,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo3.ts(8,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo4.ts(1,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo4.ts(8,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo5.ts(4,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo5.ts(5,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/conformance/externalModules/foo1.ts(3,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo1.ts(4,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo2.ts(3,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo2.ts(4,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo3.ts(7,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo3.ts(8,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo4.ts(1,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo4.ts(8,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo5.ts(4,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo5.ts(5,1): error TS2300: Duplicate identifier 'default'.
tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2300: Duplicate identifier 'default'.
==== tests/cases/conformance/externalModules/foo1.ts (3 errors) ====
@@ -19,20 +19,20 @@ tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2308: A module can
~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
export = y;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ====
var x = 10;
class y {};
export = x;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
export = y;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
==== tests/cases/conformance/externalModules/foo3.ts (2 errors) ====
module x {
@@ -43,15 +43,15 @@ tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2308: A module can
}
export = x;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
export = y;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
==== tests/cases/conformance/externalModules/foo4.ts (2 errors) ====
export = x;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
function x(){
return 42;
}
@@ -60,7 +60,7 @@ tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2308: A module can
}
export = y;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
==== tests/cases/conformance/externalModules/foo5.ts (3 errors) ====
var x = 5;
@@ -68,11 +68,11 @@ tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2308: A module can
var z = {};
export = x;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
export = y;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
export = z;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
+1 -1
View File
@@ -1,2 +1,2 @@
//// [es3-amd.js.map]
{"version":3,"file":"es3-amd.js","sourceRoot":"","sources":["es3-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es3-amd.js","sourceRoot":"","sources":["es3-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es3-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
@@ -1,2 +1,2 @@
//// [es3-declaration-amd.js.map]
{"version":3,"file":"es3-declaration-amd.js","sourceRoot":"","sources":["es3-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es3-declaration-amd.js","sourceRoot":"","sources":["es3-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es3-declaration-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
@@ -1,2 +1,2 @@
//// [es3-sourcemap-amd.js.map]
{"version":3,"file":"es3-sourcemap-amd.js","sourceRoot":"","sources":["es3-sourcemap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es3-sourcemap-amd.js","sourceRoot":"","sources":["es3-sourcemap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es3-sourcemap-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
+1 -1
View File
@@ -1,2 +1,2 @@
//// [es5-amd.js.map]
{"version":3,"file":"es5-amd.js","sourceRoot":"","sources":["es5-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es5-amd.js","sourceRoot":"","sources":["es5-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es5-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
@@ -1,2 +1,2 @@
//// [es5-declaration-amd.js.map]
{"version":3,"file":"es5-declaration-amd.js","sourceRoot":"","sources":["es5-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es5-declaration-amd.js","sourceRoot":"","sources":["es5-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es5-declaration-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
@@ -1,2 +1,2 @@
//// [es5-souremap-amd.js.map]
{"version":3,"file":"es5-souremap-amd.js","sourceRoot":"","sources":["es5-souremap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es5-souremap-amd.js","sourceRoot":"","sources":["es5-souremap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es5-souremap-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
+1 -1
View File
@@ -1,2 +1,2 @@
//// [es6-amd.js.map]
{"version":3,"file":"es6-amd.js","sourceRoot":"","sources":["es6-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es6-amd.js","sourceRoot":"","sources":["es6-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es6-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
@@ -1,2 +1,2 @@
//// [es6-declaration-amd.js.map]
{"version":3,"file":"es6-declaration-amd.js","sourceRoot":"","sources":["es6-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es6-declaration-amd.js","sourceRoot":"","sources":["es6-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es6-declaration-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
@@ -1,2 +1,2 @@
//// [es6-sourcemap-amd.js.map]
{"version":3,"file":"es6-sourcemap-amd.js","sourceRoot":"","sources":["es6-sourcemap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
{"version":3,"file":"es6-sourcemap-amd.js","sourceRoot":"","sources":["es6-sourcemap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
@@ -10,42 +10,29 @@ sourceFile:es6-sourcemap-amd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^
3 > ^
4 > ^^^^^^^^^^^^^^->
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >class
3 > A
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^^^^^^^^
3 > ^
1->
2 > ^^->
1->class A
>{
>
2 >
3 > A
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A)
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>{
> constructor ()
1->constructor ()
> {
>
>
2 > }
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
@@ -22,9 +22,9 @@ class Foo {
>Foo : Foo
x: Foo.Bar;
>x : Foo.Bar
>x : default.Bar
>Foo : unknown
>Bar : Foo.Bar
>Bar : default.Bar
}
module Foo {
>Foo : typeof Foo
@@ -1,15 +1,9 @@
tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/externalModules/foo2.ts(2,14): error TS1005: ';' expected.
tests/cases/conformance/externalModules/foo2.ts(2,15): error TS2304: Cannot find name 'x'.
==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ====
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
import foo1 = require('./foo1');
export = foo1.x; // Error, export assignment must be identifier only
~
!!! error TS1005: ';' expected.
~
!!! error TS2304: Cannot find name 'x'.
export = foo1.x; // Ok
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
export function x(){
@@ -7,7 +7,7 @@ export function x(){
//// [foo2.ts]
import foo1 = require('./foo1');
export = foo1.x; // Error, export assignment must be identifier only
export = foo1.x; // Ok
//// [foo1.js]
@@ -17,5 +17,4 @@ function x() {
exports.x = x;
//// [foo2.js]
var foo1 = require('./foo1');
x; // Error, export assignment must be identifier only
module.exports = foo1;
module.exports = foo1.x;
@@ -1,55 +1,37 @@
tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/externalModules/foo1.ts(2,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo2.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo4.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo6.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1109: Expression expected.
tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression expected.
tests/cases/conformance/externalModules/foo7.ts(1,15): error TS1005: ';' expected.
tests/cases/conformance/externalModules/foo8.ts(1,10): error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ====
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
var x = 10;
export = typeof x; // Error
~~~~~~~~
export = typeof x; // Ok
~~~~~~~~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo2.ts (1 errors) ====
export = "sausages"; // Error
~~~~~~~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
export = "sausages"; // Ok
==== tests/cases/conformance/externalModules/foo3.ts (1 errors) ====
export = class Foo3 {}; // Error
export = class Foo3 {}; // Error, not an expression
~~~~~
!!! error TS1003: Identifier expected.
!!! error TS1109: Expression expected.
==== tests/cases/conformance/externalModules/foo4.ts (1 errors) ====
export = true; // Error
~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo4.ts (0 errors) ====
export = true; // Ok
==== tests/cases/conformance/externalModules/foo5.ts (0 errors) ====
export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript
==== tests/cases/conformance/externalModules/foo6.ts (2 errors) ====
export = void; // Error
~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo6.ts (1 errors) ====
export = void; // Error, void operator requires an argument
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/externalModules/foo7.ts (1 errors) ====
export = Date || String; // Error
~~
!!! error TS1005: ';' expected.
==== tests/cases/conformance/externalModules/foo7.ts (0 errors) ====
export = Date || String; // Ok
==== tests/cases/conformance/externalModules/foo8.ts (1 errors) ====
export = null; // Error
~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo8.ts (0 errors) ====
export = null; // Ok
@@ -2,51 +2,50 @@
//// [foo1.ts]
var x = 10;
export = typeof x; // Error
export = typeof x; // Ok
//// [foo2.ts]
export = "sausages"; // Error
export = "sausages"; // Ok
//// [foo3.ts]
export = class Foo3 {}; // Error
export = class Foo3 {}; // Error, not an expression
//// [foo4.ts]
export = true; // Error
export = true; // Ok
//// [foo5.ts]
export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript
//// [foo6.ts]
export = void; // Error
export = void; // Error, void operator requires an argument
//// [foo7.ts]
export = Date || String; // Error
export = Date || String; // Ok
//// [foo8.ts]
export = null; // Error
export = null; // Ok
//// [foo1.js]
var x = 10;
typeof x; // Error
module.exports = typeof x;
//// [foo2.js]
"sausages"; // Error
module.exports = "sausages";
//// [foo3.js]
var Foo3 = (function () {
function Foo3() {
}
return Foo3;
})();
; // Error
; // Error, not an expression
//// [foo4.js]
true; // Error
module.exports = true;
//// [foo5.js]
module.exports = undefined;
//// [foo6.js]
void ; // Error
module.exports = void ;
//// [foo7.js]
|| String; // Error
module.exports = Date;
module.exports = Date || String;
//// [foo8.js]
null; // Error
module.exports = null;
@@ -1,14 +0,0 @@
tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts(7,10): error TS1003: Identifier expected.
==== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts (1 errors) ====
function Greeter() {
//...
}
Greeter.prototype.greet = function () {
//...
}
export = new Greeter();
~~~
!!! error TS1003: Identifier expected.
@@ -15,4 +15,4 @@ function Greeter() {
Greeter.prototype.greet = function () {
//...
};
new Greeter();
module.exports = new Greeter();
@@ -0,0 +1,21 @@
=== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts ===
function Greeter() {
>Greeter : () => void
//...
}
Greeter.prototype.greet = function () {
>Greeter.prototype.greet = function () { //...} : () => void
>Greeter.prototype.greet : any
>Greeter.prototype : any
>Greeter : () => void
>prototype : any
>greet : any
>function () { //...} : () => void
//...
}
export = new Greeter();
>new Greeter() : any
>Greeter : () => void
@@ -12,7 +12,7 @@ interface server {
(): server.Server;
>server : unknown
>Server : server.Server
>Server : default.Server
startTime: Date;
>startTime : Date
@@ -1,11 +1,11 @@
tests/cases/compiler/extBaseClass2.ts(2,29): error TS2305: Module 'M' has no exported member 'B'.
tests/cases/compiler/extBaseClass2.ts(2,31): error TS2305: Module 'M' has no exported member 'B'.
tests/cases/compiler/extBaseClass2.ts(7,29): error TS2304: Cannot find name 'B'.
==== tests/cases/compiler/extBaseClass2.ts (2 errors) ====
module N {
export class C4 extends M.B {
~~~
~
!!! error TS2305: Module 'M' has no exported member 'B'.
}
}
@@ -1,4 +1,4 @@
tests/cases/compiler/genericFunduleInModule.ts(8,8): error TS2305: Module 'A' has no exported member 'B'.
tests/cases/compiler/genericFunduleInModule.ts(8,10): error TS2305: Module 'A' has no exported member 'B'.
==== tests/cases/compiler/genericFunduleInModule.ts (1 errors) ====
@@ -10,6 +10,6 @@ tests/cases/compiler/genericFunduleInModule.ts(8,8): error TS2305: Module 'A' ha
}
var b: A.B;
~~~
~
!!! error TS2305: Module 'A' has no exported member 'B'.
A.B(1);
@@ -1,4 +1,4 @@
tests/cases/compiler/genericFunduleInModule2.ts(11,8): error TS2305: Module 'A' has no exported member 'B'.
tests/cases/compiler/genericFunduleInModule2.ts(11,10): error TS2305: Module 'A' has no exported member 'B'.
==== tests/cases/compiler/genericFunduleInModule2.ts (1 errors) ====
@@ -13,6 +13,6 @@ tests/cases/compiler/genericFunduleInModule2.ts(11,8): error TS2305: Module 'A'
}
var b: A.B;
~~~
~
!!! error TS2305: Module 'A' has no exported member 'B'.
A.B(1);
@@ -8,7 +8,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,23): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,27): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(16,25): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(22,26): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(22,28): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(23,28): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(25,30): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(26,30): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
@@ -57,7 +57,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
}
declare class D2 extends M.C { }
~~~
~
!!! error TS2305: Module 'M' has no exported member 'C'.
declare class D3<T extends M.E> { }
~~~
@@ -15,9 +15,9 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,38): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(20,17): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(23,21): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(29,18): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(29,20): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(30,24): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(31,22): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(31,24): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(33,22): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(34,22): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(36,10): error TS2304: Cannot find name 'C'.
@@ -88,13 +88,13 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
}
class D2 extends M.C { }
~~~
~
!!! error TS2305: Module 'M' has no exported member 'C'.
interface D3<T extends M.E> { }
~~~
!!! error TS2314: Generic type 'E<T>' requires 1 type argument(s).
interface I2 extends M.C { }
~~~
~
!!! error TS2305: Module 'M' has no exported member 'C'.
function h<T extends I>(x: T) { }
@@ -8,7 +8,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,23): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,27): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(16,25): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(22,26): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(22,28): error TS2305: Module 'M' has no exported member 'C'.
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(23,28): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(25,30): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(26,30): error TS2314: Generic type 'E<T>' requires 1 type argument(s).
@@ -57,7 +57,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc
}
declare class D2 extends M.C { }
~~~
~
!!! error TS2305: Module 'M' has no exported member 'C'.
declare class D3<T extends M.E> { }
~~~
@@ -11,12 +11,12 @@ tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(21
declare function _<T>(value: Array<T>): _<T>;
~
!!! error TS2300: Duplicate identifier '_'.
~~~~
~
!!! error TS2304: Cannot find name '_'.
declare function _<T>(value: T): _<T>;
~
!!! error TS2300: Duplicate identifier '_'.
~~~~
~
!!! error TS2304: Cannot find name '_'.
declare module _ {
@@ -1,6 +1,6 @@
EmitSkipped: false
FileName : declSingleFile.js.map
{"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../tests/cases/fourslash/inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : declSingleFile.js
{"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../tests/cases/fourslash/inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAAA;IAGAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : declSingleFile.js
var x = 109;
var foo = "hello world";
var M = (function () {
@@ -1,6 +1,6 @@
EmitSkipped: false
FileName : tests/cases/fourslash/inputFile.js.map
{"version":3,"file":"inputFile.js","sourceRoot":"","sources":["inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile.js
{"version":3,"file":"inputFile.js","sourceRoot":"","sources":["inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAAA;IAGAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile.js
var x = 109;
var foo = "hello world";
var M = (function () {
@@ -1,6 +1,6 @@
EmitSkipped: false
FileName : sample/outDir/inputFile1.js.map
{"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile1.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : sample/outDir/inputFile1.js
{"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile1.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAAA;IAGAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : sample/outDir/inputFile1.js
var x = 109;
var foo = "hello world";
var M = (function () {
@@ -1,6 +1,6 @@
EmitSkipped: false
FileName : tests/cases/fourslash/inputFile.js.map
{"version":3,"file":"inputFile.js","sourceRoot":"sourceRootDir/","sources":["inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile.js
{"version":3,"file":"inputFile.js","sourceRoot":"sourceRootDir/","sources":["inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAAA;IAGAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile.js
var x = 109;
var foo = "hello world";
var M = (function () {
@@ -1,6 +1,6 @@
EmitSkipped: false
FileName : tests/cases/fourslash/inputFile1.js.map
{"version":3,"file":"inputFile1.js","sourceRoot":"sourceRootDir/","sources":["inputFile1.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile1.js
{"version":3,"file":"inputFile1.js","sourceRoot":"sourceRootDir/","sources":["inputFile1.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAAA;IAGAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile1.js
var x = 109;
var foo = "hello world";
var M = (function () {
@@ -11,7 +11,7 @@ var M = (function () {
//# sourceMappingURL=inputFile1.js.map
EmitSkipped: false
FileName : tests/cases/fourslash/inputFile2.js.map
{"version":3,"file":"inputFile2.js","sourceRoot":"sourceRootDir/","sources":["inputFile2.ts"],"names":["C","C.constructor"],"mappings":"AAAA,IAAI,GAAG,GAAG,wBAAwB,CAAC;AACnC,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile2.js
{"version":3,"file":"inputFile2.js","sourceRoot":"sourceRootDir/","sources":["inputFile2.ts"],"names":["C","C.constructor"],"mappings":"AAAA,IAAI,GAAG,GAAG,wBAAwB,CAAC;AACnC;IAAAA;IAGAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile2.js
var bar = "hello world Typescript";
var C = (function () {
function C() {
@@ -1,4 +1,4 @@
tests/cases/compiler/importAnImport.ts(6,5): error TS2305: Module 'c.a.b' has no exported member 'ma'.
tests/cases/compiler/importAnImport.ts(6,23): error TS2305: Module 'c.a.b' has no exported member 'ma'.
==== tests/cases/compiler/importAnImport.ts (1 errors) ====
@@ -8,6 +8,6 @@ tests/cases/compiler/importAnImport.ts(6,5): error TS2305: Module 'c.a.b' has no
module m0 {
import m8 = c.a.b.ma;
~~~~~~~~~~~~~~~~~~~~~
~~
!!! error TS2305: Module 'c.a.b' has no exported member 'ma'.
}
@@ -1,9 +1,9 @@
tests/cases/compiler/importDeclWithClassModifiers.ts(5,1): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module element.
tests/cases/compiler/importDeclWithClassModifiers.ts(6,1): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithClassModifiers.ts(5,28): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithClassModifiers.ts(6,8): error TS1044: 'private' modifier cannot appear on a module element.
tests/cases/compiler/importDeclWithClassModifiers.ts(7,1): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithClassModifiers.ts(6,29): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithClassModifiers.ts(7,8): error TS1044: 'static' modifier cannot appear on a module element.
tests/cases/compiler/importDeclWithClassModifiers.ts(7,28): error TS2305: Module 'x' has no exported member 'c'.
==== tests/cases/compiler/importDeclWithClassModifiers.ts (6 errors) ====
@@ -12,19 +12,19 @@ tests/cases/compiler/importDeclWithClassModifiers.ts(7,8): error TS1044: 'static
}
}
export public import a = x.c;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2305: Module 'x' has no exported member 'c'.
~~~~~~
!!! error TS1044: 'public' modifier cannot appear on a module element.
export private import b = x.c;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS2305: Module 'x' has no exported member 'c'.
export private import b = x.c;
~~~~~~~
!!! error TS1044: 'private' modifier cannot appear on a module element.
export static import c = x.c;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS2305: Module 'x' has no exported member 'c'.
export static import c = x.c;
~~~~~~
!!! error TS1044: 'static' modifier cannot appear on a module element.
~
!!! error TS2305: Module 'x' has no exported member 'c'.
var b: a;
@@ -1,6 +1,6 @@
tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier.
tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2305: Module 'x' has no exported member 'c'.
==== tests/cases/compiler/importDeclWithDeclareModifier.ts (3 errors) ====
@@ -11,9 +11,9 @@ tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'expor
declare export import a = x.c;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2305: Module 'x' has no exported member 'c'.
~~~~~~
!!! error TS1029: 'export' modifier must precede 'declare' modifier.
~
!!! error TS2305: Module 'x' has no exported member 'c'.
var b: a;
@@ -1,4 +1,4 @@
tests/cases/compiler/importDeclWithExportModifier.ts(5,1): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithExportModifier.ts(5,21): error TS2305: Module 'x' has no exported member 'c'.
==== tests/cases/compiler/importDeclWithExportModifier.ts (1 errors) ====
@@ -7,7 +7,7 @@ tests/cases/compiler/importDeclWithExportModifier.ts(5,1): error TS2305: Module
}
}
export import a = x.c;
~~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS2305: Module 'x' has no exported member 'c'.
var b: a;
@@ -1,4 +1,4 @@
tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,1): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,21): error TS2305: Module 'x' has no exported member 'c'.
tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
@@ -8,7 +8,7 @@ tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(6,1): er
}
}
export import a = x.c;
~~~~~~~~~~~~~~~~~~~~~~
~
!!! error TS2305: Module 'x' has no exported member 'c'.
export = x;
~~~~~~~~~~~
@@ -17,6 +17,6 @@ tests/cases/compiler/importedModuleAddToGlobal.ts(15,23): error TS2304: Cannot f
module C {
import a = A;
function hello(): b.B { return null; }
~~~
~
!!! error TS2304: Cannot find name 'b'.
}
@@ -1,4 +1,4 @@
tests/cases/compiler/innerAliases.ts(19,8): error TS2305: Module 'D' has no exported member 'inner'.
tests/cases/compiler/innerAliases.ts(19,10): error TS2305: Module 'D' has no exported member 'inner'.
tests/cases/compiler/innerAliases.ts(21,11): error TS2339: Property 'inner' does not exist on type 'typeof D'.
@@ -22,7 +22,7 @@ tests/cases/compiler/innerAliases.ts(21,11): error TS2339: Property 'inner' does
}
var c: D.inner.Class1;
~~~~~~~~~~~~~~
~~~~~
!!! error TS2305: Module 'D' has no exported member 'inner'.
c = new D.inner.Class1();
@@ -8,7 +8,7 @@ tests/cases/compiler/instantiateTypeParameter.ts(3,1): error TS1128: Declaration
var x: T<>;
~~~
!!! error TS1131: Property or signature expected.
~~~
~
!!! error TS2304: Cannot find name 'T'.
}
~
@@ -1,4 +1,4 @@
tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts(11,8): error TS2305: Module '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'.
tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts(11,10): error TS2305: Module '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'.
==== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts (1 errors) ====
@@ -13,5 +13,5 @@ tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessE
}
var x: c.b;
~~~
~
!!! error TS2305: Module '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'.
@@ -1,4 +1,4 @@
tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(16,15): error TS2305: Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'.
tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(16,17): error TS2305: Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'.
==== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts (1 errors) ====
@@ -18,5 +18,5 @@ tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExp
export var z: c.b.I;
~~~~~
~
!!! error TS2305: Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'.
@@ -1,7 +1,7 @@
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(5,1): error TS2304: Cannot find name 'V'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,1): error TS2304: Cannot find name 'C'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(17,1): error TS2304: Cannot find name 'E'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,1): error TS2304: Cannot find name 'I'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(5,12): error TS2304: Cannot find name 'V'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,12): error TS2304: Cannot find name 'C'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(17,12): error TS2304: Cannot find name 'E'.
tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,12): error TS2304: Cannot find name 'I'.
==== tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts (4 errors) ====
@@ -10,7 +10,7 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde
var V = 12;
import v = V;
~~~~~~~~~~~~~
~
!!! error TS2304: Cannot find name 'V'.
class C {
@@ -18,7 +18,7 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde
}
import c = C;
~~~~~~~~~~~~~
~
!!! error TS2304: Cannot find name 'C'.
enum E {
@@ -26,7 +26,7 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde
}
import e = E;
~~~~~~~~~~~~~
~
!!! error TS2304: Cannot find name 'E'.
interface I {
@@ -34,6 +34,6 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde
}
import i = I;
~~~~~~~~~~~~~
~
!!! error TS2304: Cannot find name 'I'.
@@ -20,7 +20,7 @@ tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedMo
var m = M2;
var p: m.Point; // Error
~~~~~~~
~
!!! error TS2304: Cannot find name 'm'.
@@ -1,4 +1,4 @@
tests/cases/compiler/moduleClassArrayCodeGenTest.ts(10,9): error TS2305: Module 'M' has no exported member 'B'.
tests/cases/compiler/moduleClassArrayCodeGenTest.ts(10,11): error TS2305: Module 'M' has no exported member 'B'.
==== tests/cases/compiler/moduleClassArrayCodeGenTest.ts (1 errors) ====
@@ -12,5 +12,5 @@ tests/cases/compiler/moduleClassArrayCodeGenTest.ts(10,9): error TS2305: Module
var t: M.A[] = [];
var t2: M.B[] = [];
~~~
~
!!! error TS2305: Module 'M' has no exported member 'B'.
@@ -1,11 +1,14 @@
tests/cases/compiler/moduleImport.ts(2,2): error TS2305: Module 'X' has no exported member 'Y'.
tests/cases/compiler/moduleImport.ts(2,17): error TS2305: Module 'X' has no exported member 'Y'.
tests/cases/compiler/moduleImport.ts(2,17): error TS2339: Property 'Y' does not exist on type 'typeof X'.
==== tests/cases/compiler/moduleImport.ts (1 errors) ====
==== tests/cases/compiler/moduleImport.ts (2 errors) ====
module A.B.C {
import XYZ = X.Y.Z;
~~~~~~~~~~~~~~~~~~~
~
!!! error TS2305: Module 'X' has no exported member 'Y'.
~
!!! error TS2339: Property 'Y' does not exist on type 'typeof X'.
export function ping(x: number) {
if (x>0) XYZ.pong (x-1);
}
@@ -1,4 +1,4 @@
tests/cases/compiler/moduleNewExportBug.ts(10,9): error TS2305: Module 'mod1' has no exported member 'C'.
tests/cases/compiler/moduleNewExportBug.ts(10,14): error TS2305: Module 'mod1' has no exported member 'C'.
==== tests/cases/compiler/moduleNewExportBug.ts (1 errors) ====
@@ -12,7 +12,7 @@ tests/cases/compiler/moduleNewExportBug.ts(10,9): error TS2305: Module 'mod1' ha
}
var c : mod1.C; // ERROR: C should not be visible
~~~~~~
~
!!! error TS2305: Module 'mod1' has no exported member 'C'.
@@ -1,7 +1,7 @@
tests/cases/compiler/moduleVisibilityTest2.ts(57,17): error TS2304: Cannot find name 'x'.
tests/cases/compiler/moduleVisibilityTest2.ts(58,21): error TS2339: Property 'E' does not exist on type 'typeof M'.
tests/cases/compiler/moduleVisibilityTest2.ts(61,14): error TS2305: Module 'M' has no exported member 'I'.
tests/cases/compiler/moduleVisibilityTest2.ts(61,21): error TS2305: Module 'M' has no exported member 'I'.
tests/cases/compiler/moduleVisibilityTest2.ts(61,16): error TS2305: Module 'M' has no exported member 'I'.
tests/cases/compiler/moduleVisibilityTest2.ts(61,23): error TS2305: Module 'M' has no exported member 'I'.
tests/cases/compiler/moduleVisibilityTest2.ts(64,11): error TS2339: Property 'x' does not exist on type 'typeof M'.
tests/cases/compiler/moduleVisibilityTest2.ts(65,15): error TS2339: Property 'E' does not exist on type 'typeof M'.
@@ -72,9 +72,9 @@ tests/cases/compiler/moduleVisibilityTest2.ts(65,15): error TS2339: Property 'E'
}
var cprime : M.I = <M.I>null;
~~~
~
!!! error TS2305: Module 'M' has no exported member 'I'.
~~~
~
!!! error TS2305: Module 'M' has no exported member 'I'.
var c = new M.C();
@@ -1,6 +1,6 @@
tests/cases/compiler/moduleVisibilityTest3.ts(20,22): error TS2304: Cannot find name 'modes'.
tests/cases/compiler/moduleVisibilityTest3.ts(20,33): error TS2305: Module '_modes' has no exported member 'Mode'.
tests/cases/compiler/moduleVisibilityTest3.ts(21,16): error TS2305: Module '_modes' has no exported member 'Mode'.
tests/cases/compiler/moduleVisibilityTest3.ts(20,39): error TS2305: Module '_modes' has no exported member 'Mode'.
tests/cases/compiler/moduleVisibilityTest3.ts(21,22): error TS2305: Module '_modes' has no exported member 'Mode'.
==== tests/cases/compiler/moduleVisibilityTest3.ts (3 errors) ====
@@ -26,10 +26,10 @@ tests/cases/compiler/moduleVisibilityTest3.ts(21,16): error TS2305: Module '_mod
constructor(p1: modes, p2: modes.Mode) {// should be an error on p2 - it's not exported
~~~~~
!!! error TS2304: Cannot find name 'modes'.
~~~~~~~~~~
~~~~
!!! error TS2305: Module '_modes' has no exported member 'Mode'.
var x:modes.Mode;
~~~~~~~~~~
~~~~
!!! error TS2305: Module '_modes' has no exported member 'Mode'.
}
@@ -1,5 +1,5 @@
tests/cases/compiler/multipleExportAssignments.ts(13,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/compiler/multipleExportAssignments.ts(14,1): error TS2308: A module cannot have more than one export assignment.
tests/cases/compiler/multipleExportAssignments.ts(13,1): error TS2300: Duplicate identifier 'default'.
tests/cases/compiler/multipleExportAssignments.ts(14,1): error TS2300: Duplicate identifier 'default'.
==== tests/cases/compiler/multipleExportAssignments.ts (2 errors) ====
@@ -17,9 +17,9 @@ tests/cases/compiler/multipleExportAssignments.ts(14,1): error TS2308: A module
};
export = server;
~~~~~~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
export = connectExport;
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
@@ -1,5 +1,5 @@
tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(4,5): error TS2308: A module cannot have more than one export assignment.
tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(5,5): error TS2308: A module cannot have more than one export assignment.
tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(4,5): error TS2300: Duplicate identifier 'default'.
tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(5,5): error TS2300: Duplicate identifier 'default'.
==== tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts (2 errors) ====
@@ -8,8 +8,8 @@ tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(5,5): erro
var b: number;
export = a;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
export = b;
~~~~~~~~~~~
!!! error TS2308: A module cannot have more than one export assignment.
!!! error TS2300: Duplicate identifier 'default'.
}
+1 -1
View File
@@ -1,2 +1,2 @@
//// [out-flag.js.map]
{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAAA,eAAe;AAGf,AADA,oBAAoB;IACd,OAAO;IAAbA,SAAMA,OAAOA;IAYbC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;QAEzBG,EAAEA;IACNA,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"}
{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAAA,eAAe;AAGf,AADA,oBAAoB;;IACpBA;IAYAC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;QAEzBG,EAAEA;IACNA,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"}
@@ -33,31 +33,18 @@ sourceFile:out-flag.ts
3 >Emitted(2, 21) Source(3, 21) + SourceIndex(0)
---
>>>var MyClass = (function () {
1->^^^^
2 > ^^^^^^^
3 > ^^^^^^^^^^^^^^->
1->
>class
2 > MyClass
1->Emitted(3, 5) Source(4, 7) + SourceIndex(0)
2 >Emitted(3, 12) Source(4, 14) + SourceIndex(0)
---
>>> function MyClass() {
1->^^^^
2 > ^^^^^^^^^
3 > ^^^^^^^
1->
2 > class
3 > MyClass
2 > ^^->
1->
>
1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (MyClass)
2 >Emitted(4, 14) Source(4, 7) + SourceIndex(0) name (MyClass)
3 >Emitted(4, 21) Source(4, 14) + SourceIndex(0) name (MyClass)
---
>>> }
1 >^^^^
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^->
1 >
1->class MyClass
>{
> // my function comments
> public Count(): number
@@ -71,7 +58,7 @@ sourceFile:out-flag.ts
> }
>
2 > }
1 >Emitted(5, 5) Source(16, 1) + SourceIndex(0) name (MyClass.constructor)
1->Emitted(5, 5) Source(16, 1) + SourceIndex(0) name (MyClass.constructor)
2 >Emitted(5, 6) Source(16, 2) + SourceIndex(0) name (MyClass.constructor)
---
>>> // my function comments
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts(1,1): error TS2304: Cannot find name 'module'.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts(1,15): error TS2304: Cannot find name 'module'.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts(1,21): error TS1005: ';' expected.
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts (2 errors) ====
import rect = module("rect"); var bar = new rect.Rect();
~~~~~~~~~~~~~~~~~~~~
~~~~~~
!!! error TS2304: Cannot find name 'module'.
~
!!! error TS1005: ';' expected.
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts(1,1): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts(1,10): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts (2 errors) ====
export = foo
~~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~~~~~~~
~~~
!!! error TS2304: Cannot find name 'foo'.
@@ -1,10 +1,10 @@
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts(1,1): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts(1,10): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts (2 errors) ====
export = foo;
~~~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~~~~~~~~
~~~
!!! error TS2304: Cannot find name 'foo'.
Loaded 100 of 1411 files, more files were not shown because too many files have changed in this diff. Show more