Skip to content

Commit d74ab2e

Browse files
committed
Merge branch 'master' into autohoist-default
2 parents adc3f2b + ebbce6a commit d74ab2e

1,568 files changed

Lines changed: 21024 additions & 16354 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.

Jakefile.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ var serverCoreSources = [
106106
return path.join(serverDirectory, f);
107107
});
108108

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

111121
var languageServiceLibrarySources = [
@@ -365,7 +375,6 @@ file(builtGeneratedDiagnosticMessagesJSON,[generatedDiagnosticMessagesJSON], fun
365375
desc("Generates a diagnostic file in TypeScript based on an input JSON file");
366376
task("generate-diagnostics", [diagnosticInfoMapTs]);
367377

368-
369378
// Publish nightly
370379
var configureNightlyJs = path.join(scriptsDirectory, "configureNightly.js");
371380
var configureNightlyTs = path.join(scriptsDirectory, "configureNightly.ts");
@@ -909,7 +918,8 @@ function lintFileAsync(options, path, cb) {
909918

910919
var lintTargets = compilerSources
911920
.concat(harnessCoreSources)
912-
.concat(serverCoreSources);
921+
.concat(serverCoreSources)
922+
.concat(scriptSources);
913923

914924
desc("Runs tslint on the compiler sources");
915925
task("lint", ["build-rules"], function() {

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/checker.ts

Lines changed: 92 additions & 49 deletions
Large diffs are not rendered by default.

src/compiler/declarationEmitter.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ namespace ts {
357357
case SyntaxKind.SymbolKeyword:
358358
case SyntaxKind.VoidKeyword:
359359
case SyntaxKind.ThisType:
360-
case SyntaxKind.StringLiteral:
360+
case SyntaxKind.StringLiteralType:
361361
return writeTextOfNode(currentText, type);
362362
case SyntaxKind.ExpressionWithTypeArguments:
363363
return emitExpressionWithTypeArguments(<ExpressionWithTypeArguments>type);
@@ -658,7 +658,7 @@ namespace ts {
658658
}
659659
else {
660660
write("require(");
661-
writeTextOfNode(currentText, getExternalModuleImportEqualsDeclarationExpression(node));
661+
emitExternalModuleSpecifier(node);
662662
write(");");
663663
}
664664
writer.writeLine();
@@ -715,14 +715,23 @@ namespace ts {
715715
}
716716
write(" from ");
717717
}
718-
emitExternalModuleSpecifier(node.moduleSpecifier);
718+
emitExternalModuleSpecifier(node);
719719
write(";");
720720
writer.writeLine();
721721
}
722722

723-
function emitExternalModuleSpecifier(moduleSpecifier: Expression) {
724-
if (moduleSpecifier.kind === SyntaxKind.StringLiteral && isBundledEmit) {
725-
const moduleName = getExternalModuleNameFromDeclaration(host, resolver, moduleSpecifier.parent as (ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration));
723+
function emitExternalModuleSpecifier(parent: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration) {
724+
let moduleSpecifier: Node;
725+
if (parent.kind === SyntaxKind.ImportEqualsDeclaration) {
726+
const node = parent as ImportEqualsDeclaration;
727+
moduleSpecifier = getExternalModuleImportEqualsDeclarationExpression(node);
728+
}
729+
else {
730+
const node = parent as (ImportDeclaration | ExportDeclaration);
731+
moduleSpecifier = node.moduleSpecifier;
732+
}
733+
if (moduleSpecifier.kind === SyntaxKind.StringLiteral && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) {
734+
const moduleName = getExternalModuleNameFromDeclaration(host, resolver, parent);
726735
if (moduleName) {
727736
write("\"");
728737
write(moduleName);
@@ -765,7 +774,7 @@ namespace ts {
765774
}
766775
if (node.moduleSpecifier) {
767776
write(" from ");
768-
emitExternalModuleSpecifier(node.moduleSpecifier);
777+
emitExternalModuleSpecifier(node);
769778
}
770779
write(";");
771780
writer.writeLine();

src/compiler/diagnosticMessages.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@
16221622
},
16231623
"Cannot assign an abstract constructor type to a non-abstract constructor type.": {
16241624
"category": "Error",
1625-
"code":2517
1625+
"code": 2517
16261626
},
16271627
"Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions.": {
16281628
"category": "Error",
@@ -2068,6 +2068,14 @@
20682068
"category": "Error",
20692069
"code": 5056
20702070
},
2071+
"Cannot find a tsconfig.json file at the specified directory: '{0}'": {
2072+
"category": "Error",
2073+
"code": 5057
2074+
},
2075+
"The specified path does not exist: '{0}'": {
2076+
"category": "Error",
2077+
"code": 5058
2078+
},
20712079

20722080
"Concatenate and emit output to single file.": {
20732081
"category": "Message",

0 commit comments

Comments
 (0)