Skip to content

Commit 11751cd

Browse files
authored
Merge pull request #139 from Microsoft/9850
Make the global var `name` of type `never`
2 parents 84161c1 + ba02157 commit 11751cd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

TS.fsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface)=
262262
| Some comment -> Pt.printl "%s" comment
263263
| _ -> ()
264264

265-
if Option.isNone (findRemovedItem p.Name ItemKind.Property i.Name) then
265+
// Treat window.name specially because of https://github.com/Microsoft/TypeScript/issues/9850
266+
if p.Name = "name" && i.Name = "Window" && emitScope = EmitScope.All then
267+
Pt.printl "declare const name: never;"
268+
elif Option.isNone (findRemovedItem p.Name ItemKind.Property i.Name) then
266269
match findOverriddenItem p.Name ItemKind.Property i.Name with
267270
| Some p' -> emitPropertyFromJson p'
268271
| None ->

baselines/dom.generated.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14305,7 +14305,7 @@ declare var location: Location;
1430514305
declare var locationbar: BarProp;
1430614306
declare var menubar: BarProp;
1430714307
declare var msCredentials: MSCredentials;
14308-
declare var name: string;
14308+
declare const name: never;
1430914309
declare var navigator: Navigator;
1431014310
declare var offscreenBuffering: string | boolean;
1431114311
declare var onabort: (this: Window, ev: UIEvent) => any;

0 commit comments

Comments
 (0)