зеркало из https://github.com/mozilla/pjs.git
Remove debugging code for setters and methods to avoid weird behaviour from calling the native setters and methods twice.
--HG-- extra : rebase_source : bc087eb4c541411d5adc696b267295d4d172614e
This commit is contained in:
Родитель
21eeef5922
Коммит
6455108d73
|
@ -751,6 +751,9 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False):
|
|||
|
||||
if customMethodCall is not None:
|
||||
f.write("%s\n" % customMethodCall['code'])
|
||||
|
||||
if customMethodCall is None or isGetter:
|
||||
if customMethodCall is not None:
|
||||
f.write("#ifdef DEBUG\n")
|
||||
f.write(" nsresult debug_rv;\n")
|
||||
f.write(" nsCOMPtr<%s> debug_self = do_QueryInterface(self);\n"
|
||||
|
@ -781,10 +784,10 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False):
|
|||
else:
|
||||
args = "arg0"
|
||||
|
||||
f.write(" %s = %s->%s(%s);\n" % (nsresultname, selfname, comName, args))
|
||||
f.write(" %s = %s->%s(%s);\n"
|
||||
% (nsresultname, selfname, comName, args))
|
||||
|
||||
if customMethodCall is not None:
|
||||
if isMethod or isGetter:
|
||||
checkSuccess = "NS_SUCCEEDED(debug_rv)"
|
||||
if canFail:
|
||||
checkSuccess += " == NS_SUCCEEDED(rv)"
|
||||
|
@ -1087,11 +1090,6 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
|
|||
|
||||
if customMethodCall is not None:
|
||||
f.write("%s\n" % customMethodCall['code'])
|
||||
f.write("#ifdef DEBUG\n")
|
||||
f.write(" nsresult debug_rv;\n")
|
||||
f.write(" nsCOMPtr<%s> debug_self = do_QueryInterface(self);\n"
|
||||
% member.iface.name);
|
||||
prefix = 'debug_'
|
||||
else:
|
||||
if not rvdeclared:
|
||||
f.write(" nsresult rv;\n")
|
||||
|
@ -1111,9 +1109,9 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
|
|||
argNames.append(outParamForm(resultname, member.realtype))
|
||||
args = ', '.join(argNames)
|
||||
|
||||
f.write(" %s = %s->%s(%s);\n" % (nsresultname, selfname, comName, args))
|
||||
f.write(" %s = %s->%s(%s);\n"
|
||||
% (nsresultname, selfname, comName, args))
|
||||
|
||||
if customMethodCall is None:
|
||||
# Check for errors.
|
||||
f.write(" if (NS_FAILED(rv)) {\n")
|
||||
if haveCcx:
|
||||
|
@ -1123,12 +1121,6 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
|
|||
f.write(" xpc_qsThrowMethodFailedWithDetails(cx, rv, "
|
||||
"\"%s\", \"%s\");\n" % (member.iface.name, member.name))
|
||||
writeFailure(f, getTraceInfoDefaultReturn(member.type), 2)
|
||||
else:
|
||||
f.write(" NS_ASSERTION(NS_SUCCEEDED(debug_rv) && "
|
||||
"xpc_qsSameResult(debug_result, result),\n"
|
||||
" \"Got the wrong answer from the custom "
|
||||
"method call!\");\n")
|
||||
f.write("#endif\n")
|
||||
|
||||
# Convert the return value.
|
||||
writeTraceableResultConv(f, member.realtype)
|
||||
|
|
Загрузка…
Ссылка в новой задаче