зеркало из https://github.com/mozilla/gecko-dev.git
Bug 677079 - Part h: Expose debuggerHandler in jsfriendapi.h; r=igor
This commit is contained in:
Родитель
d8739c7ff6
Коммит
2cedc161bf
|
@ -37,7 +37,7 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "jscntxt.h"
|
||||
#include "jscntxt.h" // outstandingRequests
|
||||
#include "nsJSEnvironment.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
|
@ -712,8 +712,7 @@ nsJSContext::DOMOperationCallback(JSContext *cx)
|
|||
|
||||
// Check if we should offer the option to debug
|
||||
JSStackFrame* fp = ::JS_GetScriptedCaller(cx, NULL);
|
||||
bool debugPossible = (fp != nsnull && cx->debugHooks &&
|
||||
cx->debugHooks->debuggerHandler != nsnull);
|
||||
bool debugPossible = fp && js::CanCallContextDebugHandler(cx);
|
||||
#ifdef MOZ_JSDEBUGGER
|
||||
// Get the debugger service if necessary.
|
||||
if (debugPossible) {
|
||||
|
@ -842,10 +841,7 @@ nsJSContext::DOMOperationCallback(JSContext *cx)
|
|||
else if ((buttonPressed == 2) && debugPossible) {
|
||||
// Debug the script
|
||||
jsval rval;
|
||||
switch(cx->debugHooks->debuggerHandler(cx, script, ::JS_GetFramePC(cx, fp),
|
||||
&rval,
|
||||
cx->debugHooks->
|
||||
debuggerHandlerData)) {
|
||||
switch (js::CallContextDebugHandler(cx, script, JS_GetFramePC(cx, fp), &rval)) {
|
||||
case JSTRAP_RETURN:
|
||||
JS_SetFrameReturnValue(cx, fp, rval);
|
||||
return JS_TRUE;
|
||||
|
|
|
@ -505,6 +505,22 @@ VersionSetXML(JSVersion version, bool enable)
|
|||
: JSVersion(uint32_t(version) & ~VersionFlags::HAS_XML);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
CanCallContextDebugHandler(JSContext *cx)
|
||||
{
|
||||
return cx->debugHooks && cx->debugHooks->debuggerHandler;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JSTrapStatus)
|
||||
CallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval)
|
||||
{
|
||||
if (!CanCallContextDebugHandler(cx))
|
||||
return JSTRAP_RETURN;
|
||||
|
||||
return cx->debugHooks->debuggerHandler(cx, script, bc, rval,
|
||||
cx->debugHooks->debuggerHandlerData);
|
||||
}
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
JSThread *
|
||||
GetContextThread(const JSContext *cx)
|
||||
|
|
|
@ -492,6 +492,12 @@ GetContextStructuredCloneCallbacks(JSContext *cx);
|
|||
extern JS_FRIEND_API(JSVersion)
|
||||
VersionSetXML(JSVersion version, bool enable);
|
||||
|
||||
extern JS_FRIEND_API(bool)
|
||||
CanCallContextDebugHandler(JSContext *cx);
|
||||
|
||||
extern JS_FRIEND_API(JSTrapStatus)
|
||||
CallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче