-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow an import of "foo.js" to be matched by a file "foo.ts"
- Loading branch information
Andy Hanson
committed
May 31, 2016
1 parent
13900aa
commit fa16a99
Showing
14 changed files
with
220 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//// [tests/cases/compiler/moduleResolution.ts] //// | ||
|
||
//// [a.ts] | ||
export default 0; | ||
|
||
// No extension: '.ts' added | ||
//// [b.ts] | ||
import a from './a'; | ||
|
||
// Matching extension | ||
//// [c.ts] | ||
import a from './a.ts'; | ||
|
||
// '.js' extension: stripped and replaced with '.ts' | ||
//// [d.ts] | ||
import a from './a.js'; | ||
|
||
//// [jquery.d.ts] | ||
declare var x: number; | ||
export default x; | ||
|
||
// No extension: '.d.ts' added | ||
//// [jquery_user_1.ts] | ||
import j from "./jquery"; | ||
|
||
// '.js' extension: stripped and replaced with '.d.ts' | ||
//// [jquery_user_1.ts] | ||
import j from "./jquery.js" | ||
|
||
|
||
//// [a.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports["default"] = 0; | ||
// No extension: '.ts' added | ||
//// [b.js] | ||
"use strict"; | ||
// Matching extension | ||
//// [c.js] | ||
"use strict"; | ||
// '.js' extension: stripped and replaced with '.ts' | ||
//// [d.js] | ||
"use strict"; | ||
//// [jquery_user_1.js] | ||
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=== tests/cases/compiler/a.ts === | ||
export default 0; | ||
No type information for this code. | ||
No type information for this code.// No extension: '.ts' added | ||
No type information for this code.=== tests/cases/compiler/b.ts === | ||
import a from './a'; | ||
>a : Symbol(a, Decl(b.ts, 0, 6)) | ||
|
||
// Matching extension | ||
=== tests/cases/compiler/c.ts === | ||
import a from './a.ts'; | ||
>a : Symbol(a, Decl(c.ts, 0, 6)) | ||
|
||
// '.js' extension: stripped and replaced with '.ts' | ||
=== tests/cases/compiler/d.ts === | ||
import a from './a.js'; | ||
>a : Symbol(a, Decl(d.ts, 0, 6)) | ||
|
||
=== tests/cases/compiler/jquery.d.ts === | ||
declare var x: number; | ||
>x : Symbol(x, Decl(jquery.d.ts, 0, 11)) | ||
|
||
export default x; | ||
>x : Symbol(x, Decl(jquery.d.ts, 0, 11)) | ||
|
||
// No extension: '.d.ts' added | ||
=== tests/cases/compiler/jquery_user_1.ts === | ||
import j from "./jquery"; | ||
>j : Symbol(j, Decl(jquery_user_1.ts, 0, 6)) | ||
|
||
// '.js' extension: stripped and replaced with '.d.ts' | ||
=== tests/cases/compiler/jquery_user_1.ts === | ||
import j from "./jquery.js" | ||
>j : Symbol(j, Decl(jquery_user_1.ts, 0, 6)) | ||
>j : Symbol(j, Decl(jquery_user_1.ts, 0, 6)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=== tests/cases/compiler/a.ts === | ||
export default 0; | ||
No type information for this code. | ||
No type information for this code.// No extension: '.ts' added | ||
No type information for this code.=== tests/cases/compiler/b.ts === | ||
import a from './a'; | ||
>a : number | ||
|
||
// Matching extension | ||
=== tests/cases/compiler/c.ts === | ||
import a from './a.ts'; | ||
>a : number | ||
|
||
// '.js' extension: stripped and replaced with '.ts' | ||
=== tests/cases/compiler/d.ts === | ||
import a from './a.js'; | ||
>a : number | ||
|
||
=== tests/cases/compiler/jquery.d.ts === | ||
declare var x: number; | ||
>x : number | ||
|
||
export default x; | ||
>x : number | ||
|
||
// No extension: '.d.ts' added | ||
=== tests/cases/compiler/jquery_user_1.ts === | ||
import j from "./jquery"; | ||
>j : number | ||
|
||
// '.js' extension: stripped and replaced with '.d.ts' | ||
=== tests/cases/compiler/jquery_user_1.ts === | ||
import j from "./jquery.js" | ||
>j : number | ||
>j : number | ||
|
12 changes: 0 additions & 12 deletions
12
tests/baselines/reference/nameWithFileExtension.errors.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
=== tests/cases/conformance/externalModules/foo_1.ts === | ||
import foo = require('./foo_0.js'); | ||
>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) | ||
|
||
var x = foo.foo + 42; | ||
>x : Symbol(x, Decl(foo_1.ts, 1, 3)) | ||
>foo.foo : Symbol(foo.foo, Decl(foo_0.ts, 0, 10)) | ||
>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) | ||
>foo : Symbol(foo.foo, Decl(foo_0.ts, 0, 10)) | ||
|
||
=== tests/cases/conformance/externalModules/foo_0.ts === | ||
export var foo = 42; | ||
>foo : Symbol(foo, Decl(foo_0.ts, 0, 10)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
=== tests/cases/conformance/externalModules/foo_1.ts === | ||
import foo = require('./foo_0.js'); | ||
>foo : typeof foo | ||
|
||
var x = foo.foo + 42; | ||
>x : number | ||
>foo.foo + 42 : number | ||
>foo.foo : number | ||
>foo : typeof foo | ||
>foo : number | ||
>42 : number | ||
|
||
=== tests/cases/conformance/externalModules/foo_0.ts === | ||
export var foo = 42; | ||
>foo : number | ||
>42 : number | ||
|
6 changes: 3 additions & 3 deletions
6
tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// @Filename: a.ts | ||
export default 0; | ||
|
||
// No extension: '.ts' added | ||
// @Filename: b.ts | ||
import a from './a'; | ||
|
||
// Matching extension | ||
// @Filename: c.ts | ||
import a from './a.ts'; | ||
|
||
// '.js' extension: stripped and replaced with '.ts' | ||
// @Filename: d.ts | ||
import a from './a.js'; | ||
|
||
// @Filename: jquery.d.ts | ||
declare var x: number; | ||
export default x; | ||
|
||
// No extension: '.d.ts' added | ||
// @Filename: jquery_user_1.ts | ||
import j from "./jquery"; | ||
|
||
// '.js' extension: stripped and replaced with '.d.ts' | ||
// @Filename: jquery_user_1.ts | ||
import j from "./jquery.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters