зеркало из https://github.com/mozilla/gecko-dev.git
Bug 776224 - CheckPref should always initialize its outparam; r=peterv
This commit is contained in:
Родитель
71696aa0f2
Коммит
9cf3772f54
|
@ -1213,24 +1213,27 @@ def CheckPref(descriptor, globalName, varName, retval, wrapperCache = None):
|
|||
"""
|
||||
if not descriptor.prefable:
|
||||
return ""
|
||||
|
||||
if wrapperCache:
|
||||
wrapperCache = " %s->ClearIsDOMBinding();\n" % (wrapperCache)
|
||||
else:
|
||||
wrapperCache = ""
|
||||
|
||||
failureCode = (" %s = false;\n" +
|
||||
" return %s;") % (varName, retval)
|
||||
return """
|
||||
{
|
||||
XPCWrappedNativeScope* scope =
|
||||
XPCWrappedNativeScope::FindInJSObjectScope(aCx, %s);
|
||||
if (!scope) {
|
||||
return %s;
|
||||
%s
|
||||
}
|
||||
|
||||
if (!scope->ExperimentalBindingsEnabled()) {
|
||||
%s %s = false;
|
||||
return %s;
|
||||
%s%s
|
||||
}
|
||||
}
|
||||
""" % (globalName, retval, wrapperCache, varName, retval)
|
||||
""" % (globalName, failureCode, wrapperCache, failureCode)
|
||||
|
||||
class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||
"""
|
||||
|
|
Загрузка…
Ссылка в новой задаче