Skip to content

Commit

Permalink
Add __exception__ property only in enhanced java access
Browse files Browse the repository at this point in the history
  • Loading branch information
rPraml authored and gbrail committed Oct 2, 2024
1 parent 4e0b69b commit 9cc24c8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4432,7 +4432,7 @@ public static Scriptable newCatchScope(
catchScopeObject.defineProperty(exceptionName, obj, ScriptableObject.PERMANENT);
}

if (isVisible(cx, t)) {
if (cx.hasFeature(Context.FEATURE_ENHANCED_JAVA_ACCESS) && isVisible(cx, t)) {
// Add special Rhino object __exception__ defined in the catch
// scope that can be used to retrieve the Java exception associated
// with the JavaScript exception (to get stack trace info, etc.)
Expand Down

0 comments on commit 9cc24c8

Please sign in to comment.