Treat "." and ".." as relative module names

This commit is contained in:
Andy Hanson
2016-07-12 14:54:06 -07:00
parent f9d29370b6
commit c90897ccdd
7 changed files with 102 additions and 11 deletions

View File

@@ -0,0 +1,27 @@
//// [tests/cases/compiler/relativeModuleWithoutSlash.ts] ////
//// [index.ts]
export default 0;
//// [index.ts]
export default 1;
//// [a.ts]
import parent from "..";
import here from ".";
parent + here;
//// [index.js]
"use strict";
exports.__esModule = true;
exports["default"] = 0;
//// [index.js]
"use strict";
exports.__esModule = true;
exports["default"] = 1;
//// [a.js]
"use strict";
var __1 = require("..");
var _1 = require(".");
__1["default"] + _1["default"];

View File

@@ -0,0 +1,17 @@
=== tests/cases/compiler/index.ts ===
export default 0;
No type information for this code.
No type information for this code.=== tests/cases/compiler/a/index.ts ===
export default 1;
No type information for this code.
No type information for this code.=== tests/cases/compiler/a/a.ts ===
import parent from "..";
>parent : Symbol(parent, Decl(a.ts, 0, 6))
import here from ".";
>here : Symbol(here, Decl(a.ts, 1, 6))
parent + here;
>parent : Symbol(parent, Decl(a.ts, 0, 6))
>here : Symbol(here, Decl(a.ts, 1, 6))

View File

@@ -0,0 +1,18 @@
=== tests/cases/compiler/index.ts ===
export default 0;
No type information for this code.
No type information for this code.=== tests/cases/compiler/a/index.ts ===
export default 1;
No type information for this code.
No type information for this code.=== tests/cases/compiler/a/a.ts ===
import parent from "..";
>parent : number
import here from ".";
>here : number
parent + here;
>parent + here : number
>parent : number
>here : number

View File

@@ -0,0 +1,10 @@
// @Filename: index.ts
export default 0;
// @Filename: a/index.ts
export default 1;
// @Filename: a/a.ts
import parent from "..";
import here from ".";
parent + here;