Skip to content

Improve type safety of name global variable #240

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion TS.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ module Emit =

// Treat window.name specially because of https://github.com/Microsoft/TypeScript/issues/9850
if p.Name = "name" && i.Name = "Window" && emitScope = EmitScope.All then
printLine "declare const name: never;"
printLine "declare const name: string | undefined;"
elif Option.isNone (getRemovedItemByName p.Name ItemKind.Property i.Name) then
match getOverriddenItemByName p.Name ItemKind.Property i.Name with
| Some p' -> emitPropertyFromJson p'
Expand Down
2 changes: 1 addition & 1 deletion baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14734,7 +14734,7 @@ declare var locationbar: BarProp;
declare var menubar: BarProp;
declare var msContentScript: ExtensionScriptApis;
declare var msCredentials: MSCredentials;
declare const name: never;
declare const name: string | undefined;
declare var navigator: Navigator;
declare var offscreenBuffering: string | boolean;
declare var onabort: (this: Window, ev: UIEvent) => any;
Expand Down