Hi.
While working with the library I've noticed that there is no support for js callbacks in .NET code. Function objects supplied to .net code (e.g. as method arguments) are converted to empty dictionaries which obviously are not very useful.
So I've created my own wrapper for functions and would like to share with others. May be someone will find it useful too.
Attached are 2 files (.cpp/.h) that describe managed class JavascriptFunction. It holds v8 handle to js function which can be called from .NET code. To use this new class small patch to JavascriptInterop class should be applied (also attached).
Comments: ** Comment from web user: chillitom **
While working with the library I've noticed that there is no support for js callbacks in .NET code. Function objects supplied to .net code (e.g. as method arguments) are converted to empty dictionaries which obviously are not very useful.
So I've created my own wrapper for functions and would like to share with others. May be someone will find it useful too.
Attached are 2 files (.cpp/.h) that describe managed class JavascriptFunction. It holds v8 handle to js function which can be called from .NET code. To use this new class small patch to JavascriptInterop class should be applied (also attached).
Comments: ** Comment from web user: chillitom **
_My understanding_ is that destructors on ref classes just implement IDisposable.Dispose() (if you try explicitly adding a Dispose() method to a ref class the compiler will throw an error). Whenever you use stack semantics for ref class object creation you are still just newing up an object on the heap, it's just that the compiler changes the syntax to look like traditional C++ stack objects. When an ref class object using stack semantics goes out of scope its destructor will be called if it implements IDisposable.