@@ -363,7 +363,10 @@ export class FormModel {
363363 // Add page to context
364364 context . relevantPages . push ( nextPage )
365365
366- this . assignEvaluationState ( context , nextPage )
366+ // Engine.V2 is excluded here as this will have already been done in initialiseContext()
367+ if ( this . engine !== Engine . V2 ) {
368+ this . assignEvaluationState ( context , nextPage )
369+ }
367370
368371 this . assignRelevantState ( context , nextPage )
369372
@@ -389,14 +392,12 @@ export class FormModel {
389392 }
390393
391394 private initialiseContext ( context : FormContext ) {
392- // For the V2 engine, we need to initialise `evaluationState` to null
393- // for all keys. This is because the current condition evaluation
394- // library (eval-expr) will throw if an expression uses a key that is undefined.
395+ // For the V2 engine, we initialise `evaluationState` for all keys.
396+ // This is because the current condition evaluation library (eval-expr)
397+ // will throw if an expression uses a key that is undefined.
395398 if ( this . engine === Engine . V2 ) {
396399 for ( const page of this . pages ) {
397- for ( const key of page . keys ) {
398- context . evaluationState [ key ] = null
399- }
400+ this . assignEvaluationState ( context , page )
400401 }
401402 }
402403 }
0 commit comments