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

fix(__decorate): Stop using non‑standard Reflect.decorate #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ExE-Boss
Copy link
Contributor

TypeScript PR: microsoft/TypeScript#36408

Reflect.decorate is not on a standards track and has no active proposal being championed in TC39.
We have no idea if Reflect.decorate will get added to the language, even if it does, we have no guarantee it will be the implementation we are assuming it to be.

By having this condition in the code, we are likely preventing Reflect.decorate from ever existing in the language, just like Array.prototype.flatten had to get a different name because MooTools would attempt to use it if it existed and it was not the implementation MooTools assumed it would be.

Here is a W3C TAG finding which recommends against usage of speculative features -- https://www.w3.org/2001/tag/doc/polyfills/#don-t-use-speculative-polyfills-that-defer-to-native-implementations

@JakeChampion
Copy link

Nice work @ExE-Boss ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants