Skip to content
Snippets Groups Projects
Commit 9114ab26 authored by Florian Angerer's avatar Florian Angerer
Browse files

Fix: do not overwrite visibility flag in on.exit calls.

parent 255877c7
Branches
No related tags found
No related merge requests found
......@@ -328,6 +328,8 @@ public final class FunctionDefinitionNode extends RRootNode implements RSyntaxNo
}
if (runOnExitHandlers) {
visibility.executeEndOfFunction(frame);
boolean actualVisibility = RArguments.getCall(frame).getVisibility();
if (!noHandlerStackSlot.isValid()) {
FrameSlot slot = getHandlerFrameSlot(frame);
if (frame.isObject(slot)) {
......@@ -376,6 +378,9 @@ public final class FunctionDefinitionNode extends RRootNode implements RSyntaxNo
throw ex;
}
}
// Restore visibility flag because an on.exit call may have changed it.
RArguments.getCall(frame).setVisibility(actualVisibility);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment