Skip to content

Commit 3a6fe8a

Browse files
author
falsandtru
committed
Improve type safety of name global variable
1 parent fb07b70 commit 3a6fe8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

TS.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ module Emit =
924924

925925
// Treat window.name specially because of https://github.com/Microsoft/TypeScript/issues/9850
926926
if p.Name = "name" && i.Name = "Window" && emitScope = EmitScope.All then
927-
printLine "declare const name: never;"
927+
printLine "declare const name: string | undefined;"
928928
elif Option.isNone (getRemovedItemByName p.Name ItemKind.Property i.Name) then
929929
match getOverriddenItemByName p.Name ItemKind.Property i.Name with
930930
| Some p' -> emitPropertyFromJson p'

baselines/dom.generated.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14734,7 +14734,7 @@ declare var locationbar: BarProp;
1473414734
declare var menubar: BarProp;
1473514735
declare var msContentScript: ExtensionScriptApis;
1473614736
declare var msCredentials: MSCredentials;
14737-
declare const name: never;
14737+
declare const name: string | undefined;
1473814738
declare var navigator: Navigator;
1473914739
declare var offscreenBuffering: string | boolean;
1474014740
declare var onabort: (this: Window, ev: UIEvent) => any;

0 commit comments

Comments
 (0)