Subj : Re: Performance Advice on Maintaining Many Contexts To : Peter Kyme From : Brendan Eich Date : Thu Mar 03 2005 08:39 am Peter Kyme wrote: > However, I also have the situation where one of the C++ callback > functions can create a new C++ object and associated JS global object, > which is then executed once before the callback returns control to the > original JS code. eg: > > JS_SetGlobalObject(cx, gobj1) > globalObject1 -> running JS code, which calls 'fork' C++ function > globalObject1 -> C++ 'fork' function, creates new globalObject2 > JS_SetGlobalObject(cx, gobj2) > globalObject2 -> runs JS code, completes > JS_SetGlobalObject(cx, gobj1) > globalObject1 -> returns control to original JS code > > Is this sort of behaviour acceptable? Sure, you can stack global objects. /be .