Proposal: not polyfilling Math.imul any more


Hi all, I plan to remove the polyfill to Math.imul in next release.
Note Math.imul was an ES6 feature, it should be available in most reasonable JS runtime, you can still make your code work by providing a third party polyfill, let us know if it has any impact on your code


That should be fine as long as you have a way to tell users which polyfill they need to provide automatically. We can’t keep track of changes like this


I din’t even know BuckleScript polyfilled ES6 features. And it’s probably not its job.


Previously we are only targeting ES5, now ES6 is almost 4~5 years ago, maybe it is great time to use some of its features


I’m no expert, but I expect polyfilling methods to be relatively trivial: you just need some code that monkey patches prototypes in runtime. You can more or less just bundle some third-party polyfills, and there’s no need for BuckleScript to take on that responsibility.

Now, if we were talking about language features that would require AST transformations (like Regenerator or even destructuring), that would mean either support from BuckleScript itself or going through Babel, which would slow things down immensely. So maybe BuckleScript shouldn’t support those either just yet, and instead, wait for IE to die out :slight_smile: