@@ -117,15 +117,11 @@ module Harness.Path {
117
117
}
118
118
119
119
export function filePath ( fullPath : string ) {
120
- fullPath = switchToForwardSlashes ( fullPath ) ;
120
+ fullPath = ts . normalizeSlashes ( fullPath ) ;
121
121
var components = fullPath . split ( "/" ) ;
122
122
var path : string [ ] = components . slice ( 0 , components . length - 1 ) ;
123
123
return path . join ( "/" ) + "/" ;
124
124
}
125
-
126
- export function switchToForwardSlashes ( path : string ) {
127
- return path . replace ( / \\ / g, "/" ) . replace ( / \/ \/ / g, '/' ) ;
128
- }
129
125
}
130
126
131
127
module Harness {
@@ -564,7 +560,7 @@ module Harness {
564
560
// Register input files
565
561
function register ( file : { unitName : string ; content : string ; } ) {
566
562
if ( file . content !== undefined ) {
567
- var filename = Path . switchToForwardSlashes ( file . unitName ) ;
563
+ var filename = ts . normalizeSlashes ( file . unitName ) ;
568
564
filemap [ getCanonicalFileName ( filename ) ] = ts . createSourceFile ( filename , file . content , scriptTarget , /*version:*/ "0" ) ;
569
565
}
570
566
} ;
@@ -782,7 +778,7 @@ module Harness {
782
778
var filemap : { [ name : string ] : ts . SourceFile ; } = { } ;
783
779
var register = ( file : { unitName : string ; content : string ; } ) => {
784
780
if ( file . content !== undefined ) {
785
- var filename = Path . switchToForwardSlashes ( file . unitName ) ;
781
+ var filename = ts . normalizeSlashes ( file . unitName ) ;
786
782
filemap [ getCanonicalFileName ( filename ) ] = ts . createSourceFile ( filename , file . content , options . target , /*version:*/ "0" ) ;
787
783
}
788
784
} ;
@@ -1092,7 +1088,6 @@ module Harness {
1092
1088
/** @param fileResults an array of strings for the fileName and an ITextWriter with its code */
1093
1089
constructor ( fileResults : GeneratedFile [ ] , errors : HarnessDiagnostic [ ] , public program : ts . Program ,
1094
1090
public currentDirectoryForProgram : string , private sourceMapData : ts . SourceMapData [ ] ) {
1095
- var lines : string [ ] = [ ] ;
1096
1091
1097
1092
fileResults . forEach ( emittedFile => {
1098
1093
if ( isDTS ( emittedFile . fileName ) ) {
@@ -1246,7 +1241,6 @@ module Harness {
1246
1241
1247
1242
/** Support class for baseline files */
1248
1243
export module Baseline {
1249
- var firstRun = true ;
1250
1244
1251
1245
export interface BaselineOptions {
1252
1246
LineEndingSensitive ?: boolean ;
@@ -1287,8 +1281,7 @@ module Harness {
1287
1281
IO . createDirectory ( dirName ) ;
1288
1282
fileCache [ dirName ] = true ;
1289
1283
}
1290
- var parentDir = IO . directoryName ( actualFilename ) ; // .../tests/baselines/local
1291
- var parentParentDir = IO . directoryName ( IO . directoryName ( actualFilename ) ) // .../tests/baselines
1284
+
1292
1285
// Create folders if needed
1293
1286
createDirectoryStructure ( Harness . IO . directoryName ( actualFilename ) ) ;
1294
1287
0 commit comments