Detecting property of caller function

How do I detect the properties of the caller function? I want the called function to return different values to the caller depending on the property called with the function.

For example, if the caller function has the property x with the value test , I want the original function to return "y; value:" + valueOfX ( "y; value:test" ). Likewise if the caller function has property a with value of test2 , I want the original function to return "b; ValueOfA:" + valueOfA ( "b; ValueOfA:test2" ). If the caller function has no property, I want it to return n .

I’ve tried searching it up but only got answers on detecting the caller function, not the properties.

Thanks.