Bug 1177869. Fix example codegen to output the correct return type for WrapObject in the non-wrappercached case. r=peterv

This commit is contained in:
Boris Zbarsky 2015-07-01 14:15:20 -04:00
Родитель 2a8044e088
Коммит d1c9680b83
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -13407,10 +13407,13 @@ class CGBindingImplClass(CGClass):
wrapArgs = [Argument('JSContext*', 'aCx'),
Argument('JS::Handle<JSObject*>', 'aGivenProto')]
if not descriptor.wrapperCache:
wrapReturnType = "bool"
wrapArgs.append(Argument('JS::MutableHandle<JSObject*>',
'aReflector'))
else:
wrapReturnType = "JSObject*"
self.methodDecls.insert(0,
ClassMethod(wrapMethodName, "JSObject*",
ClassMethod(wrapMethodName, wrapReturnType,
wrapArgs, virtual=descriptor.wrapperCache,
breakAfterReturnDecl=" ",
override=descriptor.wrapperCache,
@ -13529,11 +13532,13 @@ class CGExampleClass(CGBindingImplClass):
if self.descriptor.wrapperCache:
reflectorArg = ""
reflectorPassArg = ""
returnType = "JSObject*"
else:
reflectorArg = ", JS::MutableHandle<JSObject*> aReflector"
reflectorPassArg = ", aReflector"
returnType = "bool"
classImpl = ccImpl + ctordtor + "\n" + dedent("""
JSObject*
${returnType}
${nativeType}::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto${reflectorArg})
{
return ${ifaceName}Binding::Wrap(aCx, this, aGivenProto${reflectorPassArg});
@ -13544,6 +13549,7 @@ class CGExampleClass(CGBindingImplClass):
ifaceName=self.descriptor.name,
nativeType=self.nativeLeafName(self.descriptor),
parentType=self.nativeLeafName(self.parentDesc) if self.parentIface else "",
returnType=returnType,
reflectorArg=reflectorArg,
reflectorPassArg=reflectorPassArg)