Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 48 additions & 48 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,43 +75,43 @@ module ts {

var checker: TypeChecker = {
getProgram: () => program,
getDiagnostics: getDiagnostics,
getGlobalDiagnostics: getGlobalDiagnostics,
getNodeCount: () => sum(program.getSourceFiles(), "nodeCount"),
getIdentifierCount: () => sum(program.getSourceFiles(), "identifierCount"),
getSymbolCount: () => sum(program.getSourceFiles(), "symbolCount"),
getTypeCount: () => typeCount,
checkProgram: checkProgram,
emitFiles: invokeEmitter,
getParentOfSymbol: getParentOfSymbol,
getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol,
getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol,
getPropertiesOfType: getPropertiesOfType,
getPropertyOfType: getPropertyOfType,
getSignaturesOfType: getSignaturesOfType,
getIndexTypeOfType: getIndexTypeOfType,
getReturnTypeOfSignature: getReturnTypeOfSignature,
getSymbolsInScope: getSymbolsInScope,
getSymbolInfo: getSymbolInfo,
getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol,
getTypeOfNode: getTypeOfNode,
typeToString: typeToString,
getSymbolDisplayBuilder: getSymbolDisplayBuilder,
symbolToString: symbolToString,
getAugmentedPropertiesOfType: getAugmentedPropertiesOfType,
getRootSymbols: getRootSymbols,
getContextualType: getContextualType,
getFullyQualifiedName: getFullyQualifiedName,
getResolvedSignature: getResolvedSignature,
getEnumMemberValue: getEnumMemberValue,
isValidPropertyAccess: isValidPropertyAccess,
getSignatureFromDeclaration: getSignatureFromDeclaration,
isImplementationOfOverload: isImplementationOfOverload,
getAliasedSymbol: resolveImport,
isUndefinedSymbol: symbol => symbol === undefinedSymbol,
isArgumentsSymbol: symbol => symbol === argumentsSymbol,
hasEarlyErrors: hasEarlyErrors,
isEmitBlocked: isEmitBlocked
getDiagnostics,
getGlobalDiagnostics,
checkProgram,
invokeEmitter,
getParentOfSymbol,
getNarrowedTypeOfSymbol,
getDeclaredTypeOfSymbol,
getPropertiesOfType,
getPropertyOfType,
getSignaturesOfType,
getIndexTypeOfType,
getReturnTypeOfSignature,
getSymbolsInScope,
getSymbolInfo,
getShorthandAssignmentValueSymbol,
getTypeOfNode,
typeToString,
getSymbolDisplayBuilder,
symbolToString,
getAugmentedPropertiesOfType,
getRootSymbols,
getContextualType,
getFullyQualifiedName,
getResolvedSignature,
getEnumMemberValue,
isValidPropertyAccess,
getSignatureFromDeclaration,
isImplementationOfOverload,
getAliasedSymbol: resolveImport,
hasEarlyErrors,
isEmitBlocked,
};

var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined");
Expand Down Expand Up @@ -953,7 +953,7 @@ module ts {
if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) {
return undefined;
}
return { aliasesToMakeVisible: aliasesToMakeVisible };
return { aliasesToMakeVisible };

function getIsDeclarationVisible(declaration: Declaration) {
if (!isDeclarationVisible(declaration)) {
Expand Down Expand Up @@ -9118,22 +9118,22 @@ module ts {
function invokeEmitter(targetSourceFile?: SourceFile) {
var resolver: EmitResolver = {
getProgram: () => program,
getLocalNameOfContainer: getLocalNameOfContainer,
getExpressionNamePrefix: getExpressionNamePrefix,
getExportAssignmentName: getExportAssignmentName,
isReferencedImportDeclaration: isReferencedImportDeclaration,
getNodeCheckFlags: getNodeCheckFlags,
getEnumMemberValue: getEnumMemberValue,
isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName,
hasSemanticErrors: hasSemanticErrors,
isEmitBlocked: isEmitBlocked,
isDeclarationVisible: isDeclarationVisible,
isImplementationOfOverload: isImplementationOfOverload,
writeTypeAtLocation: writeTypeAtLocation,
writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration,
isSymbolAccessible: isSymbolAccessible,
isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile,
getConstantValue: getConstantValue,
getLocalNameOfContainer,
getExpressionNamePrefix,
getExportAssignmentName,
isReferencedImportDeclaration,
getNodeCheckFlags,
getEnumMemberValue,
isTopLevelValueImportWithEntityName,
hasSemanticErrors,
isEmitBlocked,
isDeclarationVisible,
isImplementationOfOverload,
writeTypeAtLocation,
writeReturnTypeOfSignatureDeclaration,
isSymbolAccessible,
isImportDeclarationEntityNameReferenceDeclarationVisibile,
getConstantValue,
};
checkProgram();
return emitFiles(resolver, targetSourceFile);
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ module ts {

parseStrings(commandLine);
return {
options: options,
filenames: filenames,
errors: errors
options,
filenames,
errors
};

function parseStrings(args: string[]) {
Expand Down
18 changes: 9 additions & 9 deletions src/compiler/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ module ts {
}

return {
file: file,
start: start,
length: length,
file,
start,
length,

messageText: text,
category: message.category,
Expand Down Expand Up @@ -335,12 +335,12 @@ module ts {
}

return {
file: file,
start: start,
length: length,
code: code,
category: category,
messageText: messageText
file,
start,
length,
code,
category,
messageText
};
}

Expand Down
36 changes: 18 additions & 18 deletions src/compiler/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ module ts {
}
});
return {
firstAccessor: firstAccessor,
getAccessor: getAccessor,
setAccessor: setAccessor
firstAccessor,
getAccessor,
setAccessor
};
}

Expand Down Expand Up @@ -2787,7 +2787,7 @@ module ts {
Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 :
Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1;
return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: node,
typeName: node.name
};
Expand Down Expand Up @@ -2884,7 +2884,7 @@ module ts {
}

return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: node,
typeName: node.name
};
Expand Down Expand Up @@ -2949,7 +2949,7 @@ module ts {
}

return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: node,
typeName: (<Declaration>node.parent).name
};
Expand Down Expand Up @@ -3131,7 +3131,7 @@ module ts {
Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1;
}
return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: <Node>node.parameters[0],
// TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name
typeName: node.name
Expand All @@ -3153,7 +3153,7 @@ module ts {
Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0;
}
return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: <Node>node.name,
typeName: undefined
};
Expand Down Expand Up @@ -3283,7 +3283,7 @@ module ts {
}

return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: <Node>node.name || node,
};
}
Expand Down Expand Up @@ -3368,7 +3368,7 @@ module ts {
}

return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: node,
typeName: node.name
};
Expand Down Expand Up @@ -3553,22 +3553,22 @@ module ts {
var hasEmitterError = forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error);

// Check and update returnCode for syntactic and semantic
var returnCode: EmitReturnStatus;
var emitResultStatus: EmitReturnStatus;
if (isEmitBlocked) {
returnCode = EmitReturnStatus.AllOutputGenerationSkipped;
emitResultStatus = EmitReturnStatus.AllOutputGenerationSkipped;
} else if (hasEmitterError) {
returnCode = EmitReturnStatus.EmitErrorsEncountered;
emitResultStatus = EmitReturnStatus.EmitErrorsEncountered;
} else if (hasSemanticErrors && compilerOptions.declaration) {
returnCode = EmitReturnStatus.DeclarationGenerationSkipped;
emitResultStatus = EmitReturnStatus.DeclarationGenerationSkipped;
} else if (hasSemanticErrors && !compilerOptions.declaration) {
returnCode = EmitReturnStatus.JSGeneratedWithSemanticErrors;
emitResultStatus = EmitReturnStatus.JSGeneratedWithSemanticErrors;
} else {
returnCode = EmitReturnStatus.Succeeded;
emitResultStatus = EmitReturnStatus.Succeeded;
}

return {
emitResultStatus: returnCode,
errors: diagnostics,
emitResultStatus,
diagnostics,
sourceMaps: sourceMapDataList
};
}
Expand Down
31 changes: 15 additions & 16 deletions src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,13 +775,12 @@ module ts {
if (matchResult) {
var start = commentRange.pos;
var end = commentRange.end;
var fileRef = {
pos: start,
end: end,
filename: matchResult[3]
};
return {
fileReference: fileRef,
fileReference: {
pos: start,
end: end,
filename: matchResult[3]
},
isNoDefaultLib: false
};
}
Expand Down Expand Up @@ -945,11 +944,11 @@ module ts {
}

return {
addLabel: addLabel,
pushCurrentLabelSet: pushCurrentLabelSet,
pushFunctionBoundary: pushFunctionBoundary,
pop: pop,
nodeIsNestedInLabel: nodeIsNestedInLabel,
addLabel,
pushCurrentLabelSet,
pushFunctionBoundary,
pop,
nodeIsNestedInLabel,
};
})();

Expand Down Expand Up @@ -1675,8 +1674,8 @@ module ts {
}

return {
typeParameters: typeParameters,
parameters: parameters,
typeParameters,
parameters,
type: type
};
}
Expand Down Expand Up @@ -4287,9 +4286,9 @@ module ts {
}
commentRanges = undefined;
return {
referencedFiles: referencedFiles,
amdDependencies: amdDependencies,
amdModuleName: amdModuleName
referencedFiles,
amdDependencies,
amdModuleName
};
}

Expand Down
14 changes: 7 additions & 7 deletions src/compiler/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1167,13 +1167,13 @@ module ts {
hasPrecedingLineBreak: () => precedingLineBreak,
isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord,
isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord,
reScanGreaterToken: reScanGreaterToken,
reScanSlashToken: reScanSlashToken,
reScanTemplateToken: reScanTemplateToken,
scan: scan,
setText: setText,
setTextPos: setTextPos,
tryScan: tryScan,
reScanGreaterToken,
reScanSlashToken,
reScanTemplateToken,
scan,
setText,
setTextPos,
tryScan,
};
}
}
10 changes: 5 additions & 5 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ var sys: System = (function () {
}

return {
args: args,
args,
newLine: "\r\n",
useCaseSensitiveFileNames: false,
write(s: string): void {
WScript.StdOut.Write(s);
},
readFile: readFile,
writeFile: writeFile,
readFile,
writeFile,
resolvePath(path: string): string {
return fso.GetAbsolutePathName(path);
},
Expand Down Expand Up @@ -191,8 +191,8 @@ var sys: System = (function () {
// 1 is a standard descriptor for stdout
_fs.writeSync(1, s);
},
readFile: readFile,
writeFile: writeFile,
readFile,
writeFile,
watchFile: (fileName, callback) => {
// watchFile polls a file every 250ms, picking up file notifications.
_fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged);
Expand Down
Loading