Skip to content

Removes the nullable attribute from window.parent #1089

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 7 commits into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 4 additions & 2 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17230,7 +17230,8 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
readonly pageXOffset: number;
/** @deprecated This is a legacy alias of `scrollY`. */
readonly pageYOffset: number;
readonly parent: WindowProxy | null;
/** Refers to either the parent WindowProxy, or itself. If you create a child context, then remove the parent you could get null though. */
Copy link
Contributor

@saschanaz saschanaz Aug 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Refers to either the parent WindowProxy, or itself.

It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having it multiline doesn't really work because it's in two places with different indentations, so I made this a single line

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think \n automatically does the indentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. postMessage

readonly parent: WindowProxy;
/**
* Returns true if the personal bar is visible; otherwise, returns false.
*/
Expand Down Expand Up @@ -18294,7 +18295,8 @@ declare var outerWidth: number;
declare var pageXOffset: number;
/** @deprecated This is a legacy alias of `scrollY`. */
declare var pageYOffset: number;
declare var parent: WindowProxy | null;
/** Refers to either the parent WindowProxy, or itself. If you create a child context, then remove the parent you could get null though. */
declare var parent: WindowProxy;
/**
* Returns true if the personal bar is visible; otherwise, returns false.
*/
Expand Down
9 changes: 9 additions & 0 deletions inputfiles/comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,15 @@
}
}
}
},
"Window": {
"properties": {
"property": {
"parent": {
"comment" : "Refers to either the parent WindowProxy, or itself. If you create a child context, then remove the parent you could get null though."
}
}
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@
},
"window": {
"overrideType": "Window & typeof globalThis"
},
"parent": {
"nullable": false
}
}
},
Expand Down