Skip to content

Update #18576 #19702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/ior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ module Commands {
}
if (path.charAt(1) === ":") {
if (path.charAt(2) === directorySeparator) return 3;
return 2;
}
return 0;
}
Expand Down
1 change: 0 additions & 1 deletion src/compiler/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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://<host>/<path>
// if <host> is omitted then it is assumed that host value is 'localhost',
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

}
10 changes: 10 additions & 0 deletions tests/baselines/reference/declarationEmitRelativeModuleError.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//// [declarationEmitRelativeModuleError.ts]
declare module "b:block" { // <-- no error anymore

}

declare module "b:/block" { // <-- still an error

}

//// [declarationEmitRelativeModuleError.js]
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 7 additions & 0 deletions tests/cases/compiler/declarationEmitRelativeModuleError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module "b:block" { // <-- no error anymore

}

declare module "b:/block" { // <-- still an error

}
1 change: 0 additions & 1 deletion tests/webTestServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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://<host>/<path>
// if <host> is omitted then it is assumed that host value is 'localhost',
Expand Down