зеркало из https://github.com/mozilla/pjs.git
Bug 469361. Remove unused API (revert to previous interface version). r+sr=jst
This commit is contained in:
Родитель
8ccd4269e2
Коммит
8d86a67288
|
@ -57,9 +57,9 @@ class nsScriptObjectHolder;
|
|||
typedef void (*nsScriptTerminationFunc)(nsISupports* aRef);
|
||||
|
||||
#define NS_ISCRIPTCONTEXT_IID \
|
||||
{ /* {e7b9871d-3adc-4bf7-850d-7fb9554886bf} */ \
|
||||
0xe7b9871d, 0x3adc, 0x4bf7, \
|
||||
{ 0x85, 0x0d, 0x7f, 0xb9, 0x55, 0x48, 0x86, 0xbf } }
|
||||
{ /* {09316a0e-8d05-4d26-9efd-8f907a7c79d2} */ \
|
||||
0x09316a0e, 0x8d05, 0x4d26, \
|
||||
{ 0x9e, 0xfd, 0x8f, 0x90, 0x7a, 0x7c, 0x79, 0xd2 } }
|
||||
|
||||
/* This MUST match JSVERSION_DEFAULT. This version stuff if we don't
|
||||
know what language we have is a little silly... */
|
||||
|
@ -456,9 +456,6 @@ public:
|
|||
*/
|
||||
virtual nsresult DropScriptObject(void *object) = 0;
|
||||
virtual nsresult HoldScriptObject(void *object) = 0;
|
||||
|
||||
/* Report a pending exception if there is one on the native context */
|
||||
virtual void ReportPendingException() = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContext, NS_ISCRIPTCONTEXT_IID)
|
||||
|
|
|
@ -1592,7 +1592,7 @@ nsJSContext::EvaluateString(const nsAString& aScript,
|
|||
// to avoid dropping JS exceptions in case we got here through
|
||||
// nested calls through XPConnect.
|
||||
|
||||
JS_ReportPendingException(mContext);
|
||||
ReportPendingException(PR_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1856,9 +1856,7 @@ nsJSContext::CompileEventHandler(nsIAtom *aName,
|
|||
if (!fun) {
|
||||
// Set aside the frame chain on cx while reporting, since it has
|
||||
// nothing to do with the error we just hit.
|
||||
JSStackFrame* frame = JS_SaveFrameChain(mContext);
|
||||
ReportPendingException();
|
||||
JS_RestoreFrameChain(mContext, frame);
|
||||
ReportPendingException(PR_TRUE);
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
|
@ -1993,9 +1991,7 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, void *aScope, void *aHandler
|
|||
// to avoid dropping JS exceptions in case we got here through
|
||||
// nested calls through XPConnect.
|
||||
|
||||
if (JS_IsExceptionPending(mContext)) {
|
||||
JS_ReportPendingException(mContext);
|
||||
}
|
||||
ReportPendingException(PR_FALSE);
|
||||
|
||||
// Don't pass back results from failed calls.
|
||||
rval = JSVAL_VOID;
|
||||
|
@ -2069,9 +2065,7 @@ nsJSContext::BindCompiledEventHandler(nsISupports* aTarget, void *aScope,
|
|||
!::JS_DefineProperty(mContext, target, charName,
|
||||
OBJECT_TO_JSVAL(funobj), nsnull, nsnull,
|
||||
JSPROP_ENUMERATE | JSPROP_PERMANENT)) {
|
||||
JSStackFrame* frame = JS_SaveFrameChain(mContext);
|
||||
ReportPendingException();
|
||||
JS_RestoreFrameChain(mContext, frame);
|
||||
ReportPendingException(PR_TRUE);
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -3618,11 +3612,16 @@ nsJSContext::DropScriptObject(void* aScriptObject)
|
|||
}
|
||||
|
||||
void
|
||||
nsJSContext::ReportPendingException()
|
||||
nsJSContext::ReportPendingException(PRBool aSetAsideFrameChain)
|
||||
{
|
||||
JSStackFrame* frame =
|
||||
aSetAsideFrameChain ? JS_SaveFrameChain(mContext) : nsnull;
|
||||
if (mIsInitialized && ::JS_IsExceptionPending(mContext)) {
|
||||
::JS_ReportPendingException(mContext);
|
||||
}
|
||||
if (aSetAsideFrameChain) {
|
||||
JS_RestoreFrameChain(mContext, frame);
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -166,8 +166,6 @@ public:
|
|||
virtual nsresult DropScriptObject(void *object);
|
||||
virtual nsresult HoldScriptObject(void *object);
|
||||
|
||||
virtual void ReportPendingException();
|
||||
|
||||
NS_DECL_NSIXPCSCRIPTNOTIFY
|
||||
|
||||
NS_DECL_NSITIMERCALLBACK
|
||||
|
@ -216,6 +214,11 @@ protected:
|
|||
nsresult JSObjectFromInterface(nsISupports *aSup, void *aScript,
|
||||
JSObject **aRet);
|
||||
|
||||
// Report the pending exception on our mContext, if any
|
||||
// If aSetAsideFrameChain is true, set aside the frame chain on mContext
|
||||
// before reporting. True should be passed if the frame chain isn't really
|
||||
// related to our exception.
|
||||
void ReportPendingException(PRBool aSetAsideFrameChain);
|
||||
private:
|
||||
void Unlink();
|
||||
|
||||
|
|
|
@ -933,9 +933,3 @@ nsPythonContext::HoldScriptObject(void *object)
|
|||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsPythonContext::ReportPendingException()
|
||||
{
|
||||
// Not sure there's anything to do here
|
||||
}
|
||||
|
|
|
@ -213,8 +213,6 @@ public:
|
|||
virtual nsresult HoldScriptObject(void *object);
|
||||
virtual nsresult DropScriptObject(void *object);
|
||||
|
||||
virtual void ReportPendingException();
|
||||
|
||||
NS_DECL_NSITIMERCALLBACK
|
||||
|
||||
PyObject *PyObject_FromInterface(nsISupports *target,
|
||||
|
|
Загрузка…
Ссылка в новой задаче