A function $f: A \rightarrow B$ is a triple ($f, A, B$) where $f \subseteq A \times B$ satisfying certain properties. So what you should really be asking is, is $f$ a bijection between A and B?
If $f(-2)$ is not defined, this means that $-2 \notin A$, so it doesn't have any consequence on whether your function is a bijection between A and B or not.
A function $f: A \rightarrow B$ is a triple ($f, A, B$) where $f \subseteq A \times B$ satisfying certain properties. So what you should really be asking is, is $f$ a bijection between A and B? If $f(-2)$ is not defined, this means that $-2 \notin A$, so it doesn't have any consequence on whether your function is a bijection between A and B or not.