microsoft / tslib

Runtime library for TypeScript helpers.
BSD Zero Clause License
1.26k stars 128 forks source link

es5 polyfill and tslib #49

Closed SPWizard01 closed 1 year ago

SPWizard01 commented 6 years ago

Hi All,

There seems to be an issue with tslib once you try to use es5 polyfill.

As an example: We are writing a code on ES3/AngularJS and deploy it to the back end that renders layout pages in IE8 compat. mode(some of big companies still do this due to legacy infra and stuff, ours is one of them). This is a company system that we have no control over. The only thing we are allowed to do is to upload files :) and we have to use stuff like RequireJS etc...

Basically this part is a bad check in our situation(along with some others in this file): https://github.com/Microsoft/tslib/blob/3d0f4d4823605e6e82cf250b509d9a685c42ad41/tslib.js#L46-L56

because es5-shim would polyfill Object.create however defineProperty would fail on any IE due to compat. mode.

Would it not be better just to try catch or something along those lines?