Skip to content

Make the global var name of type never #139

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 1 commit into from
Aug 11, 2016
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
5 changes: 4 additions & 1 deletion TS.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface)=
| Some comment -> Pt.printl "%s" comment
| _ -> ()

if Option.isNone (findRemovedItem p.Name ItemKind.Property i.Name) then
// Treat window.name specially because of https://github.com/Microsoft/TypeScript/issues/9850
if p.Name = "name" && i.Name = "Window" && emitScope = EmitScope.All then
Pt.printl "declare const name: never;"
elif Option.isNone (findRemovedItem p.Name ItemKind.Property i.Name) then
match findOverriddenItem p.Name ItemKind.Property i.Name with
| Some p' -> emitPropertyFromJson p'
| None ->
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 @@ -14305,7 +14305,7 @@ declare var location: Location;
declare var locationbar: BarProp;
declare var menubar: BarProp;
declare var msCredentials: MSCredentials;
declare var name: string;
declare const name: never;
declare var navigator: Navigator;
declare var offscreenBuffering: string | boolean;
declare var onabort: (this: Window, ev: UIEvent) => any;
Expand Down