-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
es5 polyfills core-js is missing #156
Comments
It's a very good issue, I have been waiting for it for a long time. Now I really want to sleep, tomorrow I will explain the situation. |
Instead of ES6 or ES7 parts of Sure, I will add missed ES5 polyfills, but not for very obsolete, only for supported engines. However, there is a problem. Many people just use |
Thanks for replying @zloirock I am kind of dismayed about how long Chrome went essentially with es5 support (at least enough for core-js to work with iirc) but without fixing parseInt. But you are right, the browser stats for these versions are almost nothing. Someone jumping on an old computer that hasn't started up and updated Chrome yet isn't something to really worry about. I wouldn't necessarily worry about moving the es5 polyfills into es6. Aside from toISOString I don't really see any parts of the es5 polyfill trying to fix bugs in es5 implementations. Most of the module is polyfilling the "easy" stuff that's already supported in most levels of es5 implementations. Which isn't really necessary as core-js/es5 isn't complete enough for es3 but these polyfills are unnecessary in most es5 environments. I think it might be best that if someone wants to polyfill an es3 environment like IE8 or obsolete Chrome we should just direct them to use es5-{shim,sham} instead of the es5 portion of core-js. Then use core-js for everything es6+. |
- by ES5, `RegExp#toString` should be generic and use `.flags` property - also, old engines has incorrect flags order, related #156
- by ES6, `RegExp#toString` should be generic and use `.flags` property - also, old engines has incorrect flags order, related #156
- by ES6, `RegExp#toString` should be generic and use `.flags` property - also, old engines has incorrect flags order, related #156
Most of the required polyfills added and will be available in |
Does core-js intend to fully polyfill es5 so it can replace es5-{shim,sham}? I see that core-js polyfils parts of es5 but not others that es5-shim does.
Some es5 polyfills I see missing in core-js:
parseInt(*, 10)
It also forces the polyfill on some things like String#lastIndexOf and Array#lastIndexOf and String#split when a browser exhibits a certain bug.
There are probably more es5-shim polyfills that core-js are missing than is on my list. But if someone really wants to compare polyfill quality and bring core-js to the same level. Then theoretically, running es5-shim's test suite on core-js in an es3 environment would tell you exactly that.
The parseInt change is rather curious. According to compatibility table Chrome 7-22 supports most parts of es5 including Object.create, Object.defineProperty, and Object.freeze but does not implement es5 parseInt. So what is essentially a browser with most of es5 needs this polyfill.
The text was updated successfully, but these errors were encountered: