tslib
tslib copied to clipboard
fix(__decorate): Stop using non‑standard `Reflect.decorate`
TypeScript PR: https://github.com/microsoft/TypeScript/pull/36408
Reflect.decorateis not on a standards track and has no active proposal being championed in TC39. We have no idea ifReflect.decoratewill 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.decoratefrom ever existing in the language, just likeArray.prototype.flattenhad 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
Nice work @ExE-Boss ☺️