Skip to content
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

self should be a getter #15765

Closed
zloirock opened this issue Sep 4, 2022 · 3 comments · Fixed by #17362
Closed

self should be a getter #15765

zloirock opened this issue Sep 4, 2022 · 3 comments · Fixed by #17362
Labels
bug Something isn't working correctly web related to Web APIs

Comments

@zloirock
Copy link

zloirock commented Sep 4, 2022

But now it's a usual property.

https://html.spec.whatwg.org/multipage/window-object.html#dom-self

image

Chromium:
image

Safari:
image

FF:
image

Deno:
image

@kitsonk
Copy link
Contributor

kitsonk commented Sep 5, 2022

Is there a specific issue this is causing for you?

@zloirock
Copy link
Author

zloirock commented Sep 5, 2022

@kitsonk sure, and it will cause problems for thousands of users.

self now is a part of Minimum Common Web Platform API. I wanted to add a proper polyfill of this (not just globalThis.self ??= globalThis) to core-js. This polyfill contains a proper descriptor detection and in case of incorrect descriptor overwrites incorrect implementation - like Deno. Babel and SWC inject core-js polyfills for unsupported features - by the core-js compat data - and for bundling / loading it's an extra couple of KB.

@kitsonk kitsonk added bug Something isn't working correctly web related to Web APIs labels Sep 5, 2022
@kitsonk
Copy link
Contributor

kitsonk commented Sep 5, 2022

Yup, thanks, that makes a lot of sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly web related to Web APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants