Skip to content

Commit c22a471

Browse files
Merge branch 'master' into taggedTemplates
2 parents 9880f93 + d5cfb9d commit c22a471

Some content is hidden

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

48 files changed

+956
-1606
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ build.json
3232
tests/webhost/*.d.ts
3333
tests/webhost/webtsc.js
3434
tests/*.js
35+
tests/*.js.map
3536
tests/*.d.ts
3637
*.config
3738
scripts/debug.bat

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
language: node_js
22

33
node_js:
4-
- '0.10'
4+
- '0.10'
5+
6+
sudo: false
57

68
before_script: npm install -g codeclimate-test-reporter
79

810
after_script:
9-
- cat coverage/lcov.info | codeclimate
11+
- cat coverage/lcov.info | codeclimate
1012

1113
addons:
1214
code_climate:

src/compiler/checker.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6832,7 +6832,6 @@ module ts {
68326832
return;
68336833
}
68346834

6835-
var symbol = getSymbolOfNode(signatureDeclarationNode);
68366835
// TypeScript 1.0 spec (April 2014): 3.7.2.4
68376836
// Every specialized call or construct signature in an object type must be assignable
68386837
// to at least one non-specialized call or construct signature in the same object type
@@ -8960,7 +8959,6 @@ module ts {
89608959
// parent is not source file or it is not reference to internal module
89618960
return false;
89628961
}
8963-
var symbol = getSymbolOfNode(node);
89648962
return isImportResolvedToValue(getSymbolOfNode(node));
89658963
}
89668964

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ module ts {
746746
nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext;
747747
}
748748

749-
interface ReferencePathMatchResult {
749+
export interface ReferencePathMatchResult {
750750
fileReference?: FileReference
751751
diagnostic?: DiagnosticMessage
752752
isNoDefaultLib?: boolean

src/harness/compilerRunner.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,10 @@ class CompilerBaselineRunner extends RunnerBase {
285285
typeLines.push('=== ' + file.unitName + ' ===\r\n');
286286
for (var i = 0; i < codeLines.length; i++) {
287287
var currentCodeLine = codeLines[i];
288-
var lastLine = typeLines[typeLines.length];
289288
typeLines.push(currentCodeLine + '\r\n');
290289
if (typeMap[file.unitName]) {
291290
var typeInfo = typeMap[file.unitName][i];
292291
if (typeInfo) {
293-
var leadingSpaces = '';
294292
typeInfo.forEach(ty => {
295293
typeLines.push('>' + ty + '\r\n');
296294
});

src/harness/fourslash.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,10 +2074,6 @@ module FourSlash {
20742074
}
20752075
}
20762076

2077-
private getEOF(): number {
2078-
return this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength();
2079-
}
2080-
20812077
// Get the text of the entire line the caret is currently at
20822078
private getCurrentLineContent() {
20832079
// The current caret position (in line/col terms)
@@ -2193,14 +2189,6 @@ module FourSlash {
21932189
return result;
21942190
}
21952191

2196-
private getCurrentLineNumberZeroBased() {
2197-
return this.getCurrentLineNumberOneBased() - 1;
2198-
}
2199-
2200-
private getCurrentLineNumberOneBased() {
2201-
return this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, this.currentCaretPosition).line + 1;
2202-
}
2203-
22042192
private getLineColStringAtPosition(position: number) {
22052193
var pos = this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, position);
22062194
return 'line ' + (pos.line + 1) + ', col ' + pos.character;

src/harness/fourslashRunner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FourslashRunner extends RunnerBase {
2020
});
2121

2222
this.tests.forEach((fn: string) => {
23-
fn = Harness.Path.switchToForwardSlashes(fn);
23+
fn = ts.normalizeSlashes(fn);
2424
var justName = fn.replace(/^.*[\\\/]/, '');
2525

2626
// Convert to relative path

src/harness/harness.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,11 @@ module Harness.Path {
117117
}
118118

119119
export function filePath(fullPath: string) {
120-
fullPath = switchToForwardSlashes(fullPath);
120+
fullPath = ts.normalizeSlashes(fullPath);
121121
var components = fullPath.split("/");
122122
var path: string[] = components.slice(0, components.length - 1);
123123
return path.join("/") + "/";
124124
}
125-
126-
export function switchToForwardSlashes(path: string) {
127-
return path.replace(/\\/g, "/").replace(/\/\//g, '/');
128-
}
129125
}
130126

131127
module Harness {
@@ -564,7 +560,7 @@ module Harness {
564560
// Register input files
565561
function register(file: { unitName: string; content: string; }) {
566562
if (file.content !== undefined) {
567-
var filename = Path.switchToForwardSlashes(file.unitName);
563+
var filename = ts.normalizeSlashes(file.unitName);
568564
filemap[getCanonicalFileName(filename)] = ts.createSourceFile(filename, file.content, scriptTarget, /*version:*/ "0");
569565
}
570566
};
@@ -782,7 +778,7 @@ module Harness {
782778
var filemap: { [name: string]: ts.SourceFile; } = {};
783779
var register = (file: { unitName: string; content: string; }) => {
784780
if (file.content !== undefined) {
785-
var filename = Path.switchToForwardSlashes(file.unitName);
781+
var filename = ts.normalizeSlashes(file.unitName);
786782
filemap[getCanonicalFileName(filename)] = ts.createSourceFile(filename, file.content, options.target, /*version:*/ "0");
787783
}
788784
};
@@ -1092,7 +1088,6 @@ module Harness {
10921088
/** @param fileResults an array of strings for the fileName and an ITextWriter with its code */
10931089
constructor(fileResults: GeneratedFile[], errors: HarnessDiagnostic[], public program: ts.Program,
10941090
public currentDirectoryForProgram: string, private sourceMapData: ts.SourceMapData[]) {
1095-
var lines: string[] = [];
10961091

10971092
fileResults.forEach(emittedFile => {
10981093
if (isDTS(emittedFile.fileName)) {
@@ -1246,7 +1241,6 @@ module Harness {
12461241

12471242
/** Support class for baseline files */
12481243
export module Baseline {
1249-
var firstRun = true;
12501244

12511245
export interface BaselineOptions {
12521246
LineEndingSensitive?: boolean;
@@ -1287,8 +1281,7 @@ module Harness {
12871281
IO.createDirectory(dirName);
12881282
fileCache[dirName] = true;
12891283
}
1290-
var parentDir = IO.directoryName(actualFilename); // .../tests/baselines/local
1291-
var parentParentDir = IO.directoryName(IO.directoryName(actualFilename)) // .../tests/baselines
1284+
12921285
// Create folders if needed
12931286
createDirectoryStructure(Harness.IO.directoryName(actualFilename));
12941287

src/harness/loggedIO.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ module Playback {
175175
}
176176

177177
function findResultByPath<T>(wrapper: { resolvePath(s: string): string }, logArray: { path: string; result?: T }[], expectedPath: string, defaultValue?: T): T {
178-
var normalizedName = Harness.Path.switchToForwardSlashes(expectedPath).toLowerCase();
178+
var normalizedName = ts.normalizeSlashes(expectedPath).toLowerCase();
179179
// Try to find the result through normal filename
180180
for (var i = 0; i < logArray.length; i++) {
181-
if (Harness.Path.switchToForwardSlashes(logArray[i].path).toLowerCase() === normalizedName) {
181+
if (ts.normalizeSlashes(logArray[i].path).toLowerCase() === normalizedName) {
182182
return logArray[i].result;
183183
}
184184
}
@@ -203,7 +203,7 @@ module Playback {
203203
function pathsAreEquivalent(left: string, right: string, wrapper: { resolvePath(s: string): string }) {
204204
var key = left + '-~~-' + right;
205205
function areSame(a: string, b: string) {
206-
return Harness.Path.switchToForwardSlashes(a).toLowerCase() === Harness.Path.switchToForwardSlashes(b).toLowerCase();
206+
return ts.normalizeSlashes(a).toLowerCase() === ts.normalizeSlashes(b).toLowerCase();
207207
}
208208
function check() {
209209
if (Harness.Path.getFileName(left).toLowerCase() === Harness.Path.getFileName(right).toLowerCase()) {

src/harness/rwcRunner.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module RWC {
2323
function collateOutputs(outputFiles: Harness.Compiler.GeneratedFile[], clean?: (s: string) => string) {
2424
// Collect, test, and sort the filenames
2525
function cleanName(fn: string) {
26-
var lastSlash = Harness.Path.switchToForwardSlashes(fn).lastIndexOf('/');
26+
var lastSlash = ts.normalizeSlashes(fn).lastIndexOf('/');
2727
return fn.substr(lastSlash + 1).toLowerCase();
2828
}
2929
outputFiles.sort((a, b) => cleanName(a.fileName).localeCompare(cleanName(b.fileName)));
@@ -52,7 +52,7 @@ module RWC {
5252
var compilerResult: Harness.Compiler.CompilerResult;
5353
var compilerOptions: ts.CompilerOptions;
5454
var baselineOpts: Harness.Baseline.BaselineOptions = { Subfolder: 'rwc' };
55-
var baseName = /(.*)\/(.*).json/.exec(Harness.Path.switchToForwardSlashes(jsonPath))[2];
55+
var baseName = /(.*)\/(.*).json/.exec(ts.normalizeSlashes(jsonPath))[2];
5656
// Compile .d.ts files
5757
var declFileCompilationResult: {
5858
declInputFiles: { unitName: string; content: string }[];
@@ -99,7 +99,7 @@ module RWC {
9999
}
100100

101101
ts.forEach(ioLog.filesRead, fileRead => {
102-
var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(fileRead.path));
102+
var resolvedPath = ts.normalizeSlashes(sys.resolvePath(fileRead.path));
103103
var inInputList = ts.forEach(inputFiles, inputFile=> inputFile.unitName === resolvedPath);
104104
if (!inInputList) {
105105
// Add the file to other files
@@ -117,7 +117,7 @@ module RWC {
117117
});
118118

119119
function getHarnessCompilerInputUnit(fileName: string) {
120-
var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(fileName));
120+
var resolvedPath = ts.normalizeSlashes(sys.resolvePath(fileName));
121121
try {
122122
var content = sys.readFile(resolvedPath);
123123
}

0 commit comments

Comments
 (0)