Add __exception__ property only in enhanced java access #1663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that Rhino stores the current exception in a
__exception__
variable.This is not really standard and in my opinion it only makes sense when using LiveConnect (and even there I see no reason to enable this by default).
My suggestion is to enable this feature only via flag (FEATURE_ENHANCED_JAVA_ACCESS should fit) or remove it completely.
It was introduced with d0c1400 but no test or use case was described. And I also found only this post: https://groups.google.com/g/mozilla.dev.tech.js-engine.rhino/c/qNttXExynw4?pli=1
Instead of putting something in the current scope, you can use this more object oriented code to access the underlying exception
So maybe anyone can tell a use case for this feature, if this is still needed?