-
Notifications
You must be signed in to change notification settings - Fork 859
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
Use enums more freely #1639
Comments
This would constitute a breaking change, for people that interact with the parser directly, no? Do note that roughly, these are the current language features that Rhino doesn't yet support that involve new syntax:
And stuff in the TC39 proposals pipeline (stage 2.7 & 3): All this to say: yes we had quite a few language features added recently with super being added for some additional operators, but likely going forward well have less conflicting PRs. Not saying we shouldn't do this, but given this resulting in a breaking change, I think we should consider not doing this before a V2.x.x |
IMHO the benefits would overweight the cost. If someone has opened PRs yes, it might take a bit of refactoring, but the maintenance of some of these existing patterns (for example, the |
fine for me, please do it |
I agree that the benefits outweigh the costs -- I THINK that this is
technically incompatibility, but more of the sort that requires people to
rebuild their code rather than just replace a JAR file, versus an
incompatibility that requires that people actually change their source
code. I guess trying it out would help answer that question!
…On Mon, Sep 23, 2024 at 10:36 AM RBRi ***@***.***> wrote:
fine for me, please do it
—
Reply to this email directly, view it on GitHub
<#1639 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD7I23FPOSKVQZ5XC4CNNTZYBGQ3AVCNFSM6AAAAABOTZL6SCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYHEZTIOBXGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I've tried to do this, but I see serveral show stoppers:
Here is the start of the PR #1647 if really someone want to continue |
#1648 is merged, i think we can live with the current solution for a while |
Closed by #1648 |
We have a lot of places, especially in parser-related things, where we have a pattern of integer identifiers that have to remain unique, like this:
rhino/rhino/src/main/java/org/mozilla/javascript/Token.java
Line 32 in b08de52
Now that people are adding lots of new language features (thanks!) this is becoming a maintenance nightmare, because all it takes is two or three people modifying the same list of integers to create a merge conflict.
Fortunately, since the 1990s Java has added proper enums.
It would be wonderful if someone could take on the task of replacing these enum-like structures in Rhino with proper Java enums.
The text was updated successfully, but these errors were encountered: