зеркало из https://github.com/mozilla/pjs.git
Bug 21668. Use nsCOMPtr (or Linss-ptr) to get the nativeThis. r=shaver
This commit is contained in:
Родитель
9fd346a651
Коммит
03a15dfd82
|
@ -986,8 +986,17 @@ static const char kMethodBeginNonPrimaryStr[] = "\n\n"
|
|||
"PR_STATIC_CALLBACK(JSBool)\n"
|
||||
"%s%s(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)\n"
|
||||
"{\n"
|
||||
" nsIDOM%s *privateThis = (nsIDOM%s*)nsJSUtils::nsGetNativeThis(cx, obj);\n"
|
||||
" nsIDOM%s *nativeThis = nsnull;\n"
|
||||
#ifdef USE_COMPTR
|
||||
" nsCOMPtr<nsIDOM%s> nativeThis;\n"
|
||||
#else
|
||||
" nsIDOM%sPtr nativeThis = nsnull;\n"
|
||||
#endif
|
||||
" nsresult result = NS_OK;\n"
|
||||
#ifdef USE_COMPTR
|
||||
" if (NS_OK != privateThis->QueryInterface(kI%sIID, getter_AddRefs(nativeThis))) {\n"
|
||||
#else
|
||||
" if (NS_OK != privateThis->QueryInterface(kI%sIID, (void **)&nativeThis)) {\n"
|
||||
#endif" nsIDOM%s *nativeThis = nsnull;\n"
|
||||
" nsresult result = NS_OK;\n"
|
||||
" if (NS_OK != privateThis->QueryInterface(kI%sIID, (void **)&nativeThis)) {\n"
|
||||
" return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);\n"
|
||||
|
|
Загрузка…
Ссылка в новой задаче