mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Treat "." and ".." as relative module names
This commit is contained in:
27
tests/baselines/reference/relativeModuleWithoutSlash.js
Normal file
27
tests/baselines/reference/relativeModuleWithoutSlash.js
Normal 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"];
|
||||
17
tests/baselines/reference/relativeModuleWithoutSlash.symbols
Normal file
17
tests/baselines/reference/relativeModuleWithoutSlash.symbols
Normal 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))
|
||||
|
||||
18
tests/baselines/reference/relativeModuleWithoutSlash.types
Normal file
18
tests/baselines/reference/relativeModuleWithoutSlash.types
Normal 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
|
||||
|
||||
10
tests/cases/compiler/relativeModuleWithoutSlash.ts
Normal file
10
tests/cases/compiler/relativeModuleWithoutSlash.ts
Normal 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;
|
||||
Reference in New Issue
Block a user