Skip to content

2.0: window.opener declared as readonly #10379

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
jeffreymorlan opened this issue Aug 17, 2016 · 6 comments · Fixed by microsoft/TypeScript-DOM-lib-generator#141
Closed

2.0: window.opener declared as readonly #10379

jeffreymorlan opened this issue Aug 17, 2016 · 6 comments · Fixed by microsoft/TypeScript-DOM-lib-generator#141
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@jeffreymorlan
Copy link
Contributor

When you open a popup window of a page on a different domain, for security reasons you might want to set its window.opener to null. This is a type error in 2.0 because the opener property is incorrectly declared read-only:

var newWnd = window.open(...);
newWnd.opener = null;
// Left-hand side of assignment expression cannot be a constant or a read-only property.
@kitsonk
Copy link
Contributor

kitsonk commented Aug 17, 2016

It is doing this because the Microsoft Edge IDL has it as read only. Chromium as a special getter. The W3C IDL states that it is read/write and describes the behaviour of when setting it to null.

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Aug 17, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Aug 17, 2016

PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.

@mhegazy mhegazy added this to the Community milestone Aug 17, 2016
@mhegazy mhegazy removed this from the Community milestone Aug 18, 2016
@mhegazy mhegazy reopened this Aug 18, 2016
@zhengbli zhengbli added Fixed A PR has been merged for this issue and removed Fixed in TSJS repo labels Aug 22, 2016
@mhegazy mhegazy added this to the TypeScript 2.0.1 milestone Aug 22, 2016
@cwmacdon
Copy link

@mhegazy This happens again in TS 2.8.1

@mhegazy
Copy link
Contributor

mhegazy commented Mar 28, 2018

Fix up in microsoft/TypeScript-DOM-lib-generator#397

mhegazy added a commit to microsoft/TypeScript-DOM-lib-generator that referenced this issue Mar 28, 2018
@cwmacdon
Copy link

I imagine this will be in some upcoming 2.8.2 patch release?

@mhegazy
Copy link
Contributor

mhegazy commented Mar 28, 2018

should be in 2.8.2

@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants