Confirmed users
497
edits
| Line 19: | Line 19: | ||
; Debug(object) : Create a debugger object debugging |object|'s compartment. |Object| is typically a global object, but can be any JavaScript object from the debuggee's compartment.<p>The |object| must be in a different compartment than the calling code, and debugger/debuggee compartments may not form a cycle. |object|'s compartment must not be in use by another thread.</p> | ; Debug(object) : Create a debugger object debugging |object|'s compartment. |Object| is typically a global object, but can be any JavaScript object from the debuggee's compartment.<p>The |object| must be in a different compartment than the calling code, and debugger/debuggee compartments may not form a cycle. |object|'s compartment must not be in use by another thread.</p> | ||
; D.setHooks(hooks) : Use the functions in |hooks| to handle events occurring in D's debuggee. |Hooks| should be an object; each property should be named after a debugging event, and its value should be a function SpiderMonkey should call when the named event occurs. See below for descriptions of specific debugging hooks.<p>This removes all previously registered hooks; after the call, only the hooks mentioned in |hooks| are in force.</p><p>Hook function calls are cross-compartment, same-thread calls. Hook functions run in the thread in which the event occurred, not in the thread that registered the hooks. (It is your responsibility to ensure that two threads don't try to run in the same compartment). Hook functions run in the compartment to which they belong, not in the debuggee's compartment.</p> | ; D.setHooks(hooks) : Use the functions in |hooks| to handle events occurring in D's debuggee. |Hooks| should be an object; each property should be named after a debugging event, and its value should be a function SpiderMonkey should call when the named event occurs. See below for descriptions of specific debugging hooks.<p>This removes all previously registered hooks; after the call, only the hooks mentioned in |hooks| are in force. Thus, a call like <b>D.setHooks({})</b> removes all debugging hooks.</p><p>Hook function calls are cross-compartment, same-thread calls. Hook functions run in the thread in which the event occurred, not in the thread that registered the hooks. (It is your responsibility to ensure that two threads don't try to run in the same compartment). Hook functions run in the compartment to which they belong, not in the debuggee's compartment.</p> | ||
; D.getHooks() : Return an object holding all the event hooks currently in force. The returned object is suitable for use with D.setHooks. | ; D.getHooks() : Return an object holding all the event hooks currently in force. The returned object is suitable for use with D.setHooks. | ||