mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
Merge pull request #395 from DickvdBrink/code-style
Added missing semicolons
This commit is contained in:
@@ -174,7 +174,7 @@ module ts {
|
||||
var result: Map<T> = {};
|
||||
|
||||
forEach(array, value => {
|
||||
result[makeKey(value)] = value
|
||||
result[makeKey(value)] = value;
|
||||
});
|
||||
|
||||
return result;
|
||||
|
||||
@@ -362,8 +362,8 @@ module ts {
|
||||
var output = "";
|
||||
|
||||
// We want to align our "syntax" and "examples" commands to a certain margin.
|
||||
var syntaxLength = getDiagnosticText(Diagnostics.Syntax_Colon_0, "").length
|
||||
var examplesLength = getDiagnosticText(Diagnostics.Examples_Colon_0, "").length
|
||||
var syntaxLength = getDiagnosticText(Diagnostics.Syntax_Colon_0, "").length;
|
||||
var examplesLength = getDiagnosticText(Diagnostics.Examples_Colon_0, "").length;
|
||||
var marginLength = Math.max(syntaxLength, examplesLength);
|
||||
|
||||
// Build up the syntactic skeleton.
|
||||
|
||||
@@ -635,8 +635,8 @@ module ts {
|
||||
|
||||
export interface SymbolAccessiblityResult {
|
||||
accessibility: SymbolAccessibility;
|
||||
errorSymbolName?: string // Optional symbol name that results in error
|
||||
errorModuleName?: string // If the symbol is not visibile from module, module's name
|
||||
errorSymbolName?: string; // Optional symbol name that results in error
|
||||
errorModuleName?: string; // If the symbol is not visibile from module, module's name
|
||||
}
|
||||
|
||||
export interface EmitResolver {
|
||||
|
||||
@@ -365,7 +365,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
walker.results.forEach(result => {
|
||||
var formattedLine = result.identifierName + " : " + result.type;
|
||||
if (!typeMap[file.unitName]) {
|
||||
typeMap[file.unitName] = {}
|
||||
typeMap[file.unitName] = {};
|
||||
}
|
||||
|
||||
var typeInfo = [formattedLine];
|
||||
@@ -386,7 +386,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
walker.results.forEach(result => {
|
||||
var formattedLine = result.identifierName + " : " + result.type;
|
||||
if (!typeMap[file.unitName]) {
|
||||
typeMap[file.unitName] = {}
|
||||
typeMap[file.unitName] = {};
|
||||
} else {
|
||||
typeLines.push('No type information for this code.');
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class WindowsScriptHostExec implements IExec {
|
||||
var process = shell.Exec(fileName + ' ' + cmdLineArgs.join(' '));
|
||||
} catch(e) {
|
||||
result.stderr = e.message;
|
||||
result.exitCode = 1
|
||||
result.exitCode = 1;
|
||||
handleResult(result);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ module FourSlash {
|
||||
this.assertItemInCompletionList(members.entries, symbol, type, docComment, fullSymbolName, kind);
|
||||
}
|
||||
else {
|
||||
throw new Error("Expected a member list, but none was provided")
|
||||
throw new Error("Expected a member list, but none was provided");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2040,7 +2040,7 @@ module FourSlash {
|
||||
globalOptions: opts,
|
||||
files: files,
|
||||
ranges: ranges
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
enum State {
|
||||
|
||||
@@ -107,7 +107,7 @@ module Utils {
|
||||
} else {
|
||||
return cache[key] = f.apply(this, arguments);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ module Harness {
|
||||
getCanonicalFileName: ts.getCanonicalFileName,
|
||||
useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,
|
||||
getNewLine: ()=> sys.newLine
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export class HarnessCompiler {
|
||||
@@ -1018,7 +1018,7 @@ module Harness {
|
||||
}
|
||||
}
|
||||
|
||||
var fileCache: { [idx: string]: boolean } = {}
|
||||
var fileCache: { [idx: string]: boolean } = {};
|
||||
function generateActual(actualFilename: string, generateContent: () => string): string {
|
||||
// For now this is written using TypeScript, because sys is not available when running old test cases.
|
||||
// But we need to move to sys once we have
|
||||
@@ -1083,8 +1083,8 @@ module Harness {
|
||||
var lineEndingSensitive = opts && opts.LineEndingSensitive;
|
||||
|
||||
if (!lineEndingSensitive) {
|
||||
expected = expected.replace(/\r\n?/g, '\n')
|
||||
actual = actual.replace(/\r\n?/g, '\n')
|
||||
expected = expected.replace(/\r\n?/g, '\n');
|
||||
actual = actual.replace(/\r\n?/g, '\n');
|
||||
}
|
||||
|
||||
return { expected: expected, actual: actual };
|
||||
|
||||
@@ -91,7 +91,7 @@ module Harness.LanguageService {
|
||||
}
|
||||
|
||||
class CancellationToken {
|
||||
public static None: CancellationToken = new CancellationToken(null)
|
||||
public static None: CancellationToken = new CancellationToken(null);
|
||||
|
||||
constructor(private cancellationToken: ts.CancellationToken) {
|
||||
}
|
||||
@@ -283,7 +283,7 @@ module Harness.LanguageService {
|
||||
|
||||
/** Parse a file on disk given its fileName */
|
||||
public parseFile(fileName: string) {
|
||||
var sourceText = TypeScript.ScriptSnapshot.fromString(Harness.IO.readFile(fileName))
|
||||
var sourceText = TypeScript.ScriptSnapshot.fromString(Harness.IO.readFile(fileName));
|
||||
return this.parseSourceText(fileName, sourceText);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ var mytestconfig = 'mytest.config';
|
||||
var testconfig = 'test.config';
|
||||
var testConfigFile =
|
||||
Harness.IO.fileExists(mytestconfig) ? Harness.IO.readFile(mytestconfig) :
|
||||
(Harness.IO.fileExists(testconfig) ? Harness.IO.readFile(testconfig) : '')
|
||||
(Harness.IO.fileExists(testconfig) ? Harness.IO.readFile(testconfig) : '');
|
||||
|
||||
if (testConfigFile !== '') {
|
||||
// TODO: not sure why this is crashing mocha
|
||||
|
||||
@@ -36,7 +36,7 @@ module TypeScript.Services {
|
||||
if (start(currentToken) === position) {
|
||||
var closingBraceKind = BraceMatcher.getMatchingCloseBraceTokenKind(currentToken);
|
||||
if (closingBraceKind !== null) {
|
||||
var parentElement = currentToken.parent
|
||||
var parentElement = currentToken.parent;
|
||||
var currentPosition = fullStart(currentToken.parent);
|
||||
for (var i = 0, n = childCount(parentElement); i < n; i++) {
|
||||
var element = childAt(parentElement, i);
|
||||
@@ -87,7 +87,7 @@ module TypeScript.Services {
|
||||
var element = positionedElement !== null && positionedElement;
|
||||
switch (element.kind()) {
|
||||
case TypeScript.SyntaxKind.OpenBraceToken:
|
||||
return TypeScript.SyntaxKind.CloseBraceToken
|
||||
return TypeScript.SyntaxKind.CloseBraceToken;
|
||||
case TypeScript.SyntaxKind.OpenParenToken:
|
||||
return TypeScript.SyntaxKind.CloseParenToken;
|
||||
case TypeScript.SyntaxKind.OpenBracketToken:
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
///<reference path='references.ts' />
|
||||
|
||||
module TypeScript {
|
||||
var proto = "__proto__"
|
||||
var proto = "__proto__";
|
||||
|
||||
class BlockIntrinsics<T> {
|
||||
public prototype: T = undefined;
|
||||
|
||||
@@ -155,7 +155,7 @@ module TypeScript {
|
||||
|
||||
config.name = name;
|
||||
config.short = short;
|
||||
config.flag = true
|
||||
config.flag = true;
|
||||
|
||||
this.options.push(config);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ module TypeScript {
|
||||
var noDefaultLib = false;
|
||||
var diagnostics: Diagnostic[] = [];
|
||||
var referencedFiles: IFileReference[] = [];
|
||||
var lineMap = text.lineMap()
|
||||
var lineMap = text.lineMap();
|
||||
|
||||
for (var i = 0, n = leadingTrivia.count(); i < n; i++) {
|
||||
var trivia = leadingTrivia.syntaxTriviaAt(i);
|
||||
|
||||
@@ -94,9 +94,9 @@ module TypeScript {
|
||||
var expectedAst = this.mappingLevel.pop();
|
||||
if (ast !== expectedAst) {
|
||||
var expectedAstInfo: any = (<any>expectedAst).kind ? SyntaxKind[(<any>expectedAst).kind] : [expectedAst.start(), expectedAst.end()];
|
||||
var astInfo: any = (<any>ast).kind ? SyntaxKind[(<any>ast).kind] : [ast.start(), ast.end()]
|
||||
var astInfo: any = (<any>ast).kind ? SyntaxKind[(<any>ast).kind] : [ast.start(), ast.end()];
|
||||
Debug.fail(
|
||||
"Provided ast is not the expected ISyntaxElement, Expected: " + expectedAstInfo + " Given: " + astInfo)
|
||||
"Provided ast is not the expected ISyntaxElement, Expected: " + expectedAstInfo + " Given: " + astInfo);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ module TypeScript {
|
||||
|
||||
export class CancellationToken {
|
||||
|
||||
public static None: CancellationToken = new CancellationToken(null)
|
||||
public static None: CancellationToken = new CancellationToken(null);
|
||||
|
||||
constructor(private cancellationToken: ICancellationToken) {
|
||||
}
|
||||
@@ -237,7 +237,7 @@ module TypeScript {
|
||||
};
|
||||
});
|
||||
documents.sort((x, y) => y.refCount - x.refCount);
|
||||
return { bucket: name, documents: documents }
|
||||
return { bucket: name, documents: documents };
|
||||
});
|
||||
return JSON.stringify(bucketInfoArray, null, 2);
|
||||
}
|
||||
@@ -705,7 +705,7 @@ module TypeScript {
|
||||
//
|
||||
|
||||
public getSyntacticDiagnostics(fileName: string): Diagnostic[] {
|
||||
fileName = TypeScript.switchToForwardSlashes(fileName)
|
||||
fileName = TypeScript.switchToForwardSlashes(fileName);
|
||||
return this.getDocument(fileName).diagnostics();
|
||||
}
|
||||
|
||||
@@ -724,7 +724,7 @@ module TypeScript {
|
||||
var document = this.getDocument(fileName);
|
||||
|
||||
var startTime = (new Date()).getTime();
|
||||
PullTypeResolver.typeCheck(this.compilationSettings(), this.semanticInfoChain, document)
|
||||
PullTypeResolver.typeCheck(this.compilationSettings(), this.semanticInfoChain, document);
|
||||
var endTime = (new Date()).getTime();
|
||||
|
||||
typeCheckTime += endTime - startTime;
|
||||
@@ -1464,7 +1464,7 @@ module TypeScript {
|
||||
// shared emitter (and we'll take care of it after all the files are done.
|
||||
this._sharedEmitter = this.compiler._emitDocument(
|
||||
document, this._emitOptions,
|
||||
outputFiles => { this._current = CompileResult.fromOutputFiles(outputFiles) },
|
||||
outputFiles => { this._current = CompileResult.fromOutputFiles(outputFiles); },
|
||||
this._sharedEmitter);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ module TypeScript.Services {
|
||||
var secondSymbolDecl = secondSymbol.getDeclarations()[0];
|
||||
|
||||
var firstParentDecl = firstSymbolDecl.getParentDecl();
|
||||
var secondParentDecl = secondSymbolDecl.getParentDecl()
|
||||
var secondParentDecl = secondSymbolDecl.getParentDecl();
|
||||
|
||||
if (firstParentDecl.kind === TypeScript.PullElementKind.ObjectLiteral &&
|
||||
secondParentDecl.kind === TypeScript.PullElementKind.ObjectLiteral) {
|
||||
|
||||
@@ -22,7 +22,7 @@ module TypeScript.Services.Formatting {
|
||||
constructor(private syntaxTree: SyntaxTree, private snapshot: ITextSnapshot, private rulesProvider: RulesProvider, editorOptions: ts.EditorOptions) {
|
||||
//
|
||||
// TODO: convert to use FormattingOptions instead of EditorOptions
|
||||
this.options = new FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter)
|
||||
this.options = new FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter);
|
||||
}
|
||||
|
||||
public formatSelection(minChar: number, limChar: number): ts.TextEdit[] {
|
||||
|
||||
@@ -26,7 +26,7 @@ module TypeScript.Services.Formatting {
|
||||
}
|
||||
|
||||
static create1(left: SyntaxKind, right: SyntaxKind): RuleDescriptor {
|
||||
return RuleDescriptor.create4(Shared.TokenRange.FromToken(left), Shared.TokenRange.FromToken(right))
|
||||
return RuleDescriptor.create4(Shared.TokenRange.FromToken(left), Shared.TokenRange.FromToken(right));
|
||||
}
|
||||
|
||||
static create2(left: Shared.TokenRange, right: SyntaxKind): RuleDescriptor {
|
||||
|
||||
Reference in New Issue
Block a user