src: refactor binding data for deserialization support
Refs: https://github.com/nodejs/node/pull/36943 Refs: https://github.com/nodejs/node/issues/35711
src: rename binding_data_name to type_name in BindingData
Previously, this was a per-class string constant for BindingData which is used as keys for identifying these objects in the binding data map. These are just type names of the BindingData. This patch renames the variable to type_name so that we can generalize this constant for other BaseObjects and use it for debugging and logging the types of other BaseObjects.
src: refactor v8 binding
- Put the v8 binding data class into a header so we can reuse the class definition during deserialization.
- Put the v8 binding code into node::v8_utils namespace for clarity.
- Move the binding data property initialization into its constructor so that we can reuse it during deserialization
- Reorder the v8 binding initialization so that we don't unnecessarily initialize the properties in a loop