I can see the point of 1). But 2), what happens if I don't call context.Dispose(); will it leak? In which situation would I not call Dispose()? When context goes out of scope (in C++), there is no way of retrieving it? Or is there?
I guess I am still not familiar to the way "v8's stack" works behind the scene. On Oct 21, 11:27 pm, "bradley.meck" <bradley.m...@gmail.com> wrote: > 1) I am not a v8 dev but here are my thoughts. Throwing in normal C++ > would be rather hard to recover from if you wish to continue in the > same code path (you could do nested try catches I guess). If you were > to provide bindings to a non-c++ language this would be extremely odd > to work around. > > 2) It is persistent (lives beyond the scope), as such the destructor > will not be called on it w/o using dispose because it lives beyond the > scope it is declared in for that example. (more on this in v8.h) > > Cheers, > Bradley > > On Oct 21, 3:05 pm, Andrea Odetti <andrea.ode...@gmail.com> wrote: > > > Hi, > > > I've just started using v8 and I am struggling to understand a couple > > of things. > > It is written in C++ but it i snot taking full advantage of the > > language > > > 1) exception: why is it not throwing normal C++ exceptions? I need to > > check after most calls if the TryCatch has caught anything > > > 2) the examplehttp://code.google.com/apis/v8/get_started.htmlstill > > calls context.Dispose(); > > before returning. is it compulsory? is it not already called by the > > destructor? > > > Or I am misunderstanding some design ideas? > > > Andrea -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users