Detect if a function call comes from a class constructor