File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1921,7 +1921,7 @@ namespace ts {
1921
1921
1922
1922
// Create a compilerHost object to allow the compiler to read and write files
1923
1923
const compilerHost : CompilerHost = {
1924
- getSourceFile : ( fileName , target ) => fileName === normalizeSlashes ( inputFileName ) ? sourceFile : undefined ,
1924
+ getSourceFile : ( fileName , target ) => fileName === normalizePath ( inputFileName ) ? sourceFile : undefined ,
1925
1925
writeFile : ( name , text , writeByteOrderMark ) => {
1926
1926
if ( fileExtensionIs ( name , ".map" ) ) {
1927
1927
Debug . assert ( sourceMapText === undefined , `Unexpected multiple source map outputs for the file '${ name } '` ) ;
Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ var x = 0;`,
277
277
it ( "Supports backslashes in file name" , ( ) => {
278
278
test ( "var x" , { expectedOutput : `"use strict";\r\nvar x;\r\n` , options : { fileName : "a\\b.ts" } } ) ;
279
279
} ) ;
280
-
280
+
281
281
it ( "transpile file as 'tsx' if 'jsx' is specified" , ( ) => {
282
282
let input = `var x = <div/>` ;
283
283
let output = `"use strict";\nvar x = React.createElement("div", null);\n` ;
@@ -286,6 +286,7 @@ var x = 0;`,
286
286
options : { compilerOptions : { jsx : JsxEmit . React , newLine : NewLineKind . LineFeed } }
287
287
} )
288
288
} ) ;
289
+
289
290
it ( "transpile .js files" , ( ) => {
290
291
const input = "const a = 10;" ;
291
292
const output = `"use strict";\nvar a = 10;\n` ;
@@ -295,5 +296,9 @@ var x = 0;`,
295
296
expectedDiagnosticCodes : [ ]
296
297
} ) ;
297
298
} )
299
+
300
+ it ( "Supports urls in file name" , ( ) => {
301
+ test ( "var x" , { expectedOutput : `"use strict";\r\nvar x;\r\n` , options : { fileName : "http://somewhere/directory//directory2/file.ts" } } ) ;
302
+ } ) ;
298
303
} ) ;
299
304
}
You can’t perform that action at this time.
0 commit comments