Scope of variables in libraries

Wappler Version : 7.3.9
Operating System : Windows 11
Server Model: NodeJS
Database Type: Postgres
Hosting Type: remote

Expected behavior

I may be really off the mark here, but I expect that if a parent library defines the value of variables and then executes a child library without passing them as arguments, then they child library should NOT be able to see the parent’s variables. In other words, that both parent and child keep their variables local in scope and don’t know about each other’s unless passed back.

Conversely, if the parent includes the child, then those variables should be visible.

This is possibly related to Array lists do not get created in a child if the same name already exists in its parent

Actual behavior

Parent variables not passed as parameters to an executed child library are visible by the child.

How to reproduce

  1. Create a “child” library that sets and outputs a variable c1 = {{p1}}

  1. Create a “parent” library that
  • sets a variable p1 = “Variable defined by the parent”
  • invokes a child library with no arguments passed from parent to child

  1. Create a test API, that executes the parent library

Run the test API to confirm that the child library can indeed see the value of variables defined at the parent that had not been explicitly passed to it.

Thank you,

Alex