Skip to content

Commit 322f084

Browse files
committed
Merge branch 'master' into noSourcemapNames
2 parents 9db441e + 266600d commit 322f084

2,579 files changed

Lines changed: 29765 additions & 19119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
node_modules/
22
built/*
3-
tests/cases/*.js
4-
tests/cases/*/*.js
5-
tests/cases/*/*/*.js
6-
tests/cases/*/*/*/*.js
7-
tests/cases/*/*/*/*/*.js
8-
tests/cases/*.js.map
9-
tests/cases/*/*.js.map
10-
tests/cases/*/*/*.js.map
11-
tests/cases/*/*/*/*.js.map
12-
tests/cases/*/*/*/*/*.js.map
133
tests/cases/rwc/*
144
tests/cases/test262/*
155
tests/cases/perf/*

Jakefile.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ var compilerSources = [
4040
"utilities.ts",
4141
"binder.ts",
4242
"checker.ts",
43+
"sourcemap.ts",
4344
"declarationEmitter.ts",
4445
"emitter.ts",
4546
"program.ts",
@@ -59,6 +60,7 @@ var servicesSources = [
5960
"utilities.ts",
6061
"binder.ts",
6162
"checker.ts",
63+
"sourcemap.ts",
6264
"declarationEmitter.ts",
6365
"emitter.ts",
6466
"program.ts",
@@ -106,6 +108,16 @@ var serverCoreSources = [
106108
return path.join(serverDirectory, f);
107109
});
108110

111+
var scriptSources = [
112+
"tslint/booleanTriviaRule.ts",
113+
"tslint/nextLineRule.ts",
114+
"tslint/noNullRule.ts",
115+
"tslint/preferConstRule.ts",
116+
"tslint/typeOperatorSpacingRule.ts"
117+
].map(function (f) {
118+
return path.join(scriptsDirectory, f);
119+
});
120+
109121
var serverSources = serverCoreSources.concat(servicesSources);
110122

111123
var languageServiceLibrarySources = [
@@ -365,7 +377,6 @@ file(builtGeneratedDiagnosticMessagesJSON,[generatedDiagnosticMessagesJSON], fun
365377
desc("Generates a diagnostic file in TypeScript based on an input JSON file");
366378
task("generate-diagnostics", [diagnosticInfoMapTs]);
367379

368-
369380
// Publish nightly
370381
var configureNightlyJs = path.join(scriptsDirectory, "configureNightly.js");
371382
var configureNightlyTs = path.join(scriptsDirectory, "configureNightly.ts");
@@ -466,7 +477,7 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
466477
var nodeDefinitionsFileContents = definitionFileContents + "\r\nexport = ts;";
467478
fs.writeFileSync(nodeDefinitionsFile, nodeDefinitionsFileContents);
468479

469-
// Node package definition file to be distributed without the package. Created by replacing
480+
// Node package definition file to be distributed without the package. Created by replacing
470481
// 'ts' namespace with '"typescript"' as a module.
471482
var nodeStandaloneDefinitionsFileContents = definitionFileContents.replace(/declare (namespace|module) ts/g, 'declare module "typescript"');
472483
fs.writeFileSync(nodeStandaloneDefinitionsFile, nodeStandaloneDefinitionsFileContents);
@@ -875,7 +886,7 @@ var tslintRulesOutFiles = tslintRules.map(function(p) {
875886
desc("Compiles tslint rules to js");
876887
task("build-rules", tslintRulesOutFiles);
877888
tslintRulesFiles.forEach(function(ruleFile, i) {
878-
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false, /*noOutFile*/ true, /*generateDeclarations*/ false, path.join(builtLocalDirectory, "tslint"));
889+
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false, /*noOutFile*/ true, /*generateDeclarations*/ false, path.join(builtLocalDirectory, "tslint"));
879890
});
880891

881892
function getLinterOptions() {
@@ -909,7 +920,8 @@ function lintFileAsync(options, path, cb) {
909920

910921
var lintTargets = compilerSources
911922
.concat(harnessCoreSources)
912-
.concat(serverCoreSources);
923+
.concat(serverCoreSources)
924+
.concat(scriptSources);
913925

914926
desc("Runs tslint on the compiler sources");
915927
task("lint", ["build-rules"], function() {
@@ -937,7 +949,7 @@ function lintWatchFile(filename) {
937949
if (event !== "change") {
938950
return;
939951
}
940-
952+
941953
if (!lintSemaphores[filename]) {
942954
lintSemaphores[filename] = true;
943955
lintFileAsync(getLinterOptions(), filename, function(err, result) {

scripts/tslint/typeOperatorSpacingRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export class Rule extends Lint.Rules.AbstractRule {
1313
class TypeOperatorSpacingWalker extends Lint.RuleWalker {
1414
public visitNode(node: ts.Node) {
1515
if (node.kind === ts.SyntaxKind.UnionType || node.kind === ts.SyntaxKind.IntersectionType) {
16-
let types = (<ts.UnionOrIntersectionTypeNode>node).types;
16+
const types = (<ts.UnionOrIntersectionTypeNode>node).types;
1717
let expectedStart = types[0].end + 2; // space, | or &
1818
for (let i = 1; i < types.length; i++) {
19-
let currentType = types[i];
19+
const currentType = types[i];
2020
if (expectedStart !== currentType.pos || currentType.getLeadingTriviaWidth() !== 1) {
2121
const failure = this.createFailure(currentType.pos, currentType.getWidth(), Rule.FAILURE_STRING);
2222
this.addFailure(failure);

src/compiler/binder.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ namespace ts {
196196
}
197197
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
198198
const nameExpression = (<ComputedPropertyName>node.name).expression;
199-
// treat computed property names where expression is string/numeric literal as just string/numeric literal
199+
// treat computed property names where expression is string/numeric literal as just string/numeric literal
200200
if (isStringOrNumericLiteral(nameExpression.kind)) {
201201
return (<LiteralExpression>nameExpression).text;
202202
}
@@ -457,7 +457,7 @@ namespace ts {
457457

458458
/**
459459
* Returns true if node and its subnodes were successfully traversed.
460-
* Returning false means that node was not examined and caller needs to dive into the node himself.
460+
* Returning false means that node was not examined and caller needs to dive into the node himself.
461461
*/
462462
function bindReachableStatement(node: Node): void {
463463
if (checkUnreachable(node)) {
@@ -567,7 +567,7 @@ namespace ts {
567567
}
568568

569569
function bindIfStatement(n: IfStatement): void {
570-
// denotes reachability state when entering 'thenStatement' part of the if statement:
570+
// denotes reachability state when entering 'thenStatement' part of the if statement:
571571
// i.e. if condition is false then thenStatement is unreachable
572572
const ifTrueState = n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState;
573573
// denotes reachability state when entering 'elseStatement':
@@ -1186,7 +1186,7 @@ namespace ts {
11861186
return checkStrictModePrefixUnaryExpression(<PrefixUnaryExpression>node);
11871187
case SyntaxKind.WithStatement:
11881188
return checkStrictModeWithStatement(<WithStatement>node);
1189-
case SyntaxKind.ThisKeyword:
1189+
case SyntaxKind.ThisType:
11901190
seenThisKeyword = true;
11911191
return;
11921192

@@ -1535,7 +1535,7 @@ namespace ts {
15351535

15361536
// unreachable code is reported if
15371537
// - user has explicitly asked about it AND
1538-
// - statement is in not ambient context (statements in ambient context is already an error
1538+
// - statement is in not ambient context (statements in ambient context is already an error
15391539
// so we should not report extras) AND
15401540
// - node is not variable statement OR
15411541
// - node is block scoped variable statement OR

0 commit comments

Comments
 (0)