Skip to content

Commit 7e6a27f

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/TypeScript
2 parents 8497131 + dfb95b8 commit 7e6a27f

35 files changed

Lines changed: 727 additions & 657 deletions

Jakefile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ task("lint", ["build-rules"], function() {
869869
var result = lintFile(lintOptions, lintTargets[i]);
870870
if (result.failureCount > 0) {
871871
console.log(result.output);
872+
fail('Linter errors.', result.failureCount);
872873
}
873874
}
874875
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@
4040
},
4141
"scripts": {
4242
"pretest": "jake tests",
43-
"test": "jake runtests",
43+
"test": "jake runtests && npm run lint",
4444
"build": "npm run build:compiler && npm run build:tests",
4545
"build:compiler": "jake local",
4646
"build:tests": "jake tests",
4747
"clean": "jake clean",
4848
"jake": "jake",
49+
"lint": "jake lint",
4950
"setup-hooks": "node scripts/link-hooks.js"
5051
},
5152
"browser": {

src/compiler/checker.ts

Lines changed: 47 additions & 46 deletions
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ namespace ts {
470470
fileNames = map(<string[]>json["files"], s => combinePaths(basePath, s));
471471
}
472472
else {
473-
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "files", "Array"));
473+
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "files", "Array"));
474474
}
475475
}
476476
else {

src/compiler/core.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace ts {
5252
function normalizeKey(key: string) {
5353
return getCanonicalFileName(normalizeSlashes(key));
5454
}
55-
55+
5656
function clear() {
5757
files = {};
5858
}
@@ -117,7 +117,7 @@ namespace ts {
117117
return count;
118118
}
119119

120-
export function filter<T>(array: T[], f: (x: T) => boolean): T[]{
120+
export function filter<T>(array: T[], f: (x: T) => boolean): T[] {
121121
let result: T[];
122122
if (array) {
123123
result = [];
@@ -130,7 +130,7 @@ namespace ts {
130130
return result;
131131
}
132132

133-
export function map<T, U>(array: T[], f: (x: T) => U): U[]{
133+
export function map<T, U>(array: T[], f: (x: T) => U): U[] {
134134
let result: U[];
135135
if (array) {
136136
result = [];
@@ -148,7 +148,7 @@ namespace ts {
148148
return array1.concat(array2);
149149
}
150150

151-
export function deduplicate<T>(array: T[]): T[]{
151+
export function deduplicate<T>(array: T[]): T[] {
152152
let result: T[];
153153
if (array) {
154154
result = [];
@@ -486,7 +486,7 @@ namespace ts {
486486
return text1 ? Comparison.GreaterThan : Comparison.LessThan;
487487
}
488488

489-
export function sortAndDeduplicateDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]{
489+
export function sortAndDeduplicateDiagnostics(diagnostics: Diagnostic[]): Diagnostic[] {
490490
return deduplicateSortedDiagnostics(diagnostics.sort(compareDiagnostics));
491491
}
492492

@@ -795,7 +795,7 @@ namespace ts {
795795
VeryAggressive = 3,
796796
}
797797

798-
export module Debug {
798+
export namespace Debug {
799799
let currentAssertionLevel = AssertionLevel.None;
800800

801801
export function shouldAssert(level: AssertionLevel): boolean {

src/compiler/declarationEmitter.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ namespace ts {
180180
let nodeToCheck: Node;
181181
if (declaration.kind === SyntaxKind.VariableDeclaration) {
182182
nodeToCheck = declaration.parent.parent;
183-
} else if (declaration.kind === SyntaxKind.NamedImports || declaration.kind === SyntaxKind.ImportSpecifier || declaration.kind === SyntaxKind.ImportClause) {
183+
}
184+
else if (declaration.kind === SyntaxKind.NamedImports || declaration.kind === SyntaxKind.ImportSpecifier || declaration.kind === SyntaxKind.ImportClause) {
184185
Debug.fail("We should be getting ImportDeclaration instead to write");
185-
} else {
186+
}
187+
else {
186188
nodeToCheck = declaration;
187189
}
188190

@@ -1082,7 +1084,7 @@ namespace ts {
10821084
// emitted: declare var c: number; // instead of declare var c:number, ;
10831085
let elements: Node[] = [];
10841086
for (let element of bindingPattern.elements) {
1085-
if (element.kind !== SyntaxKind.OmittedExpression){
1087+
if (element.kind !== SyntaxKind.OmittedExpression) {
10861088
elements.push(element);
10871089
}
10881090
}

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@
13001300
"category": "Error",
13011301
"code": 2434
13021302
},
1303-
"Ambient modules cannot be nested in other modules.": {
1303+
"Ambient modules cannot be nested in other modules or namespaces.": {
13041304
"category": "Error",
13051305
"code": 2435
13061306
},

0 commit comments

Comments
 (0)