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
remove ES6 syntax from getElementsByClassName #91
Conversation
the new method getElementsByClassName uses ES6 syntax. This is a problem when trying to polyfill an older engine.
Thanks. Can you give us an idea what kind of engine or browser you need this for? In my own experience, these changes could help on Android 4.4, which is extremely old and losing support from toolkits such as Apache Cordova. If we do accept this proposal, it would be nice to configure eslint to reject the ES6 syntax (maybe part of PR #90). |
I was just going to chime in: if we standardize on supported platforms, this should include an eslint rule for it. If this is the only thing stopping use in a handful of platforms, +1. I'm not worried about syntax sugar, I'm more worried about getting to use optimizations like |
With the massive amount of usage out there, introducing a syntax that is not supported is a breaking change. So we should really define what platforms to support (and for how long). I think this PR is good as a first step (didn't check the code details, just talking about the intention here). Next one should be to
|
The platform in question is Jint. The changed function is the only place that is currently using modern syntax and with my change, I can use xmldom even in the old/stable branch. For the record, the other platform I know of that won't support this syntax is IE11. |
I have the IE11 error too, and fixed as this commit said. It's a little weird only this function but no other funcs use es6 syntax. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we should have some linting for this, but I think we should land this fix/PR to unblock the people affected.
should guard against newer ES6 syntax that could lead to issues with some ES5 environments such as: - Jint - https://github.com/sebastienros/jint - Duktape - IE11 - Android pre-5.0 WebView (already past EOL) as discussed in PR xmldom#91 - xmldom#91
should guard against newer ES6 syntax that could lead to issues with some ES5 environments such as: - Jint - https://github.com/sebastienros/jint - Duktape - IE11 - Android pre-5.0 WebView (already past EOL) as discussed in PR xmldom#91 - xmldom#91
should guard against newer ES6 syntax that could lead to issues with some ES5 environments such as: - Jint - https://github.com/sebastienros/jint - Duktape - IE11 - Android pre-5.0 WebView (already past EOL) as discussed in PR xmldom#91 - xmldom#91
should guard against newer ES6 syntax that could lead to issues with some ES5 environments such as: - Jint - https://github.com/sebastienros/jint - Duktape - IE11 - Android pre-5.0 WebView (already past EOL) as discussed in PR #91 - #91
The new method getElementsByClassName uses ES6 syntax. This is a problem when trying to polyfill an older engine.