Closed francisbouvier closed 10 months ago
As specified by v8 API we can provide an additional data argument when creating Function callbacks ; this data can then be retrieved when the callback is invoked. see https://v8.github.io/api/head/classv8_1_1FunctionCallbackInfo.html#ab0ebfc2ea43af2fdfc3d085272bf499f
data
We use this to pass a native context pointer with relevant elements (memory allocator, I/O loop) and remove the former ugly global variable access.
Relates to #49 and #66
As specified by v8 API we can provide an additional
data
argument when creating Function callbacks ; thisdata
can then be retrieved when the callback is invoked. see https://v8.github.io/api/head/classv8_1_1FunctionCallbackInfo.html#ab0ebfc2ea43af2fdfc3d085272bf499fWe use this to pass a native context pointer with relevant elements (memory allocator, I/O loop) and remove the former ugly global variable access.
Relates to #49 and #66