do not treat modules with '!' in names any specially
This commit is contained in:
parent
fbaba90ac9
commit
2836c17791
5 changed files with 82 additions and 4 deletions
|
@ -1034,10 +1034,6 @@ namespace ts {
|
|||
return;
|
||||
}
|
||||
|
||||
if (moduleName.indexOf("!") >= 0) {
|
||||
moduleName = moduleName.substr(0, moduleName.indexOf("!"));
|
||||
}
|
||||
|
||||
const isRelative = isExternalModuleNameRelative(moduleName);
|
||||
if (!isRelative) {
|
||||
const symbol = getSymbol(globals, "\"" + moduleName + "\"", SymbolFlags.ValueModule);
|
||||
|
|
23
tests/baselines/reference/bangInModuleName.js
Normal file
23
tests/baselines/reference/bangInModuleName.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
//// [tests/cases/compiler/bangInModuleName.ts] ////
|
||||
|
||||
//// [a.d.ts]
|
||||
|
||||
|
||||
declare module "http" {
|
||||
}
|
||||
|
||||
declare module 'intern/dojo/node!http' {
|
||||
import http = require('http');
|
||||
export = http;
|
||||
}
|
||||
|
||||
//// [a.ts]
|
||||
|
||||
/// <reference path="a.d.ts"/>
|
||||
|
||||
import * as http from 'intern/dojo/node!http';
|
||||
|
||||
//// [a.js]
|
||||
/// <reference path="a.d.ts"/>
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
});
|
21
tests/baselines/reference/bangInModuleName.symbols
Normal file
21
tests/baselines/reference/bangInModuleName.symbols
Normal file
|
@ -0,0 +1,21 @@
|
|||
=== tests/cases/compiler/a.ts ===
|
||||
|
||||
/// <reference path="a.d.ts"/>
|
||||
|
||||
import * as http from 'intern/dojo/node!http';
|
||||
>http : Symbol(http, Decl(a.ts, 3, 6))
|
||||
|
||||
=== tests/cases/compiler/a.d.ts ===
|
||||
|
||||
|
||||
declare module "http" {
|
||||
}
|
||||
|
||||
declare module 'intern/dojo/node!http' {
|
||||
import http = require('http');
|
||||
>http : Symbol(http, Decl(a.d.ts, 5, 40))
|
||||
|
||||
export = http;
|
||||
>http : Symbol(http, Decl(a.d.ts, 5, 40))
|
||||
}
|
||||
|
21
tests/baselines/reference/bangInModuleName.types
Normal file
21
tests/baselines/reference/bangInModuleName.types
Normal file
|
@ -0,0 +1,21 @@
|
|||
=== tests/cases/compiler/a.ts ===
|
||||
|
||||
/// <reference path="a.d.ts"/>
|
||||
|
||||
import * as http from 'intern/dojo/node!http';
|
||||
>http : typeof http
|
||||
|
||||
=== tests/cases/compiler/a.d.ts ===
|
||||
|
||||
|
||||
declare module "http" {
|
||||
}
|
||||
|
||||
declare module 'intern/dojo/node!http' {
|
||||
import http = require('http');
|
||||
>http : typeof http
|
||||
|
||||
export = http;
|
||||
>http : typeof http
|
||||
}
|
||||
|
17
tests/cases/compiler/bangInModuleName.ts
Normal file
17
tests/cases/compiler/bangInModuleName.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
// @module: amd
|
||||
|
||||
// @filename: a.d.ts
|
||||
|
||||
declare module "http" {
|
||||
}
|
||||
|
||||
declare module 'intern/dojo/node!http' {
|
||||
import http = require('http');
|
||||
export = http;
|
||||
}
|
||||
|
||||
// @filename: a.ts
|
||||
|
||||
/// <reference path="a.d.ts"/>
|
||||
|
||||
import * as http from 'intern/dojo/node!http';
|
Loading…
Reference in a new issue