I am setting a property, I need to know who is setting the property value? is this possible in haxe 3?
Also, can I know who is calling a function from inside the function itself?
Check out PosInfos. You use it like so:
public static function add(a:Int, b:Int, ?pos:PosInfos) {
trace( 'Called from ${pos.className}');
trace( 'Called from ${pos.methodName}');
trace( 'Called from ${pos.fileName}');
trace( 'Called from ${pos.lineNumber}');
return a+b;
}
add( 1, 1 ); // "pos" will automatically be filled in by compiler
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With