I have been using V8 for a few weeks now and am looking for some clear guidance on the use of handle scopes in various callbacks. The documentation does not really spell it out and the process.cc an shell.cc samples seem inconsitent.
As these call backs all return Handles, which I think implies local handles and local handles can only exist inside a HandleScope, I infer that callbacks are always called within a HandleScope. Therefore I am guessing that a call back is never required to create a HandleScope but that it should if it creates any handles besides the one it will be returning. Is this correct? Is the handle scope that is in effect when a call back isinvoked: 1) A scope that was created for the callback 2) The scope that was created by the outer application prior to running the script or executing a Function->Call. 3) some intermediate scope with indeterminate lifetime If the answer is #1 then handle scopes inside of call backs are only useful to reclaim handles inside loops or functions with multiple steps. If the answer is #2 then the callback has to be extremely careful not to leak handles. I could probably ferret out these details from the code, but I am looking for some statement of the intended usage, not what may or may not work in the current implementation. -- Bryan White --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
