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