File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1921,7 +1921,7 @@ namespace ts {
19211921
19221922 // Create a compilerHost object to allow the compiler to read and write files
19231923 const compilerHost : CompilerHost = {
1924- getSourceFile : ( fileName , target ) => fileName === normalizeSlashes ( inputFileName ) ? sourceFile : undefined ,
1924+ getSourceFile : ( fileName , target ) => fileName === normalizePath ( inputFileName ) ? sourceFile : undefined ,
19251925 writeFile : ( name , text , writeByteOrderMark ) => {
19261926 if ( fileExtensionIs ( name , ".map" ) ) {
19271927 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;`,
277277 it ( "Supports backslashes in file name" , ( ) => {
278278 test ( "var x" , { expectedOutput : `"use strict";\r\nvar x;\r\n` , options : { fileName : "a\\b.ts" } } ) ;
279279 } ) ;
280-
280+
281281 it ( "transpile file as 'tsx' if 'jsx' is specified" , ( ) => {
282282 let input = `var x = <div/>` ;
283283 let output = `"use strict";\nvar x = React.createElement("div", null);\n` ;
@@ -286,6 +286,7 @@ var x = 0;`,
286286 options : { compilerOptions : { jsx : JsxEmit . React , newLine : NewLineKind . LineFeed } }
287287 } )
288288 } ) ;
289+
289290 it ( "transpile .js files" , ( ) => {
290291 const input = "const a = 10;" ;
291292 const output = `"use strict";\nvar a = 10;\n` ;
@@ -295,5 +296,9 @@ var x = 0;`,
295296 expectedDiagnosticCodes : [ ]
296297 } ) ;
297298 } )
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+ } ) ;
298303 } ) ;
299304}
You can’t perform that action at this time.
0 commit comments