@@ -109,16 +109,16 @@ public static class FrameContext {
109109 // expensive exceptions on literally every frame, e.g. if a scope is disabled by the engine and trying to touch it
110110 // throws an ExpressionException.
111111 //
112- private FrameContext (PageContext pageContext ) {
112+ private FrameContext (PageContext pageContext , FrameContext root ) {
113113 this .pageContext = pageContext ;
114- this .application = getScopelikeOrNull (() -> pageContext .applicationScope ());
114+ this .application = root != null ? root . application : getScopelikeOrNull (() -> pageContext .applicationScope ());
115115 this .arguments = getScopelikeOrNull (() -> pageContext .argumentsScope ());
116- this .form = getScopelikeOrNull (() -> pageContext .formScope ());
116+ this .form = root != null ? root . form : getScopelikeOrNull (() -> pageContext .formScope ());
117117 this .local = getScopelikeOrNull (() -> pageContext .localScope ());
118- this .request = getScopelikeOrNull (() -> pageContext .requestScope ());
119- this .session = getScopelikeOrNull (() -> pageContext .getApplicationContext ().isSetSessionManagement () ? pageContext .sessionScope () : null );
120- this .server = getScopelikeOrNull (() -> pageContext .serverScope ());
121- this .url = getScopelikeOrNull (() -> pageContext .urlScope ());
118+ this .request = root != null ? root . request : getScopelikeOrNull (() -> pageContext .requestScope ());
119+ this .session = root != null ? root . session : getScopelikeOrNull (() -> pageContext .getApplicationContext ().isSetSessionManagement () ? pageContext .sessionScope () : null );
120+ this .server = root != null ? root . server : getScopelikeOrNull (() -> pageContext .serverScope ());
121+ this .url = root != null ? root . url : getScopelikeOrNull (() -> pageContext .urlScope ());
122122 this .variables = getScopelikeOrNull (() -> pageContext .variablesScope ());
123123 this .this_ = getScopelikeOrNull (() -> {
124124 // there is also `PageContextImpl.thisGet()` but it can create a `this` property on the variables scope, which seems like
@@ -222,12 +222,12 @@ public <T> T doWorkInThisFrame(Supplier<T> f) {
222222 }
223223 }
224224
225- Frame (String sourceFilePath , int depth , ValTracker valTracker , PageContext pageContext ) {
226- this (sourceFilePath , depth , valTracker , pageContext , Frame .tryGetFrameName (pageContext ));
225+ Frame (String sourceFilePath , int depth , ValTracker valTracker , PageContext pageContext , FrameContext root ) {
226+ this (sourceFilePath , depth , valTracker , pageContext , Frame .tryGetFrameName (pageContext ), root );
227227 }
228228
229- private Frame (String sourceFilePath , int depth , ValTracker valTracker , PageContext pageContext , String name ) {
230- this .frameContext_ = new FrameContext (pageContext );
229+ private Frame (String sourceFilePath , int depth , ValTracker valTracker , PageContext pageContext , String name , FrameContext root ) {
230+ this .frameContext_ = new FrameContext (pageContext , root );
231231 this .sourceFilePath = Objects .requireNonNull (sourceFilePath );
232232 this .valTracker = Objects .requireNonNull (valTracker );
233233 this .id = nextId .incrementAndGet ();
0 commit comments