Help me where I can find documentation for the
TO_NUMBER is a V8-internal macro defined here:
Not that this will help you much: it simply calls into an intrinsic, which is implemented as generated code, and has many different implementations depending on compiler (V8 has four), hardware platform (V8 supports about 10), and available type information. One generic code generator can be seen here:
If you just want to know the semantics, you better look at the ECMAScript 262 standard.