diff --git a/scripts/ior.ts b/scripts/ior.ts index 91580203350..374747d8439 100644 --- a/scripts/ior.ts +++ b/scripts/ior.ts @@ -64,7 +64,6 @@ module Commands { } if (path.charAt(1) === ":") { if (path.charAt(2) === directorySeparator) return 3; - return 2; } return 0; } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 23493b3087d..157a0c7fd1d 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1574,7 +1574,6 @@ namespace ts { } if (path.charCodeAt(1) === CharacterCodes.colon) { if (path.charCodeAt(2) === CharacterCodes.slash) return 3; - return 2; } // Per RFC 1738 'file' URI schema has the shape file:/// // if is omitted then it is assumed that host value is 'localhost', diff --git a/tests/baselines/reference/declarationEmitRelativeModuleError.errors.txt b/tests/baselines/reference/declarationEmitRelativeModuleError.errors.txt new file mode 100644 index 00000000000..32aea83b5e4 --- /dev/null +++ b/tests/baselines/reference/declarationEmitRelativeModuleError.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/declarationEmitRelativeModuleError.ts(5,16): error TS2436: Ambient module declaration cannot specify relative module name. + + +==== tests/cases/compiler/declarationEmitRelativeModuleError.ts (1 errors) ==== + declare module "b:block" { // <-- no error anymore + + } + + declare module "b:/block" { // <-- still an error + ~~~~~~~~~~ +!!! error TS2436: Ambient module declaration cannot specify relative module name. + + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitRelativeModuleError.js b/tests/baselines/reference/declarationEmitRelativeModuleError.js new file mode 100644 index 00000000000..e1d78ba5c03 --- /dev/null +++ b/tests/baselines/reference/declarationEmitRelativeModuleError.js @@ -0,0 +1,10 @@ +//// [declarationEmitRelativeModuleError.ts] +declare module "b:block" { // <-- no error anymore + +} + +declare module "b:/block" { // <-- still an error + +} + +//// [declarationEmitRelativeModuleError.js] diff --git a/tests/baselines/reference/declarationEmitRelativeModuleError.symbols b/tests/baselines/reference/declarationEmitRelativeModuleError.symbols new file mode 100644 index 00000000000..d07a145116a --- /dev/null +++ b/tests/baselines/reference/declarationEmitRelativeModuleError.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/declarationEmitRelativeModuleError.ts === +declare module "b:block" { // <-- no error anymore +No type information for this code. +No type information for this code.} +No type information for this code. +No type information for this code.declare module "b:/block" { // <-- still an error +No type information for this code. +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitRelativeModuleError.types b/tests/baselines/reference/declarationEmitRelativeModuleError.types new file mode 100644 index 00000000000..d07a145116a --- /dev/null +++ b/tests/baselines/reference/declarationEmitRelativeModuleError.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/declarationEmitRelativeModuleError.ts === +declare module "b:block" { // <-- no error anymore +No type information for this code. +No type information for this code.} +No type information for this code. +No type information for this code.declare module "b:/block" { // <-- still an error +No type information for this code. +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/cases/compiler/declarationEmitRelativeModuleError.ts b/tests/cases/compiler/declarationEmitRelativeModuleError.ts new file mode 100644 index 00000000000..f358e81da43 --- /dev/null +++ b/tests/cases/compiler/declarationEmitRelativeModuleError.ts @@ -0,0 +1,7 @@ +declare module "b:block" { // <-- no error anymore + +} + +declare module "b:/block" { // <-- still an error + +} \ No newline at end of file diff --git a/tests/webTestServer.ts b/tests/webTestServer.ts index 5a3b4cc5048..aff2ba0752a 100644 --- a/tests/webTestServer.ts +++ b/tests/webTestServer.ts @@ -61,7 +61,6 @@ function getRootLength(path: string): number { } if (path.charAt(1) === ":") { if (path.charAt(2) === directorySeparator) return 3; - return 2; } // Per RFC 1738 'file' URI schema has the shape file:/// // if is omitted then it is assumed that host value is 'localhost',