mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into JSLS
Conflicts: src/services/services.ts
This commit is contained in:
+60
-183
@@ -5,6 +5,12 @@ module ts {
|
||||
let nextNodeId = 1;
|
||||
let nextMergeId = 1;
|
||||
|
||||
// @internal
|
||||
export function getNodeId(node: Node): number {
|
||||
if (!node.id) node.id = nextNodeId++;
|
||||
return node.id;
|
||||
}
|
||||
|
||||
/* @internal */ export let checkTime = 0;
|
||||
|
||||
/* @internal */
|
||||
@@ -264,8 +270,8 @@ module ts {
|
||||
}
|
||||
|
||||
function getNodeLinks(node: Node): NodeLinks {
|
||||
if (!node.id) node.id = nextNodeId++;
|
||||
return nodeLinks[node.id] || (nodeLinks[node.id] = {});
|
||||
let nodeId = getNodeId(node);
|
||||
return nodeLinks[nodeId] || (nodeLinks[nodeId] = {});
|
||||
}
|
||||
|
||||
function getSourceFile(node: Node): SourceFile {
|
||||
@@ -7248,7 +7254,6 @@ module ts {
|
||||
case SyntaxKind.ElementAccessExpression: {
|
||||
let index = (<ElementAccessExpression>n).argumentExpression;
|
||||
let symbol = findSymbol((<ElementAccessExpression>n).expression);
|
||||
|
||||
if (symbol && index && index.kind === SyntaxKind.StringLiteral) {
|
||||
let name = (<LiteralExpression>index).text;
|
||||
let prop = getPropertyOfType(getTypeOfSymbol(symbol), name);
|
||||
@@ -7263,14 +7268,37 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function isImportedNameFromExternalModule(n: Node): boolean {
|
||||
switch (n.kind) {
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
case SyntaxKind.PropertyAccessExpression: {
|
||||
// all bindings for external module should be immutable
|
||||
// so attempt to use a.b or a[b] as lhs will always fail
|
||||
// no matter what b is
|
||||
let symbol = findSymbol((<PropertyAccessExpression | ElementAccessExpression>n).expression);
|
||||
return symbol && symbol.flags & SymbolFlags.Alias && isExternalModuleSymbol(resolveAlias(symbol));
|
||||
}
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return isImportedNameFromExternalModule((<ParenthesizedExpression>n).expression);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isReferenceOrErrorExpression(n)) {
|
||||
error(n, invalidReferenceMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isConstVariableReference(n)) {
|
||||
error(n, constantVariableMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isImportedNameFromExternalModule(n)) {
|
||||
error(n, invalidReferenceMessage);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -10556,7 +10584,7 @@ module ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
function getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[] {
|
||||
function getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[] {
|
||||
let symbols: SymbolTable = {};
|
||||
let memberFlags: NodeFlags = 0;
|
||||
|
||||
@@ -10572,85 +10600,58 @@ module ts {
|
||||
function populateSymbols() {
|
||||
while (location) {
|
||||
if (location.locals && !isGlobalSourceFile(location)) {
|
||||
if (copySymbols(location.locals, meaning)) {
|
||||
return;
|
||||
}
|
||||
copySymbols(location.locals, meaning);
|
||||
}
|
||||
|
||||
switch (location.kind) {
|
||||
case SyntaxKind.SourceFile:
|
||||
if (!isExternalModule(<SourceFile>location)) {
|
||||
break;
|
||||
}
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
if (copySymbols(getSymbolOfNode(location).exports, meaning & SymbolFlags.ModuleMember)) {
|
||||
return;
|
||||
}
|
||||
copySymbols(getSymbolOfNode(location).exports, meaning & SymbolFlags.ModuleMember);
|
||||
break;
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
if (copySymbols(getSymbolOfNode(location).exports, meaning & SymbolFlags.EnumMember)) {
|
||||
return;
|
||||
}
|
||||
copySymbols(getSymbolOfNode(location).exports, meaning & SymbolFlags.EnumMember);
|
||||
break;
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
if (!(memberFlags & NodeFlags.Static)) {
|
||||
if (copySymbols(getSymbolOfNode(location).members, meaning & SymbolFlags.Type)) {
|
||||
return;
|
||||
}
|
||||
copySymbols(getSymbolOfNode(location).members, meaning & SymbolFlags.Type);
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.FunctionExpression:
|
||||
if ((<FunctionExpression>location).name) {
|
||||
if (copySymbol(location.symbol, meaning)) {
|
||||
return;
|
||||
}
|
||||
copySymbol(location.symbol, meaning);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
memberFlags = location.flags;
|
||||
location = location.parent;
|
||||
}
|
||||
if (copySymbols(globals, meaning)) {
|
||||
return;
|
||||
}
|
||||
|
||||
copySymbols(globals, meaning);
|
||||
}
|
||||
|
||||
// Returns 'true' if we should stop processing symbols.
|
||||
function copySymbol(symbol: Symbol, meaning: SymbolFlags): boolean {
|
||||
function copySymbol(symbol: Symbol, meaning: SymbolFlags): void {
|
||||
if (symbol.flags & meaning) {
|
||||
let id = symbol.name;
|
||||
if (!isReservedMemberName(id) && !hasProperty(symbols, id)) {
|
||||
if (predicate) {
|
||||
// If we were supplied a predicate function, then check if this symbol
|
||||
// matches with it. If so, we're done and can immediately return.
|
||||
// Otherwise, just ignore this symbol and keep going.
|
||||
if (predicate(symbol)) {
|
||||
symbols[id] = symbol;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If no predicate was supplied, then just add the symbol as is.
|
||||
symbols[id] = symbol;
|
||||
}
|
||||
symbols[id] = symbol;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function copySymbols(source: SymbolTable, meaning: SymbolFlags): boolean {
|
||||
function copySymbols(source: SymbolTable, meaning: SymbolFlags): void {
|
||||
if (meaning) {
|
||||
for (let id in source) {
|
||||
if (hasProperty(source, id)) {
|
||||
if (copySymbol(source[id], meaning)) {
|
||||
return true;
|
||||
}
|
||||
copySymbol(source[id], meaning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11003,134 +11004,7 @@ module ts {
|
||||
return symbol.flags & SymbolFlags.ValueModule && symbol.declarations.length === 1 && symbol.declarations[0].kind === SyntaxKind.SourceFile;
|
||||
}
|
||||
|
||||
function isNodeDescendentOf(node: Node, ancestor: Node): boolean {
|
||||
while (node) {
|
||||
if (node === ancestor) return true;
|
||||
node = node.parent;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isUniqueLocalName(name: string, container: Node): boolean {
|
||||
for (let node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
|
||||
if (node.locals && hasProperty(node.locals, name)) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function getGeneratedNamesForSourceFile(sourceFile: SourceFile): Map<string> {
|
||||
let links = getNodeLinks(sourceFile);
|
||||
let generatedNames = links.generatedNames;
|
||||
if (!generatedNames) {
|
||||
generatedNames = links.generatedNames = {};
|
||||
generateNames(sourceFile);
|
||||
}
|
||||
return generatedNames;
|
||||
|
||||
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);
|
||||
break;
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
generateNameForModuleOrEnum(<EnumDeclaration>node);
|
||||
break;
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
generateNameForImportDeclaration(<ImportDeclaration>node);
|
||||
break;
|
||||
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);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function isExistingName(name: string) {
|
||||
return hasProperty(globals, name) || hasProperty(sourceFile.identifiers, name) || hasProperty(generatedNames, name);
|
||||
}
|
||||
|
||||
function makeUniqueName(baseName: string): string {
|
||||
let name = generateUniqueName(baseName, isExistingName);
|
||||
return generatedNames[name] = name;
|
||||
}
|
||||
|
||||
function assignGeneratedName(node: Node, name: string) {
|
||||
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) {
|
||||
let name = node.name.text;
|
||||
// Use module/enum name itself if it is unique, otherwise make a unique variation
|
||||
assignGeneratedName(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name));
|
||||
}
|
||||
}
|
||||
|
||||
function generateNameForImportOrExportDeclaration(node: ImportDeclaration | ExportDeclaration) {
|
||||
let expr = getExternalModuleName(node);
|
||||
let baseName = expr.kind === SyntaxKind.StringLiteral ?
|
||||
escapeIdentifier(makeIdentifierFromModuleName((<LiteralExpression>expr).text)) : "module";
|
||||
assignGeneratedName(node, makeUniqueName(baseName));
|
||||
}
|
||||
|
||||
function generateNameForImportDeclaration(node: ImportDeclaration) {
|
||||
if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === SyntaxKind.NamedImports) {
|
||||
generateNameForImportOrExportDeclaration(node);
|
||||
}
|
||||
}
|
||||
|
||||
function generateNameForExportDeclaration(node: ExportDeclaration) {
|
||||
if (node.moduleSpecifier) {
|
||||
generateNameForImportOrExportDeclaration(node);
|
||||
}
|
||||
}
|
||||
|
||||
function generateNameForExportAssignment(node: ExportAssignment) {
|
||||
if (node.expression && node.expression.kind !== SyntaxKind.Identifier) {
|
||||
assignGeneratedName(node, makeUniqueName("default"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getGeneratedNameForNode(node: Node) {
|
||||
let links = getNodeLinks(node);
|
||||
if (!links.generatedName) {
|
||||
getGeneratedNamesForSourceFile(getSourceFile(node));
|
||||
}
|
||||
return links.generatedName;
|
||||
}
|
||||
|
||||
function getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string {
|
||||
return getGeneratedNameForNode(container);
|
||||
}
|
||||
|
||||
function getLocalNameForImportDeclaration(node: ImportDeclaration): string {
|
||||
return getGeneratedNameForNode(node);
|
||||
}
|
||||
|
||||
function getAliasNameSubstitution(symbol: Symbol): string {
|
||||
function getAliasNameSubstitution(symbol: Symbol, getGeneratedNameForNode: (Node: Node) => string): string {
|
||||
let declaration = getDeclarationOfAliasSymbol(symbol);
|
||||
if (declaration && declaration.kind === SyntaxKind.ImportSpecifier) {
|
||||
let moduleName = getGeneratedNameForNode(<ImportDeclaration>declaration.parent.parent.parent);
|
||||
@@ -11139,7 +11013,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function getExportNameSubstitution(symbol: Symbol, location: Node): string {
|
||||
function getExportNameSubstitution(symbol: Symbol, location: Node, getGeneratedNameForNode: (Node: Node) => string): string {
|
||||
if (isExternalModuleSymbol(symbol.parent)) {
|
||||
var symbolName = unescapeIdentifier(symbol.name);
|
||||
// If this is es6 or higher, just use the name of the export
|
||||
@@ -11161,24 +11035,24 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function getExpressionNameSubstitution(node: Identifier): string {
|
||||
function getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (Node: Node) => string): string {
|
||||
let symbol = getNodeLinks(node).resolvedSymbol;
|
||||
if (symbol) {
|
||||
// Whan an identifier resolves to a parented symbol, it references an exported entity from
|
||||
// another declaration of the same internal module.
|
||||
if (symbol.parent) {
|
||||
return getExportNameSubstitution(symbol, node.parent);
|
||||
return getExportNameSubstitution(symbol, node.parent, getGeneratedNameForNode);
|
||||
}
|
||||
// If we reference an exported entity within the same module declaration, then whether
|
||||
// we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the
|
||||
// kinds that we do NOT prefix.
|
||||
let exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
||||
if (symbol !== exportSymbol && !(exportSymbol.flags & SymbolFlags.ExportHasLocal)) {
|
||||
return getExportNameSubstitution(exportSymbol, node.parent);
|
||||
return getExportNameSubstitution(exportSymbol, node.parent, getGeneratedNameForNode);
|
||||
}
|
||||
// Named imports from ES6 import declarations are rewritten
|
||||
if (symbol.flags & SymbolFlags.Alias && languageVersion < ScriptTarget.ES6) {
|
||||
return getAliasNameSubstitution(symbol);
|
||||
return getAliasNameSubstitution(symbol, getGeneratedNameForNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11281,10 +11155,13 @@ module ts {
|
||||
getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags);
|
||||
}
|
||||
|
||||
function isUnknownIdentifier(location: Node, name: string): boolean {
|
||||
Debug.assert(!nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location");
|
||||
return !resolveName(location, name, SymbolFlags.Value, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined) &&
|
||||
!hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name);
|
||||
function hasGlobalName(name: string): boolean {
|
||||
return hasProperty(globals, name);
|
||||
}
|
||||
|
||||
function resolvesToSomeValue(location: Node, name: string): boolean {
|
||||
Debug.assert(!nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location");
|
||||
return !!resolveName(location, name, SymbolFlags.Value, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
|
||||
}
|
||||
|
||||
function getBlockScopedVariableId(n: Identifier): number {
|
||||
@@ -11314,8 +11191,8 @@ module ts {
|
||||
|
||||
function createResolver(): EmitResolver {
|
||||
return {
|
||||
getGeneratedNameForNode,
|
||||
getExpressionNameSubstitution,
|
||||
hasGlobalName,
|
||||
hasExportDefaultValue,
|
||||
isReferencedAliasDeclaration,
|
||||
getNodeCheckFlags,
|
||||
@@ -11328,7 +11205,7 @@ module ts {
|
||||
isSymbolAccessible,
|
||||
isEntityNameVisible,
|
||||
getConstantValue,
|
||||
isUnknownIdentifier,
|
||||
resolvesToSomeValue,
|
||||
collectLinkedAliases,
|
||||
getBlockScopedVariableId,
|
||||
};
|
||||
|
||||
+269
-132
@@ -19,6 +19,14 @@ module ts {
|
||||
return isExternalModule(sourceFile) || isDeclarationFile(sourceFile);
|
||||
}
|
||||
|
||||
// flag enum used to request and track usages of few dedicated temp variables
|
||||
// enum values are used to set/check bit values and thus should not have bit collisions.
|
||||
const enum TempVariableKind {
|
||||
auto = 0,
|
||||
_i = 1,
|
||||
_n = 2,
|
||||
}
|
||||
|
||||
// @internal
|
||||
// targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature
|
||||
export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult {
|
||||
@@ -60,6 +68,26 @@ module ts {
|
||||
sourceMaps: sourceMapDataList
|
||||
};
|
||||
|
||||
function isNodeDescendentOf(node: Node, ancestor: Node): boolean {
|
||||
while (node) {
|
||||
if (node === ancestor) return true;
|
||||
node = node.parent;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isUniqueLocalName(name: string, container: Node): boolean {
|
||||
for (let node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
|
||||
if (node.locals && hasProperty(node.locals, name)) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function emitJavaScript(jsFilePath: string, root?: SourceFile) {
|
||||
let writer = createTextWriter(newLine);
|
||||
let write = writer.write;
|
||||
@@ -71,15 +99,17 @@ module ts {
|
||||
|
||||
let currentSourceFile: SourceFile;
|
||||
|
||||
let lastFrame: ScopeFrame;
|
||||
let currentScopeNames: Map<string>;
|
||||
|
||||
let generatedBlockScopeNames: string[];
|
||||
let generatedNameSet: Map<string>;
|
||||
let nodeToGeneratedName: string[];
|
||||
let blockScopedVariableToGeneratedName: string[];
|
||||
|
||||
let extendsEmitted = false;
|
||||
|
||||
let tempCount = 0;
|
||||
let tempVariables: Identifier[];
|
||||
let tempParameters: Identifier[];
|
||||
let predefinedTempsInUse = TempVariableKind.auto;
|
||||
|
||||
let externalImports: ExternalImportInfo[];
|
||||
let exportSpecifiers: Map<ExportSpecifier[]>;
|
||||
let exportDefault: FunctionDeclaration | ClassDeclaration | ExportAssignment | ExportSpecifier;
|
||||
@@ -144,81 +174,197 @@ module ts {
|
||||
emit(sourceFile);
|
||||
}
|
||||
|
||||
// enters the new lexical environment
|
||||
// return value should be passed to matching call to exitNameScope.
|
||||
function enterNameScope(): boolean {
|
||||
let names = currentScopeNames;
|
||||
currentScopeNames = undefined;
|
||||
if (names) {
|
||||
lastFrame = { names, previous: lastFrame };
|
||||
return true;
|
||||
function generateNameForNode(node: Node) {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
generateNameForFunctionOrClassDeclaration(<Declaration>node);
|
||||
break;
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
generateNameForModuleOrEnum(<ModuleDeclaration>node);
|
||||
generateNameForNode((<ModuleDeclaration>node).body);
|
||||
break;
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
generateNameForModuleOrEnum(<EnumDeclaration>node);
|
||||
break;
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
generateNameForImportDeclaration(<ImportDeclaration>node);
|
||||
break;
|
||||
case SyntaxKind.ExportDeclaration:
|
||||
generateNameForExportDeclaration(<ExportDeclaration>node);
|
||||
break;
|
||||
case SyntaxKind.ExportAssignment:
|
||||
generateNameForExportAssignment(<ExportAssignment>node);
|
||||
break;
|
||||
case SyntaxKind.SourceFile:
|
||||
case SyntaxKind.ModuleBlock:
|
||||
forEach((<SourceFile | ModuleBlock>node).statements, generateNameForNode);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function exitNameScope(popFrame: boolean): void {
|
||||
if (popFrame) {
|
||||
currentScopeNames = lastFrame.names;
|
||||
lastFrame = lastFrame.previous;
|
||||
function isUniqueName(name: string): boolean {
|
||||
return !resolver.hasGlobalName(name) &&
|
||||
!hasProperty(currentSourceFile.identifiers, name) &&
|
||||
(!generatedNameSet || !hasProperty(generatedNameSet, name))
|
||||
}
|
||||
|
||||
// in cases like
|
||||
// for (var x of []) {
|
||||
// _i;
|
||||
// }
|
||||
// we should be able to detect if let _i was shadowed by some temp variable that was allocated in scope
|
||||
function nameConflictsWithSomeTempVariable(name: string): boolean {
|
||||
// temp variable names always start with '_'
|
||||
if (name.length < 2 || name.charCodeAt(0) !== CharacterCodes._) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (name === "_i") {
|
||||
return !!(predefinedTempsInUse & TempVariableKind._i);
|
||||
}
|
||||
|
||||
if (name === "_n") {
|
||||
return !!(predefinedTempsInUse & TempVariableKind._n);
|
||||
}
|
||||
|
||||
if (name.length === 2 && name.charCodeAt(1) >= CharacterCodes.a && name.charCodeAt(1) <= CharacterCodes.z) {
|
||||
// handles _a .. _z
|
||||
let n = name.charCodeAt(1) - CharacterCodes.a;
|
||||
return n < tempCount;
|
||||
}
|
||||
else {
|
||||
currentScopeNames = undefined;
|
||||
// handles _1, _2...
|
||||
let n = +name.substring(1);
|
||||
return !isNaN(n) && n >= 0 && n < (tempCount - 26);
|
||||
}
|
||||
}
|
||||
|
||||
function generateUniqueNameForLocation(location: Node, baseName: string): string {
|
||||
let name: string
|
||||
// first try to check if base name can be used as is
|
||||
if (!isExistingName(location, baseName)) {
|
||||
name = baseName;
|
||||
}
|
||||
else {
|
||||
name = generateUniqueName(baseName, n => isExistingName(location, n));
|
||||
}
|
||||
|
||||
return recordNameInCurrentScope(name);
|
||||
}
|
||||
|
||||
function recordNameInCurrentScope(name: string): string {
|
||||
if (!currentScopeNames) {
|
||||
currentScopeNames = {};
|
||||
}
|
||||
|
||||
return currentScopeNames[name] = name;
|
||||
}
|
||||
|
||||
function isExistingName(location: Node, name: string) {
|
||||
// check if resolver is aware of this name (if name was seen during the typecheck)
|
||||
if (!resolver.isUnknownIdentifier(location, name)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// check if name is present in generated names that were introduced by the emitter
|
||||
if (currentScopeNames && hasProperty(currentScopeNames, name)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// check generated names in outer scopes
|
||||
// let x;
|
||||
// function foo() {
|
||||
// let x; // 1
|
||||
// function bar() {
|
||||
// {
|
||||
// let x; // 2
|
||||
// }
|
||||
// console.log(x); // 3
|
||||
// }
|
||||
//}
|
||||
// here both x(1) and x(2) should be renamed and their names should be different
|
||||
// so x in (3) will refer to x(1)
|
||||
let frame = lastFrame;
|
||||
while (frame) {
|
||||
if (hasProperty(frame.names, name)) {
|
||||
return true;
|
||||
// This function generates a name using the following pattern:
|
||||
// _a .. _h, _j ... _z, _0, _1, ...
|
||||
// It is guaranteed that generated name will not shadow any existing user-defined names,
|
||||
// however it can hide another name generated by this function higher in the scope.
|
||||
// NOTE: names generated by 'makeTempVariableName' and 'makeUniqueName' will never conflict.
|
||||
// see comment for 'makeTempVariableName' for more information.
|
||||
function makeTempVariableName(location: Node, tempVariableKind: TempVariableKind): string {
|
||||
let tempName: string;
|
||||
if (tempVariableKind !== TempVariableKind.auto && !(predefinedTempsInUse & tempVariableKind)) {
|
||||
tempName = tempVariableKind === TempVariableKind._i ? "_i" : "_n";
|
||||
if (!resolver.resolvesToSomeValue(location, tempName)) {
|
||||
predefinedTempsInUse |= tempVariableKind;
|
||||
return tempName;
|
||||
}
|
||||
frame = frame.previous;
|
||||
}
|
||||
return false;
|
||||
|
||||
do {
|
||||
// Note: we avoid generating _i and _n as those are common names we want in other places.
|
||||
var char = CharacterCodes.a + tempCount;
|
||||
if (char !== CharacterCodes.i && char !== CharacterCodes.n) {
|
||||
if (tempCount < 26) {
|
||||
tempName = "_" + String.fromCharCode(char);
|
||||
}
|
||||
else {
|
||||
tempName = "_" + (tempCount - 26);
|
||||
}
|
||||
}
|
||||
|
||||
tempCount++;
|
||||
}
|
||||
while (resolver.resolvesToSomeValue(location, tempName));
|
||||
|
||||
return tempName;
|
||||
}
|
||||
|
||||
// Generates a name that is unique within current file and does not collide with
|
||||
// any names in global scope.
|
||||
// NOTE: names generated by 'makeTempVariableName' and 'makeUniqueName' will never conflict
|
||||
// because of the way how these names are generated
|
||||
// - makeUniqueName builds a name by picking a base name (which should not be empty string)
|
||||
// and appending suffix '_<number>'
|
||||
// - makeTempVariableName creates a name using the following pattern:
|
||||
// _a .. _h, _j ... _z, _0, _1, ...
|
||||
// This means that names from 'makeTempVariableName' will have only one underscore at the beginning
|
||||
// and names from 'makeUniqieName' will have at least one underscore in the middle
|
||||
// so they will never collide.
|
||||
function makeUniqueName(baseName: string): string {
|
||||
Debug.assert(!!baseName);
|
||||
|
||||
// Find the first unique 'name_n', where n is a positive number
|
||||
if (baseName.charCodeAt(baseName.length - 1) !== CharacterCodes._) {
|
||||
baseName += "_";
|
||||
}
|
||||
|
||||
let i = 1;
|
||||
let generatedName: string;
|
||||
while (true) {
|
||||
generatedName = baseName + i;
|
||||
if (isUniqueName(generatedName)) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!generatedNameSet) {
|
||||
generatedNameSet = {};
|
||||
}
|
||||
return generatedNameSet[generatedName] = generatedName;
|
||||
}
|
||||
|
||||
function renameNode(node: Node, name: string): string {
|
||||
var nodeId = getNodeId(node);
|
||||
|
||||
if (!nodeToGeneratedName) {
|
||||
nodeToGeneratedName = [];
|
||||
}
|
||||
|
||||
return nodeToGeneratedName[nodeId] = unescapeIdentifier(name);
|
||||
}
|
||||
|
||||
function generateNameForFunctionOrClassDeclaration(node: Declaration) {
|
||||
if (!node.name) {
|
||||
renameNode(node, makeUniqueName("default"));
|
||||
}
|
||||
}
|
||||
|
||||
function generateNameForModuleOrEnum(node: ModuleDeclaration | EnumDeclaration) {
|
||||
if (node.name.kind === SyntaxKind.Identifier) {
|
||||
let name = node.name.text;
|
||||
// Use module/enum name itself if it is unique, otherwise make a unique variation
|
||||
renameNode(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name));
|
||||
}
|
||||
}
|
||||
|
||||
function generateNameForImportOrExportDeclaration(node: ImportDeclaration | ExportDeclaration) {
|
||||
let expr = getExternalModuleName(node);
|
||||
let baseName = expr.kind === SyntaxKind.StringLiteral ?
|
||||
escapeIdentifier(makeIdentifierFromModuleName((<LiteralExpression>expr).text)) : "module";
|
||||
renameNode(node, makeUniqueName(baseName));
|
||||
}
|
||||
|
||||
function generateNameForImportDeclaration(node: ImportDeclaration) {
|
||||
if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === SyntaxKind.NamedImports) {
|
||||
generateNameForImportOrExportDeclaration(node);
|
||||
}
|
||||
}
|
||||
|
||||
function generateNameForExportDeclaration(node: ExportDeclaration) {
|
||||
if (node.moduleSpecifier) {
|
||||
generateNameForImportOrExportDeclaration(node);
|
||||
}
|
||||
}
|
||||
|
||||
function generateNameForExportAssignment(node: ExportAssignment) {
|
||||
if (node.expression && node.expression.kind !== SyntaxKind.Identifier) {
|
||||
renameNode(node, makeUniqueName("default"));
|
||||
}
|
||||
}
|
||||
|
||||
function getGeneratedNameForNode(node: Node) {
|
||||
let nodeId = getNodeId(node);
|
||||
if (!nodeToGeneratedName || !nodeToGeneratedName[nodeId]) {
|
||||
generateNameForNode(node);
|
||||
}
|
||||
return nodeToGeneratedName ? nodeToGeneratedName[nodeId] : undefined;
|
||||
}
|
||||
|
||||
function initializeEmitterWithSourceMaps() {
|
||||
@@ -585,32 +731,10 @@ module ts {
|
||||
writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark);
|
||||
}
|
||||
|
||||
// Create a temporary variable with a unique unused name. The forLoopVariable parameter signals that the
|
||||
// name should be one that is appropriate for a for loop variable.
|
||||
function createTempVariable(location: Node, preferredName?: string): Identifier {
|
||||
for (var name = preferredName; !name || isExistingName(location, name); tempCount++) {
|
||||
// _a .. _h, _j ... _z, _0, _1, ...
|
||||
|
||||
// Note: we avoid generating _i and _n as those are common names we want in other places.
|
||||
var char = CharacterCodes.a + tempCount;
|
||||
if (char === CharacterCodes.i || char === CharacterCodes.n) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tempCount < 26) {
|
||||
name = "_" + String.fromCharCode(char);
|
||||
}
|
||||
else {
|
||||
name = "_" + (tempCount - 26);
|
||||
}
|
||||
}
|
||||
|
||||
// This is necessary so that a name generated via renameNonTopLevelLetAndConst will see the name
|
||||
// we just generated.
|
||||
recordNameInCurrentScope(name);
|
||||
|
||||
// Create a temporary variable with a unique unused name.
|
||||
function createTempVariable(location: Node, tempVariableKind = TempVariableKind.auto): Identifier {
|
||||
let result = <Identifier>createSynthesizedNode(SyntaxKind.Identifier);
|
||||
result.text = name;
|
||||
result.text = makeTempVariableName(location, tempVariableKind);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -621,8 +745,8 @@ module ts {
|
||||
tempVariables.push(name);
|
||||
}
|
||||
|
||||
function createAndRecordTempVariable(location: Node, preferredName?: string): Identifier {
|
||||
let temp = createTempVariable(location, preferredName);
|
||||
function createAndRecordTempVariable(location: Node, tempVariableKind?: TempVariableKind): Identifier {
|
||||
let temp = createTempVariable(location, tempVariableKind);
|
||||
recordTempDeclaration(temp);
|
||||
|
||||
return temp;
|
||||
@@ -1085,7 +1209,7 @@ module ts {
|
||||
}
|
||||
|
||||
function emitExpressionIdentifier(node: Identifier) {
|
||||
let substitution = resolver.getExpressionNameSubstitution(node);
|
||||
let substitution = resolver.getExpressionNameSubstitution(node, getGeneratedNameForNode);
|
||||
if (substitution) {
|
||||
write(substitution);
|
||||
}
|
||||
@@ -1095,7 +1219,7 @@ module ts {
|
||||
}
|
||||
|
||||
function getGeneratedNameForIdentifier(node: Identifier): string {
|
||||
if (nodeIsSynthesized(node) || !generatedBlockScopeNames) {
|
||||
if (nodeIsSynthesized(node) || !blockScopedVariableToGeneratedName) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -1104,7 +1228,7 @@ module ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return generatedBlockScopeNames[variableId];
|
||||
return blockScopedVariableToGeneratedName[variableId];
|
||||
}
|
||||
|
||||
function emitIdentifier(node: Identifier, allowGeneratedIdentifiers: boolean) {
|
||||
@@ -1332,7 +1456,7 @@ module ts {
|
||||
// manage by just emitting strings (which is a lot more performant).
|
||||
//let prefix = createIdentifier(resolver.getExpressionNamePrefix((<ShorthandPropertyAssignment>property).name));
|
||||
//return createPropertyAccessExpression(prefix, (<ShorthandPropertyAssignment>property).name);
|
||||
return createIdentifier(resolver.getExpressionNameSubstitution((<ShorthandPropertyAssignment>property).name));
|
||||
return createIdentifier(resolver.getExpressionNameSubstitution((<ShorthandPropertyAssignment>property).name, getGeneratedNameForNode));
|
||||
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
return createFunctionExpression((<MethodDeclaration>property).parameters, (<MethodDeclaration>property).body);
|
||||
@@ -1546,7 +1670,7 @@ module ts {
|
||||
emitExpressionIdentifier(node.name);
|
||||
}
|
||||
}
|
||||
else if (resolver.getExpressionNameSubstitution(node.name)) {
|
||||
else if (resolver.getExpressionNameSubstitution(node.name, getGeneratedNameForNode)) {
|
||||
// Emit identifier as an identifier
|
||||
write(": ");
|
||||
// Even though this is stored as identifier treat it as an expression
|
||||
@@ -2079,10 +2203,10 @@ module ts {
|
||||
//
|
||||
// we don't want to emit a temporary variable for the RHS, just use it directly.
|
||||
let rhsIsIdentifier = node.expression.kind === SyntaxKind.Identifier;
|
||||
let counter = createTempVariable(node, /*preferredName*/ "_i");
|
||||
let counter = createTempVariable(node, TempVariableKind._i);
|
||||
let rhsReference = rhsIsIdentifier ? <Identifier>node.expression : createTempVariable(node);
|
||||
|
||||
var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, /*preferredName:*/ "_n") : undefined;
|
||||
var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, TempVariableKind._n) : undefined;
|
||||
|
||||
// This is the let keyword for the counter and rhsReference. The let keyword for
|
||||
// the LHS will be emitted inside the body.
|
||||
@@ -2323,7 +2447,7 @@ module ts {
|
||||
|
||||
function emitContainingModuleName(node: Node) {
|
||||
let container = getContainingModule(node);
|
||||
write(container ? resolver.getGeneratedNameForNode(container) : "exports");
|
||||
write(container ? getGeneratedNameForNode(container) : "exports");
|
||||
}
|
||||
|
||||
function emitModuleMemberName(node: Declaration) {
|
||||
@@ -2331,7 +2455,7 @@ module ts {
|
||||
if (getCombinedNodeFlags(node) & NodeFlags.Export) {
|
||||
var container = getContainingModule(node);
|
||||
if (container) {
|
||||
write(resolver.getGeneratedNameForNode(container));
|
||||
write(getGeneratedNameForNode(container));
|
||||
write(".");
|
||||
}
|
||||
else if (languageVersion < ScriptTarget.ES6) {
|
||||
@@ -2673,9 +2797,14 @@ module ts {
|
||||
|
||||
// here it is known that node is a block scoped variable
|
||||
let list = getAncestor(node, SyntaxKind.VariableDeclarationList);
|
||||
if (list.parent.kind === SyntaxKind.VariableStatement && list.parent.parent.kind === SyntaxKind.SourceFile) {
|
||||
// do not rename variables that are defined on source file level
|
||||
return;
|
||||
if (list.parent.kind === SyntaxKind.VariableStatement) {
|
||||
let isSourceFileLevelBinding = list.parent.parent.kind === SyntaxKind.SourceFile;
|
||||
let isModuleLevelBinding = list.parent.parent.kind === SyntaxKind.ModuleBlock;
|
||||
let isFunctionLevelBinding =
|
||||
list.parent.parent.kind === SyntaxKind.Block && isFunctionLike(list.parent.parent.parent);
|
||||
if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let blockScopeContainer = getEnclosingBlockScopeContainer(node);
|
||||
@@ -2683,12 +2812,19 @@ module ts {
|
||||
? blockScopeContainer
|
||||
: blockScopeContainer.parent;
|
||||
|
||||
let generatedName = generateUniqueNameForLocation(parent, (<Identifier>node).text);
|
||||
let variableId = resolver.getBlockScopedVariableId(<Identifier>node);
|
||||
if (!generatedBlockScopeNames) {
|
||||
generatedBlockScopeNames = [];
|
||||
var hasConflictsInEnclosingScope =
|
||||
resolver.resolvesToSomeValue(parent, (<Identifier>node).text) ||
|
||||
nameConflictsWithSomeTempVariable((<Identifier>node).text);
|
||||
|
||||
if (hasConflictsInEnclosingScope) {
|
||||
let variableId = resolver.getBlockScopedVariableId(<Identifier>node);
|
||||
if (!blockScopedVariableToGeneratedName) {
|
||||
blockScopedVariableToGeneratedName = [];
|
||||
}
|
||||
|
||||
let generatedName = makeUniqueName((<Identifier>node).text);
|
||||
blockScopedVariableToGeneratedName[variableId] = generatedName;
|
||||
}
|
||||
generatedBlockScopeNames[variableId] = generatedName;
|
||||
}
|
||||
|
||||
function isES6ModuleMemberDeclaration(node: Node) {
|
||||
@@ -2770,7 +2906,7 @@ module ts {
|
||||
if (languageVersion < ScriptTarget.ES6 && hasRestParameters(node)) {
|
||||
let restIndex = node.parameters.length - 1;
|
||||
let restParam = node.parameters[restIndex];
|
||||
let tempName = createTempVariable(node, /*preferredName:*/ "_i").text;
|
||||
let tempName = createTempVariable(node, TempVariableKind._i).text;
|
||||
writeLine();
|
||||
emitLeadingComments(restParam);
|
||||
emitStart(restParam);
|
||||
@@ -2820,7 +2956,7 @@ module ts {
|
||||
emitNodeWithoutSourceMap(node.name);
|
||||
}
|
||||
else {
|
||||
write(resolver.getGeneratedNameForNode(node));
|
||||
write(getGeneratedNameForNode(node));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2906,11 +3042,12 @@ module ts {
|
||||
let saveTempCount = tempCount;
|
||||
let saveTempVariables = tempVariables;
|
||||
let saveTempParameters = tempParameters;
|
||||
let savePredefinedTempsInUse = predefinedTempsInUse;
|
||||
|
||||
tempCount = 0;
|
||||
tempVariables = undefined;
|
||||
tempParameters = undefined;
|
||||
|
||||
let popFrame = enterNameScope()
|
||||
predefinedTempsInUse = TempVariableKind.auto;
|
||||
|
||||
// When targeting ES6, emit arrow function natively in ES6
|
||||
if (shouldEmitAsArrowFunction(node)) {
|
||||
@@ -2943,8 +3080,7 @@ module ts {
|
||||
write(";");
|
||||
}
|
||||
|
||||
exitNameScope(popFrame);
|
||||
|
||||
predefinedTempsInUse = savePredefinedTempsInUse;
|
||||
tempCount = saveTempCount;
|
||||
tempVariables = saveTempVariables;
|
||||
tempParameters = saveTempParameters;
|
||||
@@ -3241,11 +3377,12 @@ module ts {
|
||||
let saveTempCount = tempCount;
|
||||
let saveTempVariables = tempVariables;
|
||||
let saveTempParameters = tempParameters;
|
||||
let savePredefinedTempsInUse = predefinedTempsInUse;
|
||||
tempCount = 0;
|
||||
tempVariables = undefined;
|
||||
tempParameters = undefined;
|
||||
predefinedTempsInUse = TempVariableKind.auto;
|
||||
|
||||
let popFrame = enterNameScope();
|
||||
// Check if we have property assignment inside class declaration.
|
||||
// If there is property assignment, we need to emit constructor whether users define it or not
|
||||
// If there is no property assignment, we can omit constructor if users do not define it
|
||||
@@ -3354,8 +3491,7 @@ module ts {
|
||||
emitTrailingComments(ctor);
|
||||
}
|
||||
|
||||
exitNameScope(popFrame);
|
||||
|
||||
predefinedTempsInUse = savePredefinedTempsInUse;
|
||||
tempCount = saveTempCount;
|
||||
tempVariables = saveTempVariables;
|
||||
tempParameters = saveTempParameters;
|
||||
@@ -3494,7 +3630,7 @@ module ts {
|
||||
emitStart(node);
|
||||
write("(function (");
|
||||
emitStart(node.name);
|
||||
write(resolver.getGeneratedNameForNode(node));
|
||||
write(getGeneratedNameForNode(node));
|
||||
emitEnd(node.name);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
@@ -3531,9 +3667,9 @@ module ts {
|
||||
function emitEnumMember(node: EnumMember) {
|
||||
let enumParent = <EnumDeclaration>node.parent;
|
||||
emitStart(node);
|
||||
write(resolver.getGeneratedNameForNode(enumParent));
|
||||
write(getGeneratedNameForNode(enumParent));
|
||||
write("[");
|
||||
write(resolver.getGeneratedNameForNode(enumParent));
|
||||
write(getGeneratedNameForNode(enumParent));
|
||||
write("[");
|
||||
emitExpressionForPropertyName(node.name);
|
||||
write("] = ");
|
||||
@@ -3586,19 +3722,20 @@ module ts {
|
||||
emitStart(node);
|
||||
write("(function (");
|
||||
emitStart(node.name);
|
||||
write(resolver.getGeneratedNameForNode(node));
|
||||
write(getGeneratedNameForNode(node));
|
||||
emitEnd(node.name);
|
||||
write(") ");
|
||||
if (node.body.kind === SyntaxKind.ModuleBlock) {
|
||||
let saveTempCount = tempCount;
|
||||
let saveTempVariables = tempVariables;
|
||||
let savePredefinedTempsInUse = predefinedTempsInUse;
|
||||
tempCount = 0;
|
||||
tempVariables = undefined;
|
||||
let popFrame = enterNameScope();
|
||||
predefinedTempsInUse = TempVariableKind.auto;
|
||||
|
||||
emit(node.body);
|
||||
|
||||
exitNameScope(popFrame);
|
||||
predefinedTempsInUse = savePredefinedTempsInUse;
|
||||
tempCount = saveTempCount;
|
||||
tempVariables = saveTempVariables;
|
||||
}
|
||||
@@ -3762,7 +3899,7 @@ module ts {
|
||||
}
|
||||
else if (namedImports) {
|
||||
write("var ");
|
||||
write(resolver.getGeneratedNameForNode(<ImportDeclaration>node));
|
||||
write(getGeneratedNameForNode(<ImportDeclaration>node));
|
||||
write(" = ");
|
||||
emitRequire(moduleName);
|
||||
}
|
||||
@@ -3817,7 +3954,7 @@ module ts {
|
||||
if (languageVersion < ScriptTarget.ES6 || node.parent.kind !== SyntaxKind.SourceFile) {
|
||||
if (node.moduleSpecifier) {
|
||||
emitStart(node);
|
||||
let generatedName = resolver.getGeneratedNameForNode(node);
|
||||
let generatedName = getGeneratedNameForNode(node);
|
||||
if (compilerOptions.module !== ModuleKind.AMD) {
|
||||
write("var ");
|
||||
write(generatedName);
|
||||
@@ -3920,7 +4057,7 @@ module ts {
|
||||
return {
|
||||
rootNode: <ImportDeclaration>node,
|
||||
namedImports: <NamedImports>importClause.namedBindings,
|
||||
localName: resolver.getGeneratedNameForNode(<ImportDeclaration>node)
|
||||
localName: getGeneratedNameForNode(<ImportDeclaration>node)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -4025,7 +4162,7 @@ module ts {
|
||||
emit(info.declarationNode.name);
|
||||
}
|
||||
else {
|
||||
write(resolver.getGeneratedNameForNode(<ImportDeclaration | ExportDeclaration>info.rootNode));
|
||||
write(getGeneratedNameForNode(<ImportDeclaration | ExportDeclaration>info.rootNode));
|
||||
}
|
||||
});
|
||||
forEach(node.amdDependencies, amdDependency => {
|
||||
|
||||
@@ -1095,7 +1095,7 @@ module ts {
|
||||
|
||||
// If 'predicate' is supplied, then only the first symbol in scope matching the predicate
|
||||
// will be returned. Otherwise, all symbols in scope will be returned.
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
getShorthandAssignmentValueSymbol(location: Node): Symbol;
|
||||
getTypeAtLocation(node: Node): Type;
|
||||
@@ -1206,8 +1206,8 @@ module ts {
|
||||
}
|
||||
|
||||
export interface EmitResolver {
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
isReferencedAliasDeclaration(node: Node): boolean;
|
||||
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
|
||||
@@ -1222,7 +1222,7 @@ module ts {
|
||||
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
// Returns the constant value this property access resolves to, or 'undefined' for a non-constant
|
||||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
}
|
||||
|
||||
|
||||
@@ -1212,28 +1212,6 @@ module ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
export function generateUniqueName(baseName: string, isExistingName: (name: string) => boolean): string {
|
||||
// First try '_name'
|
||||
if (baseName.charCodeAt(0) !== CharacterCodes._) {
|
||||
baseName = "_" + baseName;
|
||||
if (!isExistingName(baseName)) {
|
||||
return baseName;
|
||||
}
|
||||
}
|
||||
// Find the first unique '_name_n', where n is a positive number
|
||||
if (baseName.charCodeAt(baseName.length - 1) !== CharacterCodes._) {
|
||||
baseName += "_";
|
||||
}
|
||||
let i = 1;
|
||||
while (true) {
|
||||
let name = baseName + i;
|
||||
if (!isExistingName(name)) {
|
||||
return name;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// @internal
|
||||
export function createDiagnosticCollection(): DiagnosticCollection {
|
||||
let nonFileDiagnostics: Diagnostic[] = [];
|
||||
|
||||
+44
-64
@@ -2565,9 +2565,9 @@ module ts {
|
||||
}
|
||||
|
||||
/// Completion
|
||||
function getValidCompletionEntryDisplayNameForSymbol(symbol: Symbol, target: ScriptTarget): string {
|
||||
function getCompletionEntryDisplayNameForSymbol(symbol: Symbol, target: ScriptTarget, performCharacterChecks: boolean): string {
|
||||
let displayName = symbol.getName();
|
||||
if (displayName && displayName.length > 0) {
|
||||
if (displayName) {
|
||||
let firstCharCode = displayName.charCodeAt(0);
|
||||
// First check of the displayName is not external module; if it is an external module, it is not valid entry
|
||||
if ((symbol.flags & SymbolFlags.Namespace) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) {
|
||||
@@ -2575,31 +2575,18 @@ module ts {
|
||||
// (i.e declare module "http" { let x; } | // <= request completion here, "http" should not be there)
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (displayName && displayName.length >= 2 &&
|
||||
firstCharCode === displayName.charCodeAt(displayName.length - 1) &&
|
||||
(firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) {
|
||||
// If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an
|
||||
// invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name.
|
||||
displayName = displayName.substring(1, displayName.length - 1);
|
||||
}
|
||||
|
||||
let isValid = isIdentifierStart(displayName.charCodeAt(0), target);
|
||||
for (let i = 1, n = displayName.length; isValid && i < n; i++) {
|
||||
isValid = isIdentifierPart(displayName.charCodeAt(i), target);
|
||||
}
|
||||
|
||||
if (isValid) {
|
||||
return unescapeIdentifier(displayName);
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return getCompletionEntryDisplayName(displayName, target, performCharacterChecks);
|
||||
}
|
||||
|
||||
function getValidCompletionEntryDisplayName(displayName: string, target: ScriptTarget): string {
|
||||
function getCompletionEntryDisplayName(displayName: string, target: ScriptTarget, performCharacterChecks: boolean): string {
|
||||
if (!displayName) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let firstCharCode = displayName.charCodeAt(0);
|
||||
if (displayName && displayName.length >= 2 &&
|
||||
if (displayName.length >= 2 &&
|
||||
firstCharCode === displayName.charCodeAt(displayName.length - 1) &&
|
||||
(firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) {
|
||||
// If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an
|
||||
@@ -2607,19 +2594,30 @@ module ts {
|
||||
displayName = displayName.substring(1, displayName.length - 1);
|
||||
}
|
||||
|
||||
let isValid = isIdentifierStart(displayName.charCodeAt(0), target);
|
||||
for (let i = 1, n = displayName.length; isValid && i < n; i++) {
|
||||
isValid = isIdentifierPart(displayName.charCodeAt(i), target);
|
||||
if (!displayName) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return isValid ? unescapeIdentifier(displayName) : undefined;
|
||||
if (performCharacterChecks) {
|
||||
if (!isIdentifierStart(displayName.charCodeAt(0), target)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
for (let i = 1, n = displayName.length; i < n; i++) {
|
||||
if (!isIdentifierPart(displayName.charCodeAt(i), target)) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return unescapeIdentifier(displayName);
|
||||
}
|
||||
|
||||
function createCompletionEntry(symbol: Symbol, typeChecker: TypeChecker, location: Node): CompletionEntry {
|
||||
// Try to get a valid display name for this symbol, if we could not find one, then ignore it.
|
||||
// We would like to only show things that can be added after a dot, so for instance numeric properties can
|
||||
// not be accessed with a dot (a.1 <- invalid)
|
||||
let displayName = getValidCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target);
|
||||
let displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true);
|
||||
if (!displayName) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -2640,37 +2638,18 @@ module ts {
|
||||
};
|
||||
}
|
||||
|
||||
// If symbolName is undefined, all symbols at the specified are returned. If symbolName
|
||||
// is not undefined, then the first symbol with that name at the specified position
|
||||
// will be returned. Calling without symbolName is useful when you want the entire
|
||||
// list of symbols (like for getCompletionsAtPosition). Calling with a symbolName is
|
||||
// useful when you want information about a single symbol (like for getCompletionEntryDetails).
|
||||
function getCompletionData(fileName: string, position: number, symbolName?: string) {
|
||||
let result = getCompletionDataWorker(fileName, position, symbolName);
|
||||
if (!result) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (result.symbols && symbolName) {
|
||||
var target = program.getCompilerOptions().target;
|
||||
result.symbols = filter(result.symbols, s => getValidCompletionEntryDisplayNameForSymbol(s, target) === symbolName);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function getCompletionDataWorker(fileName: string, position: number, symbolName: string) {
|
||||
function getCompletionData(fileName: string, position: number) {
|
||||
let syntacticStart = new Date().getTime();
|
||||
let sourceFile = getValidSourceFile(fileName);
|
||||
|
||||
let start = new Date().getTime();
|
||||
let currentToken = getTokenAtPosition(sourceFile, position);
|
||||
log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start));
|
||||
log("getCompletionData: Get current token: " + (new Date().getTime() - start));
|
||||
|
||||
start = new Date().getTime();
|
||||
// Completion not allowed inside comments, bail out if this is the case
|
||||
let insideComment = isInsideComment(sourceFile, currentToken, position);
|
||||
log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start));
|
||||
log("getCompletionData: Is inside comment: " + (new Date().getTime() - start));
|
||||
|
||||
if (insideComment) {
|
||||
log("Returning an empty list because completion was inside a comment.");
|
||||
@@ -2681,14 +2660,14 @@ module ts {
|
||||
// Note: previousToken can be undefined if we are the beginning of the file
|
||||
start = new Date().getTime();
|
||||
let previousToken = findPrecedingToken(position, sourceFile);
|
||||
log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start));
|
||||
log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start));
|
||||
|
||||
// The caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS|
|
||||
// Skip this partial identifier to the previous token
|
||||
if (previousToken && position <= previousToken.end && previousToken.kind === SyntaxKind.Identifier) {
|
||||
let start = new Date().getTime();
|
||||
previousToken = findPrecedingToken(previousToken.pos, sourceFile);
|
||||
log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start));
|
||||
log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start));
|
||||
}
|
||||
|
||||
// Check if this is a valid completion location
|
||||
@@ -2731,8 +2710,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
// Add keywords if this is not a member completion list
|
||||
log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart));
|
||||
log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart));
|
||||
|
||||
return { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot };
|
||||
|
||||
@@ -2808,12 +2786,7 @@ module ts {
|
||||
/// TODO filter meaning based on the current context
|
||||
let scopeNode = getScopeNode(previousToken, position, sourceFile);
|
||||
let symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias;
|
||||
|
||||
// Filter down to the symbol that matches the symbolName if we were given one.
|
||||
let predicate = symbolName !== undefined
|
||||
? (s: Symbol) => getValidCompletionEntryDisplayNameForSymbol(s, target) === symbolName
|
||||
: undefined;
|
||||
symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings, predicate);
|
||||
symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3160,7 +3133,7 @@ module ts {
|
||||
|
||||
var target = program.getCompilerOptions().target;
|
||||
for (let name in allIdentifiers) {
|
||||
let displayName = getValidCompletionEntryDisplayName(name, target);
|
||||
let displayName = getCompletionEntryDisplayName(name, target, /*performCharacterChecks:*/ true);
|
||||
if (displayName) {
|
||||
// Use '1' so that all javascript identifier entries sort after Symbol entries.
|
||||
entries.push({
|
||||
@@ -3201,12 +3174,19 @@ module ts {
|
||||
function getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails {
|
||||
synchronizeHostData();
|
||||
|
||||
// Look up a completion symbol with this name.
|
||||
let completionData = getCompletionData(fileName, position, entryName);
|
||||
// Compute all the completion symbols again.
|
||||
let completionData = getCompletionData(fileName, position);
|
||||
if (completionData) {
|
||||
let { symbols, location } = completionData;
|
||||
if (symbols && symbols.length > 0) {
|
||||
let symbol = symbols[0];
|
||||
|
||||
// Find the symbol with the matching entry name.
|
||||
let target = program.getCompilerOptions().target;
|
||||
// We don't need to perform character checks here because we're only comparing the
|
||||
// name against 'entryName' (which is known to be good), not building a new
|
||||
// completion entry.
|
||||
let symbol = forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks:*/ false) === entryName ? s : undefined);
|
||||
|
||||
if (symbol) {
|
||||
let displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, typeInfoResolver, location, SemanticMeaning.All);
|
||||
return {
|
||||
name: entryName,
|
||||
|
||||
@@ -860,7 +860,7 @@ declare module "typescript" {
|
||||
getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
|
||||
getIndexTypeOfType(type: Type, kind: IndexKind): Type;
|
||||
getReturnTypeOfSignature(signature: Signature): Type;
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
getShorthandAssignmentValueSymbol(location: Node): Symbol;
|
||||
getTypeAtLocation(node: Node): Type;
|
||||
@@ -938,8 +938,8 @@ declare module "typescript" {
|
||||
errorModuleName?: string;
|
||||
}
|
||||
interface EmitResolver {
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
isReferencedAliasDeclaration(node: Node): boolean;
|
||||
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
|
||||
@@ -953,7 +953,7 @@ declare module "typescript" {
|
||||
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
|
||||
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
|
||||
@@ -2632,15 +2632,12 @@ declare module "typescript" {
|
||||
>Signature : Signature
|
||||
>Type : Type
|
||||
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
>getSymbolsInScope : (location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean) => Symbol[]
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
>getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[]
|
||||
>location : Node
|
||||
>Node : Node
|
||||
>meaning : SymbolFlags
|
||||
>SymbolFlags : SymbolFlags
|
||||
>predicate : (symbol: Symbol) => boolean
|
||||
>symbol : Symbol
|
||||
>Symbol : Symbol
|
||||
>Symbol : Symbol
|
||||
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
@@ -3006,16 +3003,18 @@ declare module "typescript" {
|
||||
interface EmitResolver {
|
||||
>EmitResolver : EmitResolver
|
||||
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
>hasGlobalName : (name: string) => boolean
|
||||
>name : string
|
||||
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
>getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
>getGeneratedNameForNode : (node: Node) => string
|
||||
>node : Node
|
||||
>Node : Node
|
||||
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
>getExpressionNameSubstitution : (node: Identifier) => string
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
>hasExportDefaultValue : (node: SourceFile) => boolean
|
||||
>node : SourceFile
|
||||
@@ -3112,8 +3111,8 @@ declare module "typescript" {
|
||||
>PropertyAccessExpression : PropertyAccessExpression
|
||||
>ElementAccessExpression : ElementAccessExpression
|
||||
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
>isUnknownIdentifier : (location: Node, name: string) => boolean
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
>resolvesToSomeValue : (location: Node, name: string) => boolean
|
||||
>location : Node
|
||||
>Node : Node
|
||||
>name : string
|
||||
|
||||
@@ -891,7 +891,7 @@ declare module "typescript" {
|
||||
getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
|
||||
getIndexTypeOfType(type: Type, kind: IndexKind): Type;
|
||||
getReturnTypeOfSignature(signature: Signature): Type;
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
getShorthandAssignmentValueSymbol(location: Node): Symbol;
|
||||
getTypeAtLocation(node: Node): Type;
|
||||
@@ -969,8 +969,8 @@ declare module "typescript" {
|
||||
errorModuleName?: string;
|
||||
}
|
||||
interface EmitResolver {
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
isReferencedAliasDeclaration(node: Node): boolean;
|
||||
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
|
||||
@@ -984,7 +984,7 @@ declare module "typescript" {
|
||||
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
|
||||
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
|
||||
@@ -2778,15 +2778,12 @@ declare module "typescript" {
|
||||
>Signature : Signature
|
||||
>Type : Type
|
||||
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
>getSymbolsInScope : (location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean) => Symbol[]
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
>getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[]
|
||||
>location : Node
|
||||
>Node : Node
|
||||
>meaning : SymbolFlags
|
||||
>SymbolFlags : SymbolFlags
|
||||
>predicate : (symbol: Symbol) => boolean
|
||||
>symbol : Symbol
|
||||
>Symbol : Symbol
|
||||
>Symbol : Symbol
|
||||
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
@@ -3152,16 +3149,18 @@ declare module "typescript" {
|
||||
interface EmitResolver {
|
||||
>EmitResolver : EmitResolver
|
||||
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
>hasGlobalName : (name: string) => boolean
|
||||
>name : string
|
||||
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
>getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
>getGeneratedNameForNode : (node: Node) => string
|
||||
>node : Node
|
||||
>Node : Node
|
||||
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
>getExpressionNameSubstitution : (node: Identifier) => string
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
>hasExportDefaultValue : (node: SourceFile) => boolean
|
||||
>node : SourceFile
|
||||
@@ -3258,8 +3257,8 @@ declare module "typescript" {
|
||||
>PropertyAccessExpression : PropertyAccessExpression
|
||||
>ElementAccessExpression : ElementAccessExpression
|
||||
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
>isUnknownIdentifier : (location: Node, name: string) => boolean
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
>resolvesToSomeValue : (location: Node, name: string) => boolean
|
||||
>location : Node
|
||||
>Node : Node
|
||||
>name : string
|
||||
|
||||
@@ -892,7 +892,7 @@ declare module "typescript" {
|
||||
getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
|
||||
getIndexTypeOfType(type: Type, kind: IndexKind): Type;
|
||||
getReturnTypeOfSignature(signature: Signature): Type;
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
getShorthandAssignmentValueSymbol(location: Node): Symbol;
|
||||
getTypeAtLocation(node: Node): Type;
|
||||
@@ -970,8 +970,8 @@ declare module "typescript" {
|
||||
errorModuleName?: string;
|
||||
}
|
||||
interface EmitResolver {
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
isReferencedAliasDeclaration(node: Node): boolean;
|
||||
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
|
||||
@@ -985,7 +985,7 @@ declare module "typescript" {
|
||||
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
|
||||
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
|
||||
@@ -2728,15 +2728,12 @@ declare module "typescript" {
|
||||
>Signature : Signature
|
||||
>Type : Type
|
||||
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
>getSymbolsInScope : (location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean) => Symbol[]
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
>getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[]
|
||||
>location : Node
|
||||
>Node : Node
|
||||
>meaning : SymbolFlags
|
||||
>SymbolFlags : SymbolFlags
|
||||
>predicate : (symbol: Symbol) => boolean
|
||||
>symbol : Symbol
|
||||
>Symbol : Symbol
|
||||
>Symbol : Symbol
|
||||
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
@@ -3102,16 +3099,18 @@ declare module "typescript" {
|
||||
interface EmitResolver {
|
||||
>EmitResolver : EmitResolver
|
||||
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
>hasGlobalName : (name: string) => boolean
|
||||
>name : string
|
||||
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
>getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
>getGeneratedNameForNode : (node: Node) => string
|
||||
>node : Node
|
||||
>Node : Node
|
||||
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
>getExpressionNameSubstitution : (node: Identifier) => string
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
>hasExportDefaultValue : (node: SourceFile) => boolean
|
||||
>node : SourceFile
|
||||
@@ -3208,8 +3207,8 @@ declare module "typescript" {
|
||||
>PropertyAccessExpression : PropertyAccessExpression
|
||||
>ElementAccessExpression : ElementAccessExpression
|
||||
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
>isUnknownIdentifier : (location: Node, name: string) => boolean
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
>resolvesToSomeValue : (location: Node, name: string) => boolean
|
||||
>location : Node
|
||||
>Node : Node
|
||||
>name : string
|
||||
|
||||
@@ -929,7 +929,7 @@ declare module "typescript" {
|
||||
getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
|
||||
getIndexTypeOfType(type: Type, kind: IndexKind): Type;
|
||||
getReturnTypeOfSignature(signature: Signature): Type;
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
getShorthandAssignmentValueSymbol(location: Node): Symbol;
|
||||
getTypeAtLocation(node: Node): Type;
|
||||
@@ -1007,8 +1007,8 @@ declare module "typescript" {
|
||||
errorModuleName?: string;
|
||||
}
|
||||
interface EmitResolver {
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
isReferencedAliasDeclaration(node: Node): boolean;
|
||||
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
|
||||
@@ -1022,7 +1022,7 @@ declare module "typescript" {
|
||||
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
|
||||
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
|
||||
@@ -2901,15 +2901,12 @@ declare module "typescript" {
|
||||
>Signature : Signature
|
||||
>Type : Type
|
||||
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean): Symbol[];
|
||||
>getSymbolsInScope : (location: Node, meaning: SymbolFlags, predicate?: (symbol: Symbol) => boolean) => Symbol[]
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
>getSymbolsInScope : (location: Node, meaning: SymbolFlags) => Symbol[]
|
||||
>location : Node
|
||||
>Node : Node
|
||||
>meaning : SymbolFlags
|
||||
>SymbolFlags : SymbolFlags
|
||||
>predicate : (symbol: Symbol) => boolean
|
||||
>symbol : Symbol
|
||||
>Symbol : Symbol
|
||||
>Symbol : Symbol
|
||||
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
@@ -3275,16 +3272,18 @@ declare module "typescript" {
|
||||
interface EmitResolver {
|
||||
>EmitResolver : EmitResolver
|
||||
|
||||
getGeneratedNameForNode(node: Node): string;
|
||||
hasGlobalName(name: string): boolean;
|
||||
>hasGlobalName : (name: string) => boolean
|
||||
>name : string
|
||||
|
||||
getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string;
|
||||
>getExpressionNameSubstitution : (node: Identifier, getGeneratedNameForNode: (node: Node) => string) => string
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
>getGeneratedNameForNode : (node: Node) => string
|
||||
>node : Node
|
||||
>Node : Node
|
||||
|
||||
getExpressionNameSubstitution(node: Identifier): string;
|
||||
>getExpressionNameSubstitution : (node: Identifier) => string
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
|
||||
hasExportDefaultValue(node: SourceFile): boolean;
|
||||
>hasExportDefaultValue : (node: SourceFile) => boolean
|
||||
>node : SourceFile
|
||||
@@ -3381,8 +3380,8 @@ declare module "typescript" {
|
||||
>PropertyAccessExpression : PropertyAccessExpression
|
||||
>ElementAccessExpression : ElementAccessExpression
|
||||
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
>isUnknownIdentifier : (location: Node, name: string) => boolean
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
>resolvesToSomeValue : (location: Node, name: string) => boolean
|
||||
>location : Node
|
||||
>Node : Node
|
||||
>name : string
|
||||
|
||||
@@ -11,7 +11,7 @@ for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var v = _a[_i];
|
||||
v;
|
||||
for (var _b = 0, _c = []; _b < _c.length; _b++) {
|
||||
var _v = _c[_b];
|
||||
var x = _v;
|
||||
var v_1 = _c[_b];
|
||||
var x = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var v = _a[_i];
|
||||
v;
|
||||
for (var _b = 0, _c = []; _b < _c.length; _b++) {
|
||||
var _v = _c[_b];
|
||||
var x = _v;
|
||||
_v++;
|
||||
var v_1 = _c[_b];
|
||||
var x = v_1;
|
||||
v_1++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
for (var _b = 0, _c = [
|
||||
v
|
||||
]; _b < _c.length; _b++) {
|
||||
var _v = _c[_b];
|
||||
var x = _v;
|
||||
_v++;
|
||||
var v_1 = _c[_b];
|
||||
var x = v_1;
|
||||
v_1++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,6 @@ for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
v;
|
||||
}
|
||||
for (var _b = 0, _c = []; _b < _c.length; _b++) {
|
||||
var _v = _c[_b];
|
||||
_v;
|
||||
var v = _c[_b];
|
||||
v;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var v = _a[_i];
|
||||
v;
|
||||
function foo() {
|
||||
for (var _b = 0, _c = []; _b < _c.length; _b++) {
|
||||
var _v = _c[_b];
|
||||
_v;
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var v_1 = _a[_i];
|
||||
v_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ for (let v of []) {
|
||||
//// [ES5For-of20.js]
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var v = _a[_i];
|
||||
var _v;
|
||||
var v_1;
|
||||
for (var _b = 0, _c = [
|
||||
v
|
||||
]; _b < _c.length; _b++) {
|
||||
var _v_1 = _c[_b];
|
||||
var _v_2;
|
||||
var v_2 = _c[_b];
|
||||
var v_3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,5 +12,5 @@ var a = [
|
||||
];
|
||||
for (var _i = 0; _i < a.length; _i++) {
|
||||
var v = a[_i];
|
||||
var _a = 0;
|
||||
var a_1 = 0;
|
||||
}
|
||||
|
||||
@@ -35,19 +35,19 @@ var ag2 = new A.A2<string, number>();
|
||||
|
||||
//// [ModuleWithExportedAndNonExportedClasses.js]
|
||||
var A;
|
||||
(function (_A) {
|
||||
(function (A_1) {
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
_A.A = A;
|
||||
A_1.A = A;
|
||||
var AG = (function () {
|
||||
function AG() {
|
||||
}
|
||||
return AG;
|
||||
})();
|
||||
_A.AG = AG;
|
||||
A_1.AG = AG;
|
||||
var A2 = (function () {
|
||||
function A2() {
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ var M;
|
||||
})();
|
||||
M.C = C;
|
||||
var C;
|
||||
(function (_C) {
|
||||
_C.C = M.C;
|
||||
(function (C_1) {
|
||||
C_1.C = M.C;
|
||||
})(C = M.C || (M.C = {}));
|
||||
})(M || (M = {}));
|
||||
|
||||
@@ -47,14 +47,14 @@ module M { // Shouldnt be _M
|
||||
|
||||
//// [collisionCodeGenModuleWithAccessorChildren.js]
|
||||
var M;
|
||||
(function (_M) {
|
||||
_M.x = 3;
|
||||
(function (M_1) {
|
||||
M_1.x = 3;
|
||||
var c = (function () {
|
||||
function c() {
|
||||
}
|
||||
Object.defineProperty(c.prototype, "Z", {
|
||||
set: function (M) {
|
||||
this.y = _M.x;
|
||||
this.y = M_1.x;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
@@ -63,14 +63,14 @@ var M;
|
||||
})();
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_1) {
|
||||
(function (M_2) {
|
||||
var d = (function () {
|
||||
function d() {
|
||||
}
|
||||
Object.defineProperty(d.prototype, "Z", {
|
||||
set: function (p) {
|
||||
var M = 10;
|
||||
this.y = _M_1.x;
|
||||
this.y = M_2.x;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
@@ -94,14 +94,14 @@ var M;
|
||||
})();
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_2) {
|
||||
(function (M_3) {
|
||||
var f = (function () {
|
||||
function f() {
|
||||
}
|
||||
Object.defineProperty(f.prototype, "Z", {
|
||||
get: function () {
|
||||
var M = 10;
|
||||
return _M_2.x;
|
||||
return M_3.x;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
||||
@@ -25,31 +25,31 @@ module M {
|
||||
|
||||
//// [collisionCodeGenModuleWithConstructorChildren.js]
|
||||
var M;
|
||||
(function (_M) {
|
||||
_M.x = 3;
|
||||
(function (M_1) {
|
||||
M_1.x = 3;
|
||||
var c = (function () {
|
||||
function c(M, p) {
|
||||
if (p === void 0) { p = _M.x; }
|
||||
if (p === void 0) { p = M_1.x; }
|
||||
}
|
||||
return c;
|
||||
})();
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_1) {
|
||||
(function (M_2) {
|
||||
var d = (function () {
|
||||
function d(M, p) {
|
||||
if (p === void 0) { p = _M_1.x; }
|
||||
if (p === void 0) { p = M_2.x; }
|
||||
this.M = M;
|
||||
}
|
||||
return d;
|
||||
})();
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_2) {
|
||||
(function (M_3) {
|
||||
var d2 = (function () {
|
||||
function d2() {
|
||||
var M = 10;
|
||||
var p = _M_2.x;
|
||||
var p = M_3.x;
|
||||
}
|
||||
return d2;
|
||||
})();
|
||||
|
||||
@@ -21,24 +21,24 @@ module M {
|
||||
|
||||
//// [collisionCodeGenModuleWithFunctionChildren.js]
|
||||
var M;
|
||||
(function (_M) {
|
||||
_M.x = 3;
|
||||
(function (M_1) {
|
||||
M_1.x = 3;
|
||||
function fn(M, p) {
|
||||
if (p === void 0) { p = _M.x; }
|
||||
if (p === void 0) { p = M_1.x; }
|
||||
}
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_1) {
|
||||
(function (M_2) {
|
||||
function fn2() {
|
||||
var M;
|
||||
var p = _M_1.x;
|
||||
var p = M_2.x;
|
||||
}
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_2) {
|
||||
(function (M_3) {
|
||||
function fn3() {
|
||||
function M() {
|
||||
var p = _M_2.x;
|
||||
var p = M_3.x;
|
||||
}
|
||||
}
|
||||
})(M || (M = {}));
|
||||
|
||||
@@ -17,29 +17,29 @@ var foo = new m2._m2();
|
||||
|
||||
//// [collisionCodeGenModuleWithMemberClassConflict.js]
|
||||
var m1;
|
||||
(function (_m1) {
|
||||
(function (m1_1) {
|
||||
var m1 = (function () {
|
||||
function m1() {
|
||||
}
|
||||
return m1;
|
||||
})();
|
||||
_m1.m1 = m1;
|
||||
m1_1.m1 = m1;
|
||||
})(m1 || (m1 = {}));
|
||||
var foo = new m1.m1();
|
||||
var m2;
|
||||
(function (_m2_1) {
|
||||
(function (m2_1) {
|
||||
var m2 = (function () {
|
||||
function m2() {
|
||||
}
|
||||
return m2;
|
||||
})();
|
||||
_m2_1.m2 = m2;
|
||||
m2_1.m2 = m2;
|
||||
var _m2 = (function () {
|
||||
function _m2() {
|
||||
}
|
||||
return _m2;
|
||||
})();
|
||||
_m2_1._m2 = _m2;
|
||||
m2_1._m2 = _m2;
|
||||
})(m2 || (m2 = {}));
|
||||
var foo = new m2.m2();
|
||||
var foo = new m2._m2();
|
||||
|
||||
@@ -7,8 +7,8 @@ var foo = m1.m1;
|
||||
|
||||
//// [collisionCodeGenModuleWithMemberVariable.js]
|
||||
var m1;
|
||||
(function (_m1) {
|
||||
_m1.m1 = 10;
|
||||
var b = _m1.m1;
|
||||
(function (m1_1) {
|
||||
m1_1.m1 = 10;
|
||||
var b = m1_1.m1;
|
||||
})(m1 || (m1 = {}));
|
||||
var foo = m1.m1;
|
||||
|
||||
@@ -34,37 +34,37 @@ module M { // Shouldnt bn _M
|
||||
|
||||
//// [collisionCodeGenModuleWithMethodChildren.js]
|
||||
var M;
|
||||
(function (_M) {
|
||||
_M.x = 3;
|
||||
(function (M_1) {
|
||||
M_1.x = 3;
|
||||
var c = (function () {
|
||||
function c() {
|
||||
}
|
||||
c.prototype.fn = function (M, p) {
|
||||
if (p === void 0) { p = _M.x; }
|
||||
if (p === void 0) { p = M_1.x; }
|
||||
};
|
||||
return c;
|
||||
})();
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_1) {
|
||||
(function (M_2) {
|
||||
var d = (function () {
|
||||
function d() {
|
||||
}
|
||||
d.prototype.fn2 = function () {
|
||||
var M;
|
||||
var p = _M_1.x;
|
||||
var p = M_2.x;
|
||||
};
|
||||
return d;
|
||||
})();
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_2) {
|
||||
(function (M_3) {
|
||||
var e = (function () {
|
||||
function e() {
|
||||
}
|
||||
e.prototype.fn3 = function () {
|
||||
function M() {
|
||||
var p = _M_2.x;
|
||||
var p = M_3.x;
|
||||
}
|
||||
};
|
||||
return e;
|
||||
|
||||
@@ -44,16 +44,16 @@ module M {
|
||||
|
||||
//// [collisionCodeGenModuleWithModuleChildren.js]
|
||||
var M;
|
||||
(function (_M) {
|
||||
_M.x = 3;
|
||||
(function (M_1) {
|
||||
M_1.x = 3;
|
||||
var m1;
|
||||
(function (m1) {
|
||||
var M = 10;
|
||||
var p = _M.x;
|
||||
var p = M_1.x;
|
||||
})(m1 || (m1 = {}));
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_1) {
|
||||
(function (M_2) {
|
||||
var m2;
|
||||
(function (m2) {
|
||||
var M = (function () {
|
||||
@@ -61,17 +61,17 @@ var M;
|
||||
}
|
||||
return M;
|
||||
})();
|
||||
var p = _M_1.x;
|
||||
var p = M_2.x;
|
||||
var p2 = new M();
|
||||
})(m2 || (m2 = {}));
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_2) {
|
||||
(function (M_3) {
|
||||
var m3;
|
||||
(function (m3) {
|
||||
function M() {
|
||||
}
|
||||
var p = _M_2.x;
|
||||
var p = M_3.x;
|
||||
var p2 = M();
|
||||
})(m3 || (m3 = {}));
|
||||
})(M || (M = {}));
|
||||
@@ -84,12 +84,12 @@ var M;
|
||||
})(m3 || (m3 = {}));
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (_M_3) {
|
||||
(function (M_4) {
|
||||
var m4;
|
||||
(function (m4) {
|
||||
var M;
|
||||
(function (M) {
|
||||
var p = _M_3.x;
|
||||
var p = M_4.x;
|
||||
})(M || (M = {}));
|
||||
})(m4 || (m4 = {}));
|
||||
})(M || (M = {}));
|
||||
|
||||
@@ -31,13 +31,13 @@ var foo2 = new m2.m2();
|
||||
|
||||
//// [collisionCodeGenModuleWithModuleReopening.js]
|
||||
var m1;
|
||||
(function (_m1) {
|
||||
(function (m1_1) {
|
||||
var m1 = (function () {
|
||||
function m1() {
|
||||
}
|
||||
return m1;
|
||||
})();
|
||||
_m1.m1 = m1;
|
||||
m1_1.m1 = m1;
|
||||
})(m1 || (m1 = {}));
|
||||
var foo = new m1.m1();
|
||||
var m1;
|
||||
@@ -65,16 +65,16 @@ var m2;
|
||||
})(m2 || (m2 = {}));
|
||||
var foo3 = new m2.c1();
|
||||
var m2;
|
||||
(function (_m2) {
|
||||
(function (m2_1) {
|
||||
var m2 = (function () {
|
||||
function m2() {
|
||||
}
|
||||
return m2;
|
||||
})();
|
||||
_m2.m2 = m2;
|
||||
m2_1.m2 = m2;
|
||||
var b = new m2();
|
||||
var d = _m2.b10;
|
||||
var c = new _m2.c1();
|
||||
var d = m2_1.b10;
|
||||
var c = new m2_1.c1();
|
||||
})(m2 || (m2 = {}));
|
||||
var foo3 = new m2.c1();
|
||||
var foo2 = new m2.m2();
|
||||
|
||||
@@ -10,7 +10,7 @@ var foo = new m1.c1();
|
||||
|
||||
//// [collisionCodeGenModuleWithPrivateMember.js]
|
||||
var m1;
|
||||
(function (_m1) {
|
||||
(function (m1_1) {
|
||||
var m1 = (function () {
|
||||
function m1() {
|
||||
}
|
||||
@@ -22,6 +22,6 @@ var m1;
|
||||
}
|
||||
return c1;
|
||||
})();
|
||||
_m1.c1 = c1;
|
||||
m1_1.c1 = c1;
|
||||
})(m1 || (m1 = {}));
|
||||
var foo = new m1.c1();
|
||||
|
||||
@@ -11,12 +11,12 @@ var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكو
|
||||
|
||||
//// [collisionCodeGenModuleWithUnicodeNames.js]
|
||||
var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123;
|
||||
(function (_才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123) {
|
||||
(function (才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123_1) {
|
||||
var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = (function () {
|
||||
function 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123() {
|
||||
}
|
||||
return 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123;
|
||||
})();
|
||||
_才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123;
|
||||
才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123_1.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123;
|
||||
})(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 || (才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = {}));
|
||||
var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123();
|
||||
|
||||
@@ -13,13 +13,13 @@ export = b;
|
||||
var m;
|
||||
(function (m) {
|
||||
var c;
|
||||
(function (_c) {
|
||||
(function (c_1) {
|
||||
var c = (function () {
|
||||
function c() {
|
||||
}
|
||||
return c;
|
||||
})();
|
||||
_c.c = c;
|
||||
c_1.c = c;
|
||||
})(c = m.c || (m.c = {}));
|
||||
})(m || (m = {}));
|
||||
var a = m.c;
|
||||
|
||||
@@ -73,8 +73,8 @@ function f15() {
|
||||
var _f = f15(), a4 = _f.a4, b4 = _f.b4, c4 = _f.c4;
|
||||
var m;
|
||||
(function (m) {
|
||||
_g = f15(), m.a4 = _g.a4, m.b4 = _g.b4, m.c4 = _g.c4;
|
||||
var _g;
|
||||
_a = f15(), m.a4 = _a.a4, m.b4 = _a.b4, m.c4 = _a.c4;
|
||||
var _a;
|
||||
})(m || (m = {}));
|
||||
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ function f15() {
|
||||
var _c = f15(), a4 = _c.a4, b4 = _c.b4, c4 = _c.c4;
|
||||
var m;
|
||||
(function (m) {
|
||||
_d = f15(), m.a4 = _d.a4, m.b4 = _d.b4, m.c4 = _d.c4;
|
||||
var _d;
|
||||
_a = f15(), m.a4 = _a.a4, m.b4 = _a.b4, m.c4 = _a.c4;
|
||||
var _a;
|
||||
})(m || (m = {}));
|
||||
|
||||
|
||||
|
||||
@@ -14,13 +14,13 @@ export = m;
|
||||
var m;
|
||||
(function (m) {
|
||||
var c;
|
||||
(function (_c) {
|
||||
(function (c_1) {
|
||||
var c = (function () {
|
||||
function c() {
|
||||
}
|
||||
return c;
|
||||
})();
|
||||
_c.c = c;
|
||||
c_1.c = c;
|
||||
})(c = m.c || (m.c = {}));
|
||||
m.a;
|
||||
})(m || (m = {}));
|
||||
|
||||
@@ -59,24 +59,24 @@ use(y);
|
||||
var x = 10;
|
||||
var z0, z1, z2, z3;
|
||||
{
|
||||
var _x = 20;
|
||||
use(_x);
|
||||
var _z0 = ([
|
||||
var x_1 = 20;
|
||||
use(x_1);
|
||||
var z0_1 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_z0);
|
||||
var _z1 = ([
|
||||
use(z0_1);
|
||||
var z1_1 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_z1);
|
||||
var _z2 = ({
|
||||
use(z1_1);
|
||||
var z2_1 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z2);
|
||||
var _z3 = ({
|
||||
use(z2_1);
|
||||
var z3_1 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z3);
|
||||
use(z3_1);
|
||||
}
|
||||
use(x);
|
||||
use(z0);
|
||||
@@ -86,38 +86,38 @@ use(z3);
|
||||
var z6;
|
||||
var y = true;
|
||||
{
|
||||
var _y = "";
|
||||
var _z6 = ([
|
||||
var y_1 = "";
|
||||
var z6_1 = ([
|
||||
true
|
||||
])[0];
|
||||
{
|
||||
var _y_1 = 1;
|
||||
var _z6_1 = ({
|
||||
var y_2 = 1;
|
||||
var z6_2 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_y_1);
|
||||
use(_z6_1);
|
||||
use(y_2);
|
||||
use(z6_2);
|
||||
}
|
||||
use(_y);
|
||||
use(_z6);
|
||||
use(y_1);
|
||||
use(z6_1);
|
||||
}
|
||||
use(y);
|
||||
use(z6);
|
||||
var z = false;
|
||||
var z5 = 1;
|
||||
{
|
||||
var _z = "";
|
||||
var _z5 = ([
|
||||
var z_1 = "";
|
||||
var z5_1 = ([
|
||||
5
|
||||
])[0];
|
||||
{
|
||||
var _z_1 = 1;
|
||||
var _z5_1 = ({
|
||||
var _z = 1;
|
||||
var _z5 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
// try to step on generated name
|
||||
use(_z_1);
|
||||
use(_z);
|
||||
}
|
||||
use(_z);
|
||||
use(z_1);
|
||||
}
|
||||
use(y);
|
||||
|
||||
@@ -59,28 +59,28 @@ use(y);
|
||||
var x = 10;
|
||||
var z0, z1, z2, z3;
|
||||
{
|
||||
var _x = 20;
|
||||
use(_x);
|
||||
var _z0 = ([
|
||||
var x_1 = 20;
|
||||
use(x_1);
|
||||
var z0_1 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_z0);
|
||||
var _z1 = ([
|
||||
use(z0_1);
|
||||
var z1_1 = ([
|
||||
{
|
||||
a: 1
|
||||
}
|
||||
])[0].a;
|
||||
use(_z1);
|
||||
var _z2 = ({
|
||||
use(z1_1);
|
||||
var z2_1 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z2);
|
||||
var _z3 = ({
|
||||
use(z2_1);
|
||||
var z3_1 = ({
|
||||
a: {
|
||||
b: 1
|
||||
}
|
||||
}).a.b;
|
||||
use(_z3);
|
||||
use(z3_1);
|
||||
}
|
||||
use(x);
|
||||
use(z0);
|
||||
@@ -90,38 +90,38 @@ use(z3);
|
||||
var z6;
|
||||
var y = true;
|
||||
{
|
||||
var _y = "";
|
||||
var _z6 = ([
|
||||
var y_1 = "";
|
||||
var z6_1 = ([
|
||||
true
|
||||
])[0];
|
||||
{
|
||||
var _y_1 = 1;
|
||||
var _z6_1 = ({
|
||||
var y_2 = 1;
|
||||
var z6_2 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_y_1);
|
||||
use(_z6_1);
|
||||
use(y_2);
|
||||
use(z6_2);
|
||||
}
|
||||
use(_y);
|
||||
use(_z6);
|
||||
use(y_1);
|
||||
use(z6_1);
|
||||
}
|
||||
use(y);
|
||||
use(z6);
|
||||
var z = false;
|
||||
var z5 = 1;
|
||||
{
|
||||
var _z = "";
|
||||
var _z5 = ([
|
||||
var z_1 = "";
|
||||
var z5_1 = ([
|
||||
5
|
||||
])[0];
|
||||
{
|
||||
var _z_1 = 1;
|
||||
var _z5_1 = ({
|
||||
var _z = 1;
|
||||
var _z5 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
// try to step on generated name
|
||||
use(_z_1);
|
||||
use(_z);
|
||||
}
|
||||
use(_z);
|
||||
use(z_1);
|
||||
}
|
||||
use(y);
|
||||
|
||||
@@ -236,29 +236,29 @@ use(x);
|
||||
use(y);
|
||||
use(z);
|
||||
function foo1() {
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x = 1;
|
||||
use(x);
|
||||
var y = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y);
|
||||
var z = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z);
|
||||
}
|
||||
function foo2() {
|
||||
{
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x_1 = 1;
|
||||
use(x_1);
|
||||
var y_1 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y_1);
|
||||
var z_1 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z_1);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
@@ -266,29 +266,29 @@ var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.m1 = function () {
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x = 1;
|
||||
use(x);
|
||||
var y = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y);
|
||||
var z = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z);
|
||||
};
|
||||
A.prototype.m2 = function () {
|
||||
{
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x_2 = 1;
|
||||
use(x_2);
|
||||
var y_2 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y_2);
|
||||
var z_2 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z_2);
|
||||
}
|
||||
use(x);
|
||||
};
|
||||
@@ -298,200 +298,200 @@ var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
B.prototype.m1 = function () {
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x = 1;
|
||||
use(x);
|
||||
var y = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y);
|
||||
var z = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z);
|
||||
};
|
||||
B.prototype.m2 = function () {
|
||||
{
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x_3 = 1;
|
||||
use(x_3);
|
||||
var y_3 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y_3);
|
||||
var z_3 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z_3);
|
||||
}
|
||||
use(x);
|
||||
};
|
||||
return B;
|
||||
})();
|
||||
function bar1() {
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x = 1;
|
||||
use(x);
|
||||
var y = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y);
|
||||
var z = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z);
|
||||
}
|
||||
function bar2() {
|
||||
{
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x_4 = 1;
|
||||
use(x_4);
|
||||
var y_4 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y_4);
|
||||
var z_4 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z_4);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
var M1;
|
||||
(function (M1) {
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x = 1;
|
||||
use(x);
|
||||
var y = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y);
|
||||
var z = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z);
|
||||
})(M1 || (M1 = {}));
|
||||
var M2;
|
||||
(function (M2) {
|
||||
{
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x_5 = 1;
|
||||
use(x_5);
|
||||
var y_5 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y_5);
|
||||
var z_5 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z_5);
|
||||
}
|
||||
use(x);
|
||||
})(M2 || (M2 = {}));
|
||||
var M3;
|
||||
(function (M3) {
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x = 1;
|
||||
use(x);
|
||||
var y = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y);
|
||||
var z = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z);
|
||||
})(M3 || (M3 = {}));
|
||||
var M4;
|
||||
(function (M4) {
|
||||
{
|
||||
var _x = 1;
|
||||
use(_x);
|
||||
var _y = ([
|
||||
var x_6 = 1;
|
||||
use(x_6);
|
||||
var y_6 = ([
|
||||
1
|
||||
])[0];
|
||||
use(_y);
|
||||
var _z = ({
|
||||
use(y_6);
|
||||
var z_6 = ({
|
||||
a: 1
|
||||
}).a;
|
||||
use(_z);
|
||||
use(z_6);
|
||||
}
|
||||
use(x);
|
||||
use(y);
|
||||
use(z);
|
||||
})(M4 || (M4 = {}));
|
||||
function foo3() {
|
||||
for (var _x = void 0;;) {
|
||||
use(_x);
|
||||
for (var x_7 = void 0;;) {
|
||||
use(x_7);
|
||||
}
|
||||
for (var _y = ([])[0];;) {
|
||||
use(_y);
|
||||
for (var y_7 = ([])[0];;) {
|
||||
use(y_7);
|
||||
}
|
||||
for (var _z = ({
|
||||
for (var z_7 = ({
|
||||
a: 1
|
||||
}).a;;) {
|
||||
use(_z);
|
||||
use(z_7);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo4() {
|
||||
for (var _x = 1;;) {
|
||||
use(_x);
|
||||
for (var x_8 = 1;;) {
|
||||
use(x_8);
|
||||
}
|
||||
for (var _y = ([])[0];;) {
|
||||
use(_y);
|
||||
for (var y_8 = ([])[0];;) {
|
||||
use(y_8);
|
||||
}
|
||||
for (var _z = ({
|
||||
for (var z_8 = ({
|
||||
a: 1
|
||||
}).a;;) {
|
||||
use(_z);
|
||||
use(z_8);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo5() {
|
||||
for (var _x in []) {
|
||||
use(_x);
|
||||
for (var x_9 in []) {
|
||||
use(x_9);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo6() {
|
||||
for (var _x in []) {
|
||||
use(_x);
|
||||
for (var x_10 in []) {
|
||||
use(x_10);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo7() {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var _x = _a[_i];
|
||||
use(_x);
|
||||
var x_11 = _a[_i];
|
||||
use(x_11);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo8() {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var _x = _a[_i][0];
|
||||
use(_x);
|
||||
var x_12 = _a[_i][0];
|
||||
use(x_12);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo9() {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var _x = _a[_i].a;
|
||||
use(_x);
|
||||
var x_13 = _a[_i].a;
|
||||
use(x_13);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo10() {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var _x = _a[_i];
|
||||
use(_x);
|
||||
var x_14 = _a[_i];
|
||||
use(x_14);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo11() {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var _x = _a[_i][0];
|
||||
use(_x);
|
||||
var x_15 = _a[_i][0];
|
||||
use(x_15);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
function foo12() {
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var _x = _a[_i].a;
|
||||
use(_x);
|
||||
var x_16 = _a[_i].a;
|
||||
use(x_16);
|
||||
}
|
||||
use(x);
|
||||
}
|
||||
|
||||
@@ -70,54 +70,54 @@ for (const x of []) {
|
||||
//// [downlevelLetConst17.js]
|
||||
'use strict';
|
||||
var x;
|
||||
for (var _x = 10;;) {
|
||||
use(_x);
|
||||
for (var x_1 = 10;;) {
|
||||
use(x_1);
|
||||
}
|
||||
use(x);
|
||||
for (var _x_1 = 10;;) {
|
||||
use(_x_1);
|
||||
for (var x_2 = 10;;) {
|
||||
use(x_2);
|
||||
}
|
||||
for (;;) {
|
||||
var _x_2 = 10;
|
||||
use(_x_2);
|
||||
_x_2 = 1;
|
||||
var x_3 = 10;
|
||||
use(x_3);
|
||||
x_3 = 1;
|
||||
}
|
||||
for (;;) {
|
||||
var _x_3 = 10;
|
||||
use(_x_3);
|
||||
var x_4 = 10;
|
||||
use(x_4);
|
||||
}
|
||||
for (var _x_4 = void 0;;) {
|
||||
use(_x_4);
|
||||
_x_4 = 1;
|
||||
for (var x_5 = void 0;;) {
|
||||
use(x_5);
|
||||
x_5 = 1;
|
||||
}
|
||||
for (;;) {
|
||||
var _x_5 = void 0;
|
||||
use(_x_5);
|
||||
_x_5 = 1;
|
||||
var x_6 = void 0;
|
||||
use(x_6);
|
||||
x_6 = 1;
|
||||
}
|
||||
while (true) {
|
||||
var _x_6 = void 0;
|
||||
use(_x_6);
|
||||
var x_7 = void 0;
|
||||
use(x_7);
|
||||
}
|
||||
while (true) {
|
||||
var _x_7 = true;
|
||||
use(_x_7);
|
||||
var x_8 = true;
|
||||
use(x_8);
|
||||
}
|
||||
do {
|
||||
var _x_8 = void 0;
|
||||
use(_x_8);
|
||||
var x_9 = void 0;
|
||||
use(x_9);
|
||||
} while (true);
|
||||
do {
|
||||
var _x_9 = void 0;
|
||||
use(_x_9);
|
||||
var x_10 = void 0;
|
||||
use(x_10);
|
||||
} while (true);
|
||||
for (var _x_10 in []) {
|
||||
use(_x_10);
|
||||
for (var x_11 in []) {
|
||||
use(x_11);
|
||||
}
|
||||
for (var _x_11 in []) {
|
||||
use(_x_11);
|
||||
for (var x_12 in []) {
|
||||
use(x_12);
|
||||
}
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
var _x_12 = _a[_i];
|
||||
use(_x_12);
|
||||
var x_13 = _a[_i];
|
||||
use(x_13);
|
||||
}
|
||||
|
||||
@@ -38,40 +38,40 @@ for (var x = void 0;;) {
|
||||
}
|
||||
;
|
||||
}
|
||||
for (var _x = void 0;;) {
|
||||
for (var x = void 0;;) {
|
||||
function foo() {
|
||||
_x;
|
||||
x;
|
||||
}
|
||||
;
|
||||
}
|
||||
for (var _x_1 = void 0;;) {
|
||||
for (var x = void 0;;) {
|
||||
(function () {
|
||||
_x_1;
|
||||
x;
|
||||
})();
|
||||
}
|
||||
for (var _x_2 = 1;;) {
|
||||
for (var x = 1;;) {
|
||||
(function () {
|
||||
_x_2;
|
||||
x;
|
||||
})();
|
||||
}
|
||||
for (var _x_3 = void 0;;) {
|
||||
for (var x = void 0;;) {
|
||||
({
|
||||
foo: function () {
|
||||
_x_3;
|
||||
x;
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var _x_4 = void 0;;) {
|
||||
for (var x = void 0;;) {
|
||||
({
|
||||
get foo() {
|
||||
return _x_4;
|
||||
return x;
|
||||
}
|
||||
});
|
||||
}
|
||||
for (var _x_5 = void 0;;) {
|
||||
for (var x = void 0;;) {
|
||||
({
|
||||
set foo(v) {
|
||||
_x_5;
|
||||
x;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,14 +24,14 @@ use(x)
|
||||
var x;
|
||||
function a() {
|
||||
{
|
||||
var _x;
|
||||
use(_x);
|
||||
var x_1;
|
||||
use(x_1);
|
||||
function b() {
|
||||
{
|
||||
var _x_1;
|
||||
use(_x_1);
|
||||
var x_2;
|
||||
use(x_2);
|
||||
}
|
||||
use(_x);
|
||||
use(x_1);
|
||||
}
|
||||
}
|
||||
use(x);
|
||||
|
||||
@@ -56,8 +56,8 @@ var y = (function () {
|
||||
module.exports = x;
|
||||
//// [foo3.js]
|
||||
var x;
|
||||
(function (_x) {
|
||||
_x.x = 10;
|
||||
(function (x_1) {
|
||||
x_1.x = 10;
|
||||
})(x || (x = {}));
|
||||
var y = (function () {
|
||||
function y() {
|
||||
|
||||
@@ -6,14 +6,14 @@ export default class {
|
||||
|
||||
|
||||
//// [es5ExportDefaultClassDeclaration2.js]
|
||||
var _default = (function () {
|
||||
function _default() {
|
||||
var default_1 = (function () {
|
||||
function default_1() {
|
||||
}
|
||||
_default.prototype.method = function () {
|
||||
default_1.prototype.method = function () {
|
||||
};
|
||||
return _default;
|
||||
return default_1;
|
||||
})();
|
||||
module.exports = _default;
|
||||
module.exports = default_1;
|
||||
|
||||
|
||||
//// [es5ExportDefaultClassDeclaration2.d.ts]
|
||||
|
||||
@@ -6,7 +6,7 @@ export default function () { }
|
||||
//// [es5ExportDefaultFunctionDeclaration2.js]
|
||||
function () {
|
||||
}
|
||||
module.exports = _default;
|
||||
module.exports = default_1;
|
||||
|
||||
|
||||
//// [es5ExportDefaultFunctionDeclaration2.d.ts]
|
||||
|
||||
@@ -29,8 +29,8 @@ var m;
|
||||
})(m = exports.m || (exports.m = {}));
|
||||
exports.x = 10;
|
||||
//// [client.js]
|
||||
var _server = require("server");
|
||||
for (var _a in _server) if (!exports.hasOwnProperty(_a)) exports[_a] = _server[_a];
|
||||
var server_1 = require("server");
|
||||
for (var _a in server_1) if (!exports.hasOwnProperty(_a)) exports[_a] = server_1[_a];
|
||||
|
||||
|
||||
//// [server.d.ts]
|
||||
|
||||
@@ -33,17 +33,17 @@ var m;
|
||||
})(m = exports.m || (exports.m = {}));
|
||||
exports.x = 10;
|
||||
//// [client.js]
|
||||
var _server = require("server");
|
||||
exports.c = _server.c;
|
||||
var _server_1 = require("server");
|
||||
exports.c2 = _server_1.c;
|
||||
var _server_2 = require("server");
|
||||
exports.i = _server_2.i;
|
||||
exports.instantiatedModule = _server_2.m;
|
||||
var _server_3 = require("server");
|
||||
exports.uninstantiated = _server_3.uninstantiated;
|
||||
var _server_4 = require("server");
|
||||
exports.x = _server_4.x;
|
||||
var server_1 = require("server");
|
||||
exports.c = server_1.c;
|
||||
var server_2 = require("server");
|
||||
exports.c2 = server_2.c;
|
||||
var server_3 = require("server");
|
||||
exports.i = server_3.i;
|
||||
exports.instantiatedModule = server_3.m;
|
||||
var server_4 = require("server");
|
||||
exports.uninstantiated = server_4.uninstantiated;
|
||||
var server_5 = require("server");
|
||||
exports.x = server_5.x;
|
||||
|
||||
|
||||
//// [server.d.ts]
|
||||
|
||||
@@ -62,17 +62,17 @@ var x11 = (function () {
|
||||
})();
|
||||
exports.x11 = x11;
|
||||
//// [client.js]
|
||||
var _server_1 = require("server");
|
||||
exports.x1 = new _server_1.a();
|
||||
var _server_2 = require("server");
|
||||
exports.x2 = new _server_2.a11();
|
||||
var _server_3 = require("server");
|
||||
exports.x4 = new _server_3.x();
|
||||
exports.x5 = new _server_3.a12();
|
||||
var _server_4 = require("server");
|
||||
exports.x3 = new _server_4.x11();
|
||||
var _server_5 = require("server");
|
||||
exports.x6 = new _server_5.m();
|
||||
var server_1 = require("server");
|
||||
exports.x1 = new server_1.a();
|
||||
var server_2 = require("server");
|
||||
exports.x2 = new server_2.a11();
|
||||
var server_3 = require("server");
|
||||
exports.x4 = new server_3.x();
|
||||
exports.x5 = new server_3.a12();
|
||||
var server_4 = require("server");
|
||||
exports.x3 = new server_4.x11();
|
||||
var server_5 = require("server");
|
||||
exports.x6 = new server_5.m();
|
||||
|
||||
|
||||
//// [server.d.ts]
|
||||
|
||||
@@ -26,17 +26,17 @@ exports.a = 10;
|
||||
exports.x = exports.a;
|
||||
exports.m = exports.a;
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.js]
|
||||
var _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_1 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_1.a;
|
||||
var _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_2 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_2.a;
|
||||
var _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_3 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_3.x;
|
||||
var x1 = _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_3.a;
|
||||
var _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_4 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_4.x;
|
||||
var _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_5 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = _es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_5.m;
|
||||
var es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_1 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_1.a;
|
||||
var es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_2 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_2.a;
|
||||
var es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_3 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_3.x;
|
||||
var x1 = es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_3.a;
|
||||
var es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_4 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_4.x;
|
||||
var es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_5 = require("es6ImportDefaultBindingFollowedWithNamedImportInEs5_0");
|
||||
var x1 = es6ImportDefaultBindingFollowedWithNamedImportInEs5_0_5.m;
|
||||
|
||||
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImportInEs5_0.d.ts]
|
||||
|
||||
+7
-7
@@ -28,13 +28,13 @@ define(["require", "exports"], function (require, exports) {
|
||||
exports.m = exports.a;
|
||||
});
|
||||
//// [client.js]
|
||||
define(["require", "exports", "server", "server", "server", "server", "server"], function (require, exports, _server_1, _server_2, _server_3, _server_4, _server_5) {
|
||||
exports.x1 = _server_1.a;
|
||||
exports.x1 = _server_2.a;
|
||||
exports.x1 = _server_3.x;
|
||||
exports.x1 = _server_3.a;
|
||||
exports.x1 = _server_4.x;
|
||||
exports.x1 = _server_5.m;
|
||||
define(["require", "exports", "server", "server", "server", "server", "server"], function (require, exports, server_1, server_2, server_3, server_4, server_5) {
|
||||
exports.x1 = server_1.a;
|
||||
exports.x1 = server_2.a;
|
||||
exports.x1 = server_3.x;
|
||||
exports.x1 = server_3.a;
|
||||
exports.x1 = server_4.x;
|
||||
exports.x1 = server_5.m;
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -53,19 +53,19 @@ define(["require", "exports"], function (require, exports) {
|
||||
exports.aaaa = 10;
|
||||
});
|
||||
//// [es6ImportNamedImportAmd_1.js]
|
||||
define(["require", "exports", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0"], function (require, exports, _es6ImportNamedImportAmd_0_1, _es6ImportNamedImportAmd_0_2, _es6ImportNamedImportAmd_0_3, _es6ImportNamedImportAmd_0_4, _es6ImportNamedImportAmd_0_5, _es6ImportNamedImportAmd_0_6, _es6ImportNamedImportAmd_0_7, _es6ImportNamedImportAmd_0_8, _es6ImportNamedImportAmd_0_9) {
|
||||
var xxxx = _es6ImportNamedImportAmd_0_1.a;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_2.a;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_3.x;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_3.a;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_4.x;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_5.m;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_6.a1;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_6.x1;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_7.a1;
|
||||
var xxxx = _es6ImportNamedImportAmd_0_7.x1;
|
||||
var z111 = _es6ImportNamedImportAmd_0_8.z1;
|
||||
var z2 = _es6ImportNamedImportAmd_0_9.z2; // z2 shouldn't give redeclare error
|
||||
define(["require", "exports", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0", "es6ImportNamedImportAmd_0"], function (require, exports, es6ImportNamedImportAmd_0_1, es6ImportNamedImportAmd_0_2, es6ImportNamedImportAmd_0_3, es6ImportNamedImportAmd_0_4, es6ImportNamedImportAmd_0_5, es6ImportNamedImportAmd_0_6, es6ImportNamedImportAmd_0_7, es6ImportNamedImportAmd_0_8, es6ImportNamedImportAmd_0_9) {
|
||||
var xxxx = es6ImportNamedImportAmd_0_1.a;
|
||||
var xxxx = es6ImportNamedImportAmd_0_2.a;
|
||||
var xxxx = es6ImportNamedImportAmd_0_3.x;
|
||||
var xxxx = es6ImportNamedImportAmd_0_3.a;
|
||||
var xxxx = es6ImportNamedImportAmd_0_4.x;
|
||||
var xxxx = es6ImportNamedImportAmd_0_5.m;
|
||||
var xxxx = es6ImportNamedImportAmd_0_6.a1;
|
||||
var xxxx = es6ImportNamedImportAmd_0_6.x1;
|
||||
var xxxx = es6ImportNamedImportAmd_0_7.a1;
|
||||
var xxxx = es6ImportNamedImportAmd_0_7.x1;
|
||||
var z111 = es6ImportNamedImportAmd_0_8.z1;
|
||||
var z2 = es6ImportNamedImportAmd_0_9.z2; // z2 shouldn't give redeclare error
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -132,27 +132,27 @@ var aaaa1 = (function () {
|
||||
})();
|
||||
exports.aaaa1 = aaaa1;
|
||||
//// [client.js]
|
||||
var _server_1 = require("server");
|
||||
exports.xxxx = new _server_1.a();
|
||||
var _server_2 = require("server");
|
||||
exports.xxxx1 = new _server_2.a11();
|
||||
var _server_3 = require("server");
|
||||
exports.xxxx2 = new _server_3.x();
|
||||
exports.xxxx3 = new _server_3.a12();
|
||||
var _server_4 = require("server");
|
||||
exports.xxxx4 = new _server_4.x11();
|
||||
var _server_5 = require("server");
|
||||
exports.xxxx5 = new _server_5.m();
|
||||
var _server_6 = require("server");
|
||||
exports.xxxx6 = new _server_6.a1();
|
||||
exports.xxxx7 = new _server_6.x1();
|
||||
var _server_7 = require("server");
|
||||
exports.xxxx8 = new _server_7.a111();
|
||||
exports.xxxx9 = new _server_7.x111();
|
||||
var _server_8 = require("server");
|
||||
exports.z111 = new _server_8.z1();
|
||||
var _server_9 = require("server");
|
||||
exports.z2 = new _server_9.z2(); // z2 shouldn't give redeclare error
|
||||
var server_1 = require("server");
|
||||
exports.xxxx = new server_1.a();
|
||||
var server_2 = require("server");
|
||||
exports.xxxx1 = new server_2.a11();
|
||||
var server_3 = require("server");
|
||||
exports.xxxx2 = new server_3.x();
|
||||
exports.xxxx3 = new server_3.a12();
|
||||
var server_4 = require("server");
|
||||
exports.xxxx4 = new server_4.x11();
|
||||
var server_5 = require("server");
|
||||
exports.xxxx5 = new server_5.m();
|
||||
var server_6 = require("server");
|
||||
exports.xxxx6 = new server_6.a1();
|
||||
exports.xxxx7 = new server_6.x1();
|
||||
var server_7 = require("server");
|
||||
exports.xxxx8 = new server_7.a111();
|
||||
exports.xxxx9 = new server_7.x111();
|
||||
var server_8 = require("server");
|
||||
exports.z111 = new server_8.z1();
|
||||
var server_9 = require("server");
|
||||
exports.z2 = new server_9.z2(); // z2 shouldn't give redeclare error
|
||||
|
||||
|
||||
//// [server.d.ts]
|
||||
|
||||
@@ -51,27 +51,27 @@ exports.z1 = 10;
|
||||
exports.z2 = 10;
|
||||
exports.aaaa = 10;
|
||||
//// [es6ImportNamedImportInEs5_1.js]
|
||||
var _es6ImportNamedImportInEs5_0_1 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_1.a;
|
||||
var _es6ImportNamedImportInEs5_0_2 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_2.a;
|
||||
var _es6ImportNamedImportInEs5_0_3 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_3.x;
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_3.a;
|
||||
var _es6ImportNamedImportInEs5_0_4 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_4.x;
|
||||
var _es6ImportNamedImportInEs5_0_5 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_5.m;
|
||||
var _es6ImportNamedImportInEs5_0_6 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_6.a1;
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_6.x1;
|
||||
var _es6ImportNamedImportInEs5_0_7 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_7.a1;
|
||||
var xxxx = _es6ImportNamedImportInEs5_0_7.x1;
|
||||
var _es6ImportNamedImportInEs5_0_8 = require("es6ImportNamedImportInEs5_0");
|
||||
var z111 = _es6ImportNamedImportInEs5_0_8.z1;
|
||||
var _es6ImportNamedImportInEs5_0_9 = require("es6ImportNamedImportInEs5_0");
|
||||
var z2 = _es6ImportNamedImportInEs5_0_9.z2; // z2 shouldn't give redeclare error
|
||||
var es6ImportNamedImportInEs5_0_1 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = es6ImportNamedImportInEs5_0_1.a;
|
||||
var es6ImportNamedImportInEs5_0_2 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = es6ImportNamedImportInEs5_0_2.a;
|
||||
var es6ImportNamedImportInEs5_0_3 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = es6ImportNamedImportInEs5_0_3.x;
|
||||
var xxxx = es6ImportNamedImportInEs5_0_3.a;
|
||||
var es6ImportNamedImportInEs5_0_4 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = es6ImportNamedImportInEs5_0_4.x;
|
||||
var es6ImportNamedImportInEs5_0_5 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = es6ImportNamedImportInEs5_0_5.m;
|
||||
var es6ImportNamedImportInEs5_0_6 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = es6ImportNamedImportInEs5_0_6.a1;
|
||||
var xxxx = es6ImportNamedImportInEs5_0_6.x1;
|
||||
var es6ImportNamedImportInEs5_0_7 = require("es6ImportNamedImportInEs5_0");
|
||||
var xxxx = es6ImportNamedImportInEs5_0_7.a1;
|
||||
var xxxx = es6ImportNamedImportInEs5_0_7.x1;
|
||||
var es6ImportNamedImportInEs5_0_8 = require("es6ImportNamedImportInEs5_0");
|
||||
var z111 = es6ImportNamedImportInEs5_0_8.z1;
|
||||
var es6ImportNamedImportInEs5_0_9 = require("es6ImportNamedImportInEs5_0");
|
||||
var z2 = es6ImportNamedImportInEs5_0_9.z2; // z2 shouldn't give redeclare error
|
||||
|
||||
|
||||
//// [es6ImportNamedImportInEs5_0.d.ts]
|
||||
|
||||
@@ -23,8 +23,8 @@ var a;
|
||||
a.c = c;
|
||||
})(a = exports.a || (exports.a = {}));
|
||||
//// [es6ImportNamedImportInIndirectExportAssignment_1.js]
|
||||
var _es6ImportNamedImportInIndirectExportAssignment_0 = require("es6ImportNamedImportInIndirectExportAssignment_0");
|
||||
var x = _es6ImportNamedImportInIndirectExportAssignment_0.a;
|
||||
var es6ImportNamedImportInIndirectExportAssignment_0_1 = require("es6ImportNamedImportInIndirectExportAssignment_0");
|
||||
var x = es6ImportNamedImportInIndirectExportAssignment_0_1.a;
|
||||
module.exports = x;
|
||||
|
||||
|
||||
|
||||
@@ -50,27 +50,27 @@ exports.z1 = 10;
|
||||
exports.z2 = 10;
|
||||
exports.aaaa = 10;
|
||||
//// [client.js]
|
||||
var _server_1 = require("server");
|
||||
exports.xxxx = _server_1.a;
|
||||
var _server_2 = require("server");
|
||||
exports.xxxx = _server_2.a;
|
||||
var _server_3 = require("server");
|
||||
exports.xxxx = _server_3.x;
|
||||
exports.xxxx = _server_3.a;
|
||||
var _server_4 = require("server");
|
||||
exports.xxxx = _server_4.x;
|
||||
var _server_5 = require("server");
|
||||
exports.xxxx = _server_5.m;
|
||||
var _server_6 = require("server");
|
||||
exports.xxxx = _server_6.a1;
|
||||
exports.xxxx = _server_6.x1;
|
||||
var _server_7 = require("server");
|
||||
exports.xxxx = _server_7.a1;
|
||||
exports.xxxx = _server_7.x1;
|
||||
var _server_8 = require("server");
|
||||
exports.z111 = _server_8.z1;
|
||||
var _server_9 = require("server");
|
||||
exports.z2 = _server_9.z2; // z2 shouldn't give redeclare error
|
||||
var server_1 = require("server");
|
||||
exports.xxxx = server_1.a;
|
||||
var server_2 = require("server");
|
||||
exports.xxxx = server_2.a;
|
||||
var server_3 = require("server");
|
||||
exports.xxxx = server_3.x;
|
||||
exports.xxxx = server_3.a;
|
||||
var server_4 = require("server");
|
||||
exports.xxxx = server_4.x;
|
||||
var server_5 = require("server");
|
||||
exports.xxxx = server_5.m;
|
||||
var server_6 = require("server");
|
||||
exports.xxxx = server_6.a1;
|
||||
exports.xxxx = server_6.x1;
|
||||
var server_7 = require("server");
|
||||
exports.xxxx = server_7.a1;
|
||||
exports.xxxx = server_7.x1;
|
||||
var server_8 = require("server");
|
||||
exports.z111 = server_8.z1;
|
||||
var server_9 = require("server");
|
||||
exports.z2 = server_9.z2; // z2 shouldn't give redeclare error
|
||||
|
||||
|
||||
//// [server.d.ts]
|
||||
|
||||
@@ -36,8 +36,8 @@ var C2 = (function () {
|
||||
})();
|
||||
exports.C2 = C2;
|
||||
//// [client.js]
|
||||
var _server = require("server"); // Shouldnt emit I and C2 into the js file and emit C and I in .d.ts file
|
||||
exports.cVal = new _server.C();
|
||||
var server_1 = require("server"); // Shouldnt emit I and C2 into the js file and emit C and I in .d.ts file
|
||||
exports.cVal = new server_1.C();
|
||||
|
||||
|
||||
//// [server.d.ts]
|
||||
|
||||
@@ -18,5 +18,5 @@ var s: string = d; // Error
|
||||
var d = require("mod");
|
||||
var s = d; // Error
|
||||
//// [reference2.js]
|
||||
var _mod = require("mod");
|
||||
var s = _mod.default; // Error
|
||||
var mod_1 = require("mod");
|
||||
var s = mod_1.default; // Error
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
tests/cases/compiler/f2.ts(5,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/f2.ts(6,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/f2.ts(7,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/f2.ts(7,7): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
tests/cases/compiler/f2.ts(8,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/f2.ts(10,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
tests/cases/compiler/f2.ts(11,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
tests/cases/compiler/f2.ts(12,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
tests/cases/compiler/f2.ts(13,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
tests/cases/compiler/f2.ts(15,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/f2.ts(16,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/f2.ts(17,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/f2.ts(17,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
tests/cases/compiler/f2.ts(18,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/f2.ts(20,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
tests/cases/compiler/f2.ts(21,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
tests/cases/compiler/f2.ts(22,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
tests/cases/compiler/f2.ts(23,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
tests/cases/compiler/f2.ts(25,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
tests/cases/compiler/f2.ts(26,6): error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
tests/cases/compiler/f2.ts(27,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
tests/cases/compiler/f2.ts(28,6): error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
tests/cases/compiler/f2.ts(29,6): error TS2406: Invalid left-hand side in 'for...in' statement.
|
||||
tests/cases/compiler/f2.ts(29,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
tests/cases/compiler/f2.ts(30,6): error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
tests/cases/compiler/f2.ts(30,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
tests/cases/compiler/f2.ts(31,6): error TS2406: Invalid left-hand side in 'for...in' statement.
|
||||
tests/cases/compiler/f2.ts(32,6): error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
tests/cases/compiler/f2.ts(34,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
tests/cases/compiler/f2.ts(35,6): error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
tests/cases/compiler/f2.ts(36,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
tests/cases/compiler/f2.ts(37,6): error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
tests/cases/compiler/f2.ts(38,6): error TS2406: Invalid left-hand side in 'for...in' statement.
|
||||
tests/cases/compiler/f2.ts(38,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
tests/cases/compiler/f2.ts(39,6): error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
tests/cases/compiler/f2.ts(39,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
tests/cases/compiler/f2.ts(40,6): error TS2406: Invalid left-hand side in 'for...in' statement.
|
||||
tests/cases/compiler/f2.ts(41,6): error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
|
||||
|
||||
==== tests/cases/compiler/f1.ts (0 errors) ====
|
||||
export var x = 1;
|
||||
|
||||
==== tests/cases/compiler/f2.ts (38 errors) ====
|
||||
import * as stuff from 'f1';
|
||||
|
||||
var n = 'baz';
|
||||
|
||||
stuff.x = 0;
|
||||
~~~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
stuff['x'] = 1;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
stuff.blah = 2;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
~~~~
|
||||
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
stuff[n] = 3;
|
||||
~~~~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
|
||||
stuff.x++;
|
||||
~~~~~~~
|
||||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
stuff['x']++;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
stuff['blah']++;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
stuff[n]++;
|
||||
~~~~~~~~
|
||||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
|
||||
(stuff.x) = 0;
|
||||
~~~~~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
(stuff['x']) = 1;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
(stuff.blah) = 2;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
~~~~
|
||||
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
(stuff[n]) = 3;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
|
||||
(stuff.x)++;
|
||||
~~~~~~~~~
|
||||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
(stuff['x'])++;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
(stuff['blah'])++;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
(stuff[n])++;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
||||
|
||||
for (stuff.x in []) {}
|
||||
~~~~~~~
|
||||
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
for (stuff.x of []) {}
|
||||
~~~~~~~
|
||||
!!! error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
for (stuff['x'] in []) {}
|
||||
~~~~~~~~~~
|
||||
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
for (stuff['x'] of []) {}
|
||||
~~~~~~~~~~
|
||||
!!! error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
for (stuff.blah in []) {}
|
||||
~~~~~~~~~~
|
||||
!!! error TS2406: Invalid left-hand side in 'for...in' statement.
|
||||
~~~~
|
||||
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
for (stuff.blah of []) {}
|
||||
~~~~~~~~~~
|
||||
!!! error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
~~~~
|
||||
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
for (stuff[n] in []) {}
|
||||
~~~~~~~~
|
||||
!!! error TS2406: Invalid left-hand side in 'for...in' statement.
|
||||
for (stuff[n] of []) {}
|
||||
~~~~~~~~
|
||||
!!! error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
|
||||
for ((stuff.x) in []) {}
|
||||
~~~~~~~~~
|
||||
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
for ((stuff.x) of []) {}
|
||||
~~~~~~~~~
|
||||
!!! error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
for ((stuff['x']) in []) {}
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
for ((stuff['x']) of []) {}
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
for ((stuff.blah) in []) {}
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2406: Invalid left-hand side in 'for...in' statement.
|
||||
~~~~
|
||||
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
for ((stuff.blah) of []) {}
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
~~~~
|
||||
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
||||
for ((stuff[n]) in []) {}
|
||||
~~~~~~~~~~
|
||||
!!! error TS2406: Invalid left-hand side in 'for...in' statement.
|
||||
for ((stuff[n]) of []) {}
|
||||
~~~~~~~~~~
|
||||
!!! error TS2487: Invalid left-hand side in 'for...of' statement.
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
//// [tests/cases/compiler/externalModuleImmutableBindings.ts] ////
|
||||
|
||||
//// [f1.ts]
|
||||
export var x = 1;
|
||||
|
||||
//// [f2.ts]
|
||||
import * as stuff from 'f1';
|
||||
|
||||
var n = 'baz';
|
||||
|
||||
stuff.x = 0;
|
||||
stuff['x'] = 1;
|
||||
stuff.blah = 2;
|
||||
stuff[n] = 3;
|
||||
|
||||
stuff.x++;
|
||||
stuff['x']++;
|
||||
stuff['blah']++;
|
||||
stuff[n]++;
|
||||
|
||||
(stuff.x) = 0;
|
||||
(stuff['x']) = 1;
|
||||
(stuff.blah) = 2;
|
||||
(stuff[n]) = 3;
|
||||
|
||||
(stuff.x)++;
|
||||
(stuff['x'])++;
|
||||
(stuff['blah'])++;
|
||||
(stuff[n])++;
|
||||
|
||||
for (stuff.x in []) {}
|
||||
for (stuff.x of []) {}
|
||||
for (stuff['x'] in []) {}
|
||||
for (stuff['x'] of []) {}
|
||||
for (stuff.blah in []) {}
|
||||
for (stuff.blah of []) {}
|
||||
for (stuff[n] in []) {}
|
||||
for (stuff[n] of []) {}
|
||||
|
||||
for ((stuff.x) in []) {}
|
||||
for ((stuff.x) of []) {}
|
||||
for ((stuff['x']) in []) {}
|
||||
for ((stuff['x']) of []) {}
|
||||
for ((stuff.blah) in []) {}
|
||||
for ((stuff.blah) of []) {}
|
||||
for ((stuff[n]) in []) {}
|
||||
for ((stuff[n]) of []) {}
|
||||
|
||||
|
||||
|
||||
|
||||
//// [f1.js]
|
||||
exports.x = 1;
|
||||
//// [f2.js]
|
||||
var stuff = require('f1');
|
||||
var n = 'baz';
|
||||
stuff.x = 0;
|
||||
stuff['x'] = 1;
|
||||
stuff.blah = 2;
|
||||
stuff[n] = 3;
|
||||
stuff.x++;
|
||||
stuff['x']++;
|
||||
stuff['blah']++;
|
||||
stuff[n]++;
|
||||
(stuff.x) = 0;
|
||||
(stuff['x']) = 1;
|
||||
(stuff.blah) = 2;
|
||||
(stuff[n]) = 3;
|
||||
(stuff.x)++;
|
||||
(stuff['x'])++;
|
||||
(stuff['blah'])++;
|
||||
(stuff[n])++;
|
||||
for (stuff.x in []) {
|
||||
}
|
||||
for (var _i = 0, _a = []; _i < _a.length; _i++) {
|
||||
stuff.x = _a[_i];
|
||||
}
|
||||
for (stuff['x'] in []) {
|
||||
}
|
||||
for (var _b = 0, _c = []; _b < _c.length; _b++) {
|
||||
stuff['x'] = _c[_b];
|
||||
}
|
||||
for (stuff.blah in []) {
|
||||
}
|
||||
for (var _d = 0, _e = []; _d < _e.length; _d++) {
|
||||
stuff.blah = _e[_d];
|
||||
}
|
||||
for (stuff[n] in []) {
|
||||
}
|
||||
for (var _f = 0, _g = []; _f < _g.length; _f++) {
|
||||
stuff[n] = _g[_f];
|
||||
}
|
||||
for ((stuff.x) in []) {
|
||||
}
|
||||
for (var _h = 0, _j = []; _h < _j.length; _h++) {
|
||||
(stuff.x) = _j[_h];
|
||||
}
|
||||
for ((stuff['x']) in []) {
|
||||
}
|
||||
for (var _k = 0, _l = []; _k < _l.length; _k++) {
|
||||
(stuff['x']) = _l[_k];
|
||||
}
|
||||
for ((stuff.blah) in []) {
|
||||
}
|
||||
for (var _m = 0, _o = []; _m < _o.length; _m++) {
|
||||
(stuff.blah) = _o[_m];
|
||||
}
|
||||
for ((stuff[n]) in []) {
|
||||
}
|
||||
for (var _p = 0, _q = []; _p < _q.length; _p++) {
|
||||
(stuff[n]) = _q[_p];
|
||||
}
|
||||
@@ -754,7 +754,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
return C;
|
||||
})();
|
||||
var M;
|
||||
(function (_M) {
|
||||
(function (M_1) {
|
||||
var V;
|
||||
function F() {
|
||||
}
|
||||
@@ -844,10 +844,10 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
})(M || (M = {}));
|
||||
_M.eV;
|
||||
M_1.eV;
|
||||
function eF() {
|
||||
}
|
||||
_M.eF = eF;
|
||||
M_1.eF = eF;
|
||||
;
|
||||
var eC = (function () {
|
||||
function eC() {
|
||||
@@ -902,7 +902,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
});
|
||||
return eC;
|
||||
})();
|
||||
_M.eC = eC;
|
||||
M_1.eC = eC;
|
||||
var eM;
|
||||
(function (eM) {
|
||||
var V;
|
||||
@@ -934,7 +934,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
;
|
||||
})(eM = _M.eM || (_M.eM = {}));
|
||||
})(eM = M_1.eM || (M_1.eM = {}));
|
||||
;
|
||||
})(M || (M = {}));
|
||||
exports.eV;
|
||||
@@ -997,7 +997,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
})();
|
||||
exports.eC = eC;
|
||||
var eM;
|
||||
(function (_eM) {
|
||||
(function (eM_1) {
|
||||
var V;
|
||||
function F() {
|
||||
}
|
||||
@@ -1087,10 +1087,10 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
})(M || (M = {}));
|
||||
_eM.eV;
|
||||
eM_1.eV;
|
||||
function eF() {
|
||||
}
|
||||
_eM.eF = eF;
|
||||
eM_1.eF = eF;
|
||||
;
|
||||
var eC = (function () {
|
||||
function eC() {
|
||||
@@ -1145,7 +1145,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
});
|
||||
return eC;
|
||||
})();
|
||||
_eM.eC = eC;
|
||||
eM_1.eC = eC;
|
||||
var eM;
|
||||
(function (eM) {
|
||||
var V;
|
||||
@@ -1177,7 +1177,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
;
|
||||
})(eM = _eM.eM || (_eM.eM = {}));
|
||||
})(eM = eM_1.eM || (eM_1.eM = {}));
|
||||
;
|
||||
})(eM = exports.eM || (exports.eM = {}));
|
||||
;
|
||||
|
||||
@@ -9,8 +9,8 @@ var x = '';
|
||||
|
||||
//// [importAndVariableDeclarationConflict1.js]
|
||||
var m;
|
||||
(function (_m) {
|
||||
_m.m = '';
|
||||
(function (m_1) {
|
||||
m_1.m = '';
|
||||
})(m || (m = {}));
|
||||
var x = m.m;
|
||||
var x = '';
|
||||
|
||||
@@ -13,8 +13,8 @@ class C {
|
||||
|
||||
//// [importAndVariableDeclarationConflict2.js]
|
||||
var m;
|
||||
(function (_m) {
|
||||
_m.m = '';
|
||||
(function (m_1) {
|
||||
m_1.m = '';
|
||||
})(m || (m = {}));
|
||||
var x = m.m;
|
||||
var C = (function () {
|
||||
|
||||
@@ -9,8 +9,8 @@ import x = m.m;
|
||||
|
||||
//// [importAndVariableDeclarationConflict3.js]
|
||||
var m;
|
||||
(function (_m) {
|
||||
_m.m = '';
|
||||
(function (m_1) {
|
||||
m_1.m = '';
|
||||
})(m || (m = {}));
|
||||
var x = m.m;
|
||||
var x = m.m;
|
||||
|
||||
@@ -9,8 +9,8 @@ import x = m.m;
|
||||
|
||||
//// [importAndVariableDeclarationConflict4.js]
|
||||
var m;
|
||||
(function (_m) {
|
||||
_m.m = '';
|
||||
(function (m_1) {
|
||||
m_1.m = '';
|
||||
})(m || (m = {}));
|
||||
var x = '';
|
||||
var x = m.m;
|
||||
|
||||
@@ -18,13 +18,13 @@ module C {
|
||||
|
||||
//// [importedModuleAddToGlobal.js]
|
||||
var B;
|
||||
(function (_B) {
|
||||
(function (B_1) {
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
_B.B = B;
|
||||
B_1.B = B;
|
||||
})(B || (B = {}));
|
||||
var C;
|
||||
(function (C) {
|
||||
|
||||
@@ -19,28 +19,28 @@ if (true) {
|
||||
//// [initializePropertiesWithRenamedLet.js]
|
||||
var x0;
|
||||
if (true) {
|
||||
var _x0;
|
||||
var x0_1;
|
||||
var obj1 = {
|
||||
x0: _x0
|
||||
x0: x0_1
|
||||
};
|
||||
var obj2 = {
|
||||
x0: _x0
|
||||
x0: x0_1
|
||||
};
|
||||
}
|
||||
var x, y, z;
|
||||
if (true) {
|
||||
var _x = ({
|
||||
var x_1 = ({
|
||||
x: 0
|
||||
}).x;
|
||||
var _y = ({
|
||||
var y_1 = ({
|
||||
y: 0
|
||||
}).y;
|
||||
var _z;
|
||||
var z_1;
|
||||
(_a = {
|
||||
z: 0
|
||||
}, _z = _a.z, _a);
|
||||
}, z_1 = _a.z, _a);
|
||||
(_b = {
|
||||
z: 0
|
||||
}, _z = _b.z, _b);
|
||||
}, z_1 = _b.z, _b);
|
||||
}
|
||||
var _a, _b;
|
||||
|
||||
@@ -72,67 +72,67 @@ module schema {
|
||||
//// [isDeclarationVisibleNodeKinds.js]
|
||||
// Function types
|
||||
var schema;
|
||||
(function (_schema) {
|
||||
(function (schema_1) {
|
||||
function createValidator1(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema.createValidator1 = createValidator1;
|
||||
schema_1.createValidator1 = createValidator1;
|
||||
})(schema || (schema = {}));
|
||||
// Constructor types
|
||||
var schema;
|
||||
(function (_schema_1) {
|
||||
(function (schema_2) {
|
||||
function createValidator2(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema_1.createValidator2 = createValidator2;
|
||||
schema_2.createValidator2 = createValidator2;
|
||||
})(schema || (schema = {}));
|
||||
// union types
|
||||
var schema;
|
||||
(function (_schema_2) {
|
||||
(function (schema_3) {
|
||||
function createValidator3(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema_2.createValidator3 = createValidator3;
|
||||
schema_3.createValidator3 = createValidator3;
|
||||
})(schema || (schema = {}));
|
||||
// Array types
|
||||
var schema;
|
||||
(function (_schema_3) {
|
||||
(function (schema_4) {
|
||||
function createValidator4(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema_3.createValidator4 = createValidator4;
|
||||
schema_4.createValidator4 = createValidator4;
|
||||
})(schema || (schema = {}));
|
||||
// TypeLiterals
|
||||
var schema;
|
||||
(function (_schema_4) {
|
||||
(function (schema_5) {
|
||||
function createValidator5(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema_4.createValidator5 = createValidator5;
|
||||
schema_5.createValidator5 = createValidator5;
|
||||
})(schema || (schema = {}));
|
||||
// Tuple types
|
||||
var schema;
|
||||
(function (_schema_5) {
|
||||
(function (schema_6) {
|
||||
function createValidator6(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema_5.createValidator6 = createValidator6;
|
||||
schema_6.createValidator6 = createValidator6;
|
||||
})(schema || (schema = {}));
|
||||
// Paren Types
|
||||
var schema;
|
||||
(function (_schema_6) {
|
||||
(function (schema_7) {
|
||||
function createValidator7(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema_6.createValidator7 = createValidator7;
|
||||
schema_7.createValidator7 = createValidator7;
|
||||
})(schema || (schema = {}));
|
||||
// Type reference
|
||||
var schema;
|
||||
(function (_schema_7) {
|
||||
(function (schema_8) {
|
||||
function createValidator8(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema_7.createValidator8 = createValidator8;
|
||||
schema_8.createValidator8 = createValidator8;
|
||||
})(schema || (schema = {}));
|
||||
var schema;
|
||||
(function (schema) {
|
||||
|
||||
@@ -34,28 +34,28 @@ var y = 20;
|
||||
var x = 10;
|
||||
var y = 20;
|
||||
{
|
||||
var _x = 1;
|
||||
var _y = 2;
|
||||
console.log(_x);
|
||||
switch (_x) {
|
||||
var x_1 = 1;
|
||||
var y_1 = 2;
|
||||
console.log(x_1);
|
||||
switch (x_1) {
|
||||
case 10:
|
||||
var _x_1 = 20;
|
||||
var x_2 = 20;
|
||||
}
|
||||
switch (_y) {
|
||||
switch (y_1) {
|
||||
case 10:
|
||||
var _y_1 = 20;
|
||||
var y_2 = 20;
|
||||
}
|
||||
}
|
||||
{
|
||||
var _x_2 = 1;
|
||||
var _y_2 = 2;
|
||||
console.log(_x_2);
|
||||
switch (_x_2) {
|
||||
var x_3 = 1;
|
||||
var y_3 = 2;
|
||||
console.log(x_3);
|
||||
switch (x_3) {
|
||||
case 10:
|
||||
var _x_3 = 20;
|
||||
var x_4 = 20;
|
||||
}
|
||||
switch (_y_2) {
|
||||
switch (y_3) {
|
||||
case 10:
|
||||
var _y_3 = 20;
|
||||
var y_4 = 20;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ function a() {
|
||||
var parent = true;
|
||||
var parent2 = true;
|
||||
function a() {
|
||||
var _parent = 1;
|
||||
var _parent2 = 2;
|
||||
var parent = 1;
|
||||
var parent2 = 2;
|
||||
function b(parent, parent2) {
|
||||
use(parent);
|
||||
use(parent2);
|
||||
|
||||
@@ -20,7 +20,7 @@ var l3, l4, l5, l6;
|
||||
var l7 = false;
|
||||
var l8 = 23;
|
||||
var l9 = 0, l10 = "", l11 = null;
|
||||
for (var _l11 in {}) {
|
||||
for (var l11_1 in {}) {
|
||||
}
|
||||
for (var l12 = 0; l12 < 9; l12++) {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
//// [letKeepNamesOfTopLevelItems.ts]
|
||||
let x;
|
||||
function foo() {
|
||||
let x;
|
||||
}
|
||||
|
||||
module A {
|
||||
let x;
|
||||
}
|
||||
|
||||
//// [letKeepNamesOfTopLevelItems.js]
|
||||
var x;
|
||||
function foo() {
|
||||
var x;
|
||||
}
|
||||
var A;
|
||||
(function (A) {
|
||||
var x;
|
||||
})(A || (A = {}));
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/letKeepNamesOfTopLevelItems.ts ===
|
||||
let x;
|
||||
>x : any
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
}
|
||||
|
||||
module A {
|
||||
>A : typeof A
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
tests/cases/compiler/letShadowedByNameInNestedScope.ts(6,9): error TS2304: Cannot find name 'console'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/letShadowedByNameInNestedScope.ts (1 errors) ====
|
||||
var x;
|
||||
function foo() {
|
||||
let x = 0;
|
||||
(function () {
|
||||
var _x = 1;
|
||||
console.log(x);
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'console'.
|
||||
})();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
//// [letShadowedByNameInNestedScope.ts]
|
||||
var x;
|
||||
function foo() {
|
||||
let x = 0;
|
||||
(function () {
|
||||
var _x = 1;
|
||||
console.log(x);
|
||||
})();
|
||||
}
|
||||
|
||||
//// [letShadowedByNameInNestedScope.js]
|
||||
var x;
|
||||
function foo() {
|
||||
var x = 0;
|
||||
(function () {
|
||||
var _x = 1;
|
||||
console.log(x);
|
||||
})();
|
||||
}
|
||||
@@ -19,10 +19,10 @@ export module X {
|
||||
var X;
|
||||
(function (X) {
|
||||
var Y;
|
||||
(function (_Y) {
|
||||
(function (Y_1) {
|
||||
var A = (function () {
|
||||
function A(Y) {
|
||||
new _Y.B();
|
||||
new Y_1.B();
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
|
||||
@@ -22,11 +22,11 @@ var my;
|
||||
})(data = my.data || (my.data = {}));
|
||||
})(my || (my = {}));
|
||||
var my;
|
||||
(function (_my) {
|
||||
(function (my_1) {
|
||||
var data;
|
||||
(function (_data) {
|
||||
(function (data_1) {
|
||||
function data(my) {
|
||||
_data.foo.buz();
|
||||
data_1.foo.buz();
|
||||
}
|
||||
})(data = _my.data || (_my.data = {}));
|
||||
})(data = my_1.data || (my_1.data = {}));
|
||||
})(my || (my = {}));
|
||||
|
||||
@@ -19,14 +19,14 @@ var my;
|
||||
})(data = my.data || (my.data = {}));
|
||||
})(my || (my = {}));
|
||||
var my;
|
||||
(function (_my) {
|
||||
(function (my_1) {
|
||||
var data;
|
||||
(function (_data) {
|
||||
(function (data_1) {
|
||||
var foo;
|
||||
(function (_foo) {
|
||||
(function (foo_1) {
|
||||
function data(my, foo) {
|
||||
_data.buz();
|
||||
data_1.buz();
|
||||
}
|
||||
})(foo = _data.foo || (_data.foo = {}));
|
||||
})(data = _my.data || (_my.data = {}));
|
||||
})(foo = data_1.foo || (data_1.foo = {}));
|
||||
})(data = my_1.data || (my_1.data = {}));
|
||||
})(my || (my = {}));
|
||||
|
||||
@@ -20,7 +20,7 @@ module superContain {
|
||||
var superContain;
|
||||
(function (superContain) {
|
||||
var contain;
|
||||
(function (_contain) {
|
||||
(function (contain_1) {
|
||||
var my;
|
||||
(function (my) {
|
||||
var buz;
|
||||
@@ -32,19 +32,19 @@ var superContain;
|
||||
data.foo = foo;
|
||||
})(data = buz.data || (buz.data = {}));
|
||||
})(buz = my.buz || (my.buz = {}));
|
||||
})(my = _contain.my || (_contain.my = {}));
|
||||
})(my = contain_1.my || (contain_1.my = {}));
|
||||
var my;
|
||||
(function (_my) {
|
||||
(function (my_1) {
|
||||
var buz;
|
||||
(function (_buz) {
|
||||
(function (buz_1) {
|
||||
var data;
|
||||
(function (_data) {
|
||||
(function (data_1) {
|
||||
function bar(contain, my, buz, data) {
|
||||
_data.foo();
|
||||
data_1.foo();
|
||||
}
|
||||
_data.bar = bar;
|
||||
})(data = _buz.data || (_buz.data = {}));
|
||||
})(buz = _my.buz || (_my.buz = {}));
|
||||
})(my = _contain.my || (_contain.my = {}));
|
||||
data_1.bar = bar;
|
||||
})(data = buz_1.data || (buz_1.data = {}));
|
||||
})(buz = my_1.buz || (my_1.buz = {}));
|
||||
})(my = contain_1.my || (contain_1.my = {}));
|
||||
})(contain = superContain.contain || (superContain.contain = {}));
|
||||
})(superContain || (superContain = {}));
|
||||
|
||||
@@ -20,7 +20,7 @@ module M.buz.plop {
|
||||
|
||||
//// [mergedModuleDeclarationCodeGen5.js]
|
||||
var M;
|
||||
(function (_M) {
|
||||
(function (M_1) {
|
||||
var buz;
|
||||
(function (buz) {
|
||||
var plop;
|
||||
@@ -32,14 +32,14 @@ var M;
|
||||
}
|
||||
plop.M = M;
|
||||
})(plop = buz.plop || (buz.plop = {}));
|
||||
})(buz = _M.buz || (_M.buz = {}));
|
||||
})(buz = M_1.buz || (M_1.buz = {}));
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (M) {
|
||||
var buz;
|
||||
(function (_buz) {
|
||||
(function (buz_1) {
|
||||
var plop;
|
||||
(function (_plop) {
|
||||
(function (plop_1) {
|
||||
function gunk() {
|
||||
}
|
||||
function buz() {
|
||||
@@ -49,17 +49,17 @@ var M;
|
||||
}
|
||||
return fudge;
|
||||
})();
|
||||
_plop.fudge = fudge;
|
||||
plop_1.fudge = fudge;
|
||||
(function (plop) {
|
||||
})(_plop.plop || (_plop.plop = {}));
|
||||
var plop = _plop.plop;
|
||||
})(plop_1.plop || (plop_1.plop = {}));
|
||||
var plop = plop_1.plop;
|
||||
// Emit these references as follows
|
||||
var v1 = gunk; // gunk
|
||||
var v2 = buz; // buz
|
||||
_plop.v3 = _plop.doom; // _plop.doom
|
||||
_plop.v4 = _plop.M; // _plop.M
|
||||
_plop.v5 = fudge; // fudge
|
||||
_plop.v6 = plop; // plop
|
||||
})(plop = _buz.plop || (_buz.plop = {}));
|
||||
plop_1.v3 = plop_1.doom; // _plop.doom
|
||||
plop_1.v4 = plop_1.M; // _plop.M
|
||||
plop_1.v5 = fudge; // fudge
|
||||
plop_1.v6 = plop; // plop
|
||||
})(plop = buz_1.plop || (buz_1.plop = {}));
|
||||
})(buz = M.buz || (M.buz = {}));
|
||||
})(M || (M = {}));
|
||||
|
||||
@@ -25,11 +25,11 @@ var Z;
|
||||
var A;
|
||||
(function (A) {
|
||||
var M;
|
||||
(function (_M) {
|
||||
(function (M_1) {
|
||||
var M = Z.M;
|
||||
function bar() {
|
||||
}
|
||||
_M.bar = bar;
|
||||
M_1.bar = bar;
|
||||
M.bar(); // Should call Z.M.bar
|
||||
})(M = A.M || (A.M = {}));
|
||||
})(A || (A = {}));
|
||||
|
||||
@@ -30,11 +30,11 @@ var Z;
|
||||
var A;
|
||||
(function (A) {
|
||||
var M;
|
||||
(function (_M) {
|
||||
(function (M_1) {
|
||||
var M = Z.M;
|
||||
function bar() {
|
||||
}
|
||||
_M.bar = bar;
|
||||
M_1.bar = bar;
|
||||
M.bar(); // Should call Z.M.bar
|
||||
})(M = A.M || (A.M = {}));
|
||||
})(A || (A = {}));
|
||||
|
||||
@@ -26,11 +26,11 @@ var Z;
|
||||
var A;
|
||||
(function (A) {
|
||||
var M;
|
||||
(function (_M) {
|
||||
(function (M_1) {
|
||||
var M = Z.M;
|
||||
function bar() {
|
||||
}
|
||||
_M.bar = bar;
|
||||
M_1.bar = bar;
|
||||
M.bar(); // Should call Z.M.bar
|
||||
})(M = A.M || (A.M = {}));
|
||||
})(A || (A = {}));
|
||||
|
||||
@@ -30,10 +30,10 @@ var Z;
|
||||
var A;
|
||||
(function (A) {
|
||||
var M;
|
||||
(function (_M) {
|
||||
(function (M_1) {
|
||||
function bar() {
|
||||
}
|
||||
_M.bar = bar;
|
||||
M_1.bar = bar;
|
||||
M.bar(); // Should call Z.M.bar
|
||||
})(M = A.M || (A.M = {}));
|
||||
})(A || (A = {}));
|
||||
|
||||
@@ -24,9 +24,9 @@ var Z;
|
||||
var A;
|
||||
(function (A) {
|
||||
var M;
|
||||
(function (_M) {
|
||||
(function (M_1) {
|
||||
function bar() {
|
||||
}
|
||||
_M.bar = bar;
|
||||
M_1.bar = bar;
|
||||
})(M = A.M || (A.M = {}));
|
||||
})(A || (A = {}));
|
||||
|
||||
@@ -66,7 +66,7 @@ var __extends = this.__extends || function (d, b) {
|
||||
d.prototype = new __();
|
||||
};
|
||||
var A;
|
||||
(function (_A) {
|
||||
(function (A_1) {
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ module D {
|
||||
|
||||
//// [nameCollision.js]
|
||||
var A;
|
||||
(function (_A_1) {
|
||||
(function (A_1) {
|
||||
// these 2 statements force an underscore before the 'A'
|
||||
// in the generated function call.
|
||||
var A = 12;
|
||||
@@ -59,7 +59,7 @@ var B;
|
||||
var A = 12;
|
||||
})(B || (B = {}));
|
||||
var B;
|
||||
(function (_B) {
|
||||
(function (B_1) {
|
||||
// re-opened module with colliding name
|
||||
// this should add an underscore.
|
||||
var B = (function () {
|
||||
@@ -69,29 +69,29 @@ var B;
|
||||
})();
|
||||
})(B || (B = {}));
|
||||
var X;
|
||||
(function (_X) {
|
||||
(function (X_1) {
|
||||
var X = 13;
|
||||
var Y;
|
||||
(function (_Y) {
|
||||
(function (Y_1) {
|
||||
var Y = 13;
|
||||
var Z;
|
||||
(function (_Z) {
|
||||
(function (Z_1) {
|
||||
var X = 12;
|
||||
var Y = 12;
|
||||
var Z = 12;
|
||||
})(Z = _Y.Z || (_Y.Z = {}));
|
||||
})(Y = _X.Y || (_X.Y = {}));
|
||||
})(Z = Y_1.Z || (Y_1.Z = {}));
|
||||
})(Y = X_1.Y || (X_1.Y = {}));
|
||||
})(X || (X = {}));
|
||||
var Y;
|
||||
(function (_Y_1) {
|
||||
(function (Y_2) {
|
||||
var Y;
|
||||
(function (_Y_2) {
|
||||
(function (Y_3) {
|
||||
(function (Y) {
|
||||
Y[Y["Red"] = 0] = "Red";
|
||||
Y[Y["Blue"] = 1] = "Blue";
|
||||
})(_Y_2.Y || (_Y_2.Y = {}));
|
||||
var Y = _Y_2.Y;
|
||||
})(Y = _Y_1.Y || (_Y_1.Y = {}));
|
||||
})(Y_3.Y || (Y_3.Y = {}));
|
||||
var Y = Y_3.Y;
|
||||
})(Y = Y_2.Y || (Y_2.Y = {}));
|
||||
})(Y || (Y = {}));
|
||||
// no collision, since interface doesn't
|
||||
// generate code.
|
||||
|
||||
@@ -39,8 +39,8 @@ var Bugs;
|
||||
}
|
||||
var result = message.replace(/\{(\d+)\}/g, function (match) {
|
||||
var rest = [];
|
||||
for (var _a = 1; _a < arguments.length; _a++) {
|
||||
rest[_a - 1] = arguments[_a];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
var index = rest[0];
|
||||
return typeof args[index] !== 'undefined' ? args[index] : match;
|
||||
|
||||
@@ -238,7 +238,7 @@ var glo_M1_public;
|
||||
glo_M1_public.v2;
|
||||
})(glo_M1_public || (glo_M1_public = {}));
|
||||
var m2;
|
||||
(function (_m2) {
|
||||
(function (m2_1) {
|
||||
var m4;
|
||||
(function (m4) {
|
||||
var a = 10;
|
||||
|
||||
@@ -566,14 +566,14 @@ var glo_im4_private_v4_private = glo_im4_private.f1();
|
||||
exports.glo_im1_public = glo_M1_public;
|
||||
exports.glo_im2_public = glo_M3_private;
|
||||
var m2;
|
||||
(function (_m2) {
|
||||
(function (m2_1) {
|
||||
var m4;
|
||||
(function (m4) {
|
||||
var a = 10;
|
||||
})(m4 || (m4 = {}));
|
||||
})(m2 || (m2 = {}));
|
||||
var m3;
|
||||
(function (_m3) {
|
||||
(function (m3_1) {
|
||||
var m4;
|
||||
(function (m4) {
|
||||
var a = 10;
|
||||
|
||||
@@ -116,7 +116,7 @@ var Sample;
|
||||
var Actions;
|
||||
(function (Actions) {
|
||||
var Thing;
|
||||
(function (_Thing_1) {
|
||||
(function (Thing_1) {
|
||||
var Find;
|
||||
(function (Find) {
|
||||
var StartFindAction = (function () {
|
||||
@@ -131,7 +131,7 @@ var Sample;
|
||||
return StartFindAction;
|
||||
})();
|
||||
Find.StartFindAction = StartFindAction;
|
||||
})(Find = _Thing_1.Find || (_Thing_1.Find = {}));
|
||||
})(Find = Thing_1.Find || (Thing_1.Find = {}));
|
||||
})(Thing = Actions.Thing || (Actions.Thing = {}));
|
||||
})(Actions = Sample.Actions || (Sample.Actions = {}));
|
||||
})(Sample || (Sample = {}));
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [recursiveClassReferenceTest.js.map]
|
||||
{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,QAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC;oBAAAC;oBAQAC,CAACA;oBANOD,+BAAKA,GAAZA;wBAAiBE,MAAMA,CAACA,IAAIA,CAACA;oBAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,kBAQ3BA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,aAAIA,KAAJA,aAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC;gBAKCC,oBAAoBA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,AADAA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA;oBAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;wBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;oBAAAA,CAACA;gBAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,aAkBtBA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAAe;IAAuFC,CAACA;IAA3CD,sCAAeA,GAAtBA;QAAmCE,MAAMA,CAACA,IAAIA,CAACA;IAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACU,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC;oBACOC,eAAoBA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA;wBAA0BI,MAAMA,CAACA,IAAIA,CAACA;oBAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,QAWjBA,CAAAA;gBAEDA;oBAA0BM,wBAAYA;oBAAtCA;wBAA0BC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,OAQhBA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBV,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"}
|
||||
{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,OAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC;oBAAAC;oBAQAC,CAACA;oBANOD,+BAAKA,GAAZA;wBAAiBE,MAAMA,CAACA,IAAIA,CAACA;oBAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,kBAQ3BA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,YAAIA,KAAJA,YAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC;gBAKCC,oBAAoBA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,AADAA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA;oBAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;wBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;oBAAAA,CAACA;gBAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,aAkBtBA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAAe;IAAuFC,CAACA;IAA3CD,sCAAeA,GAAtBA;QAAmCE,MAAMA,CAACA,IAAIA,CAACA;IAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACU,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC;oBACOC,eAAoBA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA;wBAA0BI,MAAMA,CAACA,IAAIA,CAACA;oBAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,QAWjBA,CAAAA;gBAEDA;oBAA0BM,wBAAYA;oBAAtCA;wBAA0BC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,OAQhBA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBV,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"}
|
||||
@@ -139,7 +139,7 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
2 > ^^^^
|
||||
3 > ^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^^^->
|
||||
5 > ^^^^^^^^^^^^->
|
||||
1 >.
|
||||
2 >
|
||||
3 > Thing
|
||||
@@ -159,16 +159,16 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
3 >Emitted(13, 18) Source(32, 28) + SourceIndex(0) name (Sample.Actions)
|
||||
4 >Emitted(13, 19) Source(42, 2) + SourceIndex(0) name (Sample.Actions)
|
||||
---
|
||||
>>> (function (_Thing_1) {
|
||||
>>> (function (Thing_1) {
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^^^^^^
|
||||
3 > ^^^^^^^^
|
||||
3 > ^^^^^^^
|
||||
1->
|
||||
2 >
|
||||
3 > Thing
|
||||
1->Emitted(14, 9) Source(32, 23) + SourceIndex(0) name (Sample.Actions)
|
||||
2 >Emitted(14, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions)
|
||||
3 >Emitted(14, 28) Source(32, 28) + SourceIndex(0) name (Sample.Actions)
|
||||
3 >Emitted(14, 27) Source(32, 28) + SourceIndex(0) name (Sample.Actions)
|
||||
---
|
||||
>>> var Find;
|
||||
1 >^^^^^^^^^^^^
|
||||
@@ -365,7 +365,7 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^->
|
||||
5 > ^^^^^->
|
||||
1->
|
||||
2 > StartFindAction
|
||||
3 > implements Sample.Thing.IAction {
|
||||
@@ -383,16 +383,16 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
3 >Emitted(28, 55) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find)
|
||||
4 >Emitted(28, 56) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find)
|
||||
---
|
||||
>>> })(Find = _Thing_1.Find || (_Thing_1.Find = {}));
|
||||
>>> })(Find = Thing_1.Find || (Thing_1.Find = {}));
|
||||
1->^^^^^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^
|
||||
4 > ^^^^
|
||||
5 > ^^^
|
||||
6 > ^^^^^^^^^^^^^
|
||||
7 > ^^^^^
|
||||
8 > ^^^^^^^^^^^^^
|
||||
9 > ^^^^^^^^
|
||||
6 > ^^^^^^^^^^^^
|
||||
7 > ^^^^^
|
||||
8 > ^^^^^^^^^^^^
|
||||
9 > ^^^^^^^^
|
||||
1->
|
||||
>
|
||||
2 > }
|
||||
@@ -400,28 +400,28 @@ sourceFile:recursiveClassReferenceTest.ts
|
||||
4 > Find
|
||||
5 >
|
||||
6 > Find
|
||||
7 >
|
||||
8 > Find
|
||||
9 > {
|
||||
> export class StartFindAction implements Sample.Thing.IAction {
|
||||
>
|
||||
> public getId() { return "yo"; }
|
||||
>
|
||||
> public run(Thing:Sample.Thing.ICodeThing):boolean {
|
||||
>
|
||||
> return true;
|
||||
> }
|
||||
> }
|
||||
> }
|
||||
7 >
|
||||
8 > Find
|
||||
9 > {
|
||||
> export class StartFindAction implements Sample.Thing.IAction {
|
||||
>
|
||||
> public getId() { return "yo"; }
|
||||
>
|
||||
> public run(Thing:Sample.Thing.ICodeThing):boolean {
|
||||
>
|
||||
> return true;
|
||||
> }
|
||||
> }
|
||||
> }
|
||||
1->Emitted(29, 13) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing.Find)
|
||||
2 >Emitted(29, 14) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find)
|
||||
3 >Emitted(29, 16) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
4 >Emitted(29, 20) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
5 >Emitted(29, 23) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
6 >Emitted(29, 36) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
7 >Emitted(29, 41) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
8 >Emitted(29, 54) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
9 >Emitted(29, 62) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
6 >Emitted(29, 35) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
7 >Emitted(29, 40) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
8 >Emitted(29, 52) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
9 >Emitted(29, 60) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing)
|
||||
---
|
||||
>>> })(Thing = Actions.Thing || (Actions.Thing = {}));
|
||||
1 >^^^^^^^^
|
||||
|
||||
@@ -20,8 +20,8 @@ var M;
|
||||
})();
|
||||
M.C = C;
|
||||
var C;
|
||||
(function (_C) {
|
||||
_C.C = M.C;
|
||||
(function (C_1) {
|
||||
C_1.C = M.C;
|
||||
})(C = M.C || (M.C = {}));
|
||||
;
|
||||
})(M || (M = {}));
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
|
||||
//// [shadowingViaLocalValue.js]
|
||||
{
|
||||
var _x;
|
||||
var x_1;
|
||||
{
|
||||
var x = 1;
|
||||
}
|
||||
}
|
||||
{
|
||||
var _x1;
|
||||
var x1_1;
|
||||
{
|
||||
for (var x1 = 0;;)
|
||||
;
|
||||
|
||||
@@ -12,7 +12,7 @@ if (true) {
|
||||
|
||||
//// [shadowingViaLocalValueOrBindingElement.js]
|
||||
if (true) {
|
||||
var _x;
|
||||
var x_1;
|
||||
if (true) {
|
||||
var x = 0; // Error
|
||||
var _a = ({
|
||||
|
||||
@@ -8,10 +8,10 @@ var z = bar.bar();
|
||||
|
||||
//// [thisInModuleFunction1.js]
|
||||
var bar;
|
||||
(function (_bar) {
|
||||
(function (bar_1) {
|
||||
function bar() {
|
||||
return this;
|
||||
}
|
||||
_bar.bar = bar;
|
||||
bar_1.bar = bar;
|
||||
})(bar || (bar = {}));
|
||||
var z = bar.bar();
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// @module: commonjs
|
||||
// @Filename: f1.ts
|
||||
export var x = 1;
|
||||
|
||||
// @Filename: f2.ts
|
||||
import * as stuff from 'f1';
|
||||
|
||||
var n = 'baz';
|
||||
|
||||
stuff.x = 0;
|
||||
stuff['x'] = 1;
|
||||
stuff.blah = 2;
|
||||
stuff[n] = 3;
|
||||
|
||||
stuff.x++;
|
||||
stuff['x']++;
|
||||
stuff['blah']++;
|
||||
stuff[n]++;
|
||||
|
||||
(stuff.x) = 0;
|
||||
(stuff['x']) = 1;
|
||||
(stuff.blah) = 2;
|
||||
(stuff[n]) = 3;
|
||||
|
||||
(stuff.x)++;
|
||||
(stuff['x'])++;
|
||||
(stuff['blah'])++;
|
||||
(stuff[n])++;
|
||||
|
||||
for (stuff.x in []) {}
|
||||
for (stuff.x of []) {}
|
||||
for (stuff['x'] in []) {}
|
||||
for (stuff['x'] of []) {}
|
||||
for (stuff.blah in []) {}
|
||||
for (stuff.blah of []) {}
|
||||
for (stuff[n] in []) {}
|
||||
for (stuff[n] of []) {}
|
||||
|
||||
for ((stuff.x) in []) {}
|
||||
for ((stuff.x) of []) {}
|
||||
for ((stuff['x']) in []) {}
|
||||
for ((stuff['x']) of []) {}
|
||||
for ((stuff.blah) in []) {}
|
||||
for ((stuff.blah) of []) {}
|
||||
for ((stuff[n]) in []) {}
|
||||
for ((stuff[n]) of []) {}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
let x;
|
||||
function foo() {
|
||||
let x;
|
||||
}
|
||||
|
||||
module A {
|
||||
let x;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
var x;
|
||||
function foo() {
|
||||
let x = 0;
|
||||
(function () {
|
||||
var _x = 1;
|
||||
console.log(x);
|
||||
})();
|
||||
}
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed
|
||||
edit.insert('');
|
||||
|
||||
debugger;
|
||||
goTo.marker('1');
|
||||
verify.completionListContains("multiM", "module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment");
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user