Skip to content

Commit 9732d06

Browse files
Switch 'name' to 'void', mark as deprecated. (#883)
* Switch 'name' to 'void', mark as deprecated. * update baselines Co-authored-by: Nathan Shively-Sanders <[email protected]>
1 parent 8b988c9 commit 9732d06

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

baselines/dom.generated.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -19505,7 +19505,8 @@ declare var location: Location;
1950519505
declare var locationbar: BarProp;
1950619506
declare var menubar: BarProp;
1950719507
declare var msContentScript: ExtensionScriptApis;
19508-
declare const name: never;
19508+
/** @deprecated */
19509+
declare const name: void;
1950919510
declare var navigator: Navigator;
1951019511
declare var offscreenBuffering: string | boolean;
1951119512
declare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;

src/emitter.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,12 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor, iterator: boo
598598
function emitProperty(prefix: string, i: Browser.Interface, emitScope: EmitScope, p: Browser.Property) {
599599
emitComments(p, printer.printLine);
600600

601-
// Treat window.name specially because of https://github.com/Microsoft/TypeScript/issues/9850
601+
// Treat window.name specially because of
602+
// - https://github.com/Microsoft/TypeScript/issues/9850
603+
// - https://github.com/microsoft/TypeScript/issues/18433
602604
if (p.name === "name" && i.name === "Window" && emitScope === EmitScope.All) {
603-
printer.printLine("declare const name: never;");
605+
printer.printLine("/** @deprecated */");
606+
printer.printLine("declare const name: void;");
604607
}
605608
else {
606609
let pType: string;

0 commit comments

Comments
 (0)