Bug 1230291. Correctly include nsContentUtils when generating a manual hasInstance with nsIDOM* stuff or when we have a JS-implemented interface with clearable cached attrs

This commit is contained in:
Boris Zbarsky 2015-12-04 09:51:04 -05:00
Родитель 279d126b1b
Коммит affdb545dd
1 изменённых файлов: 7 добавлений и 1 удалений

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

@ -1008,6 +1008,8 @@ class CGHeaders(CGWrapper):
d.interface.hasInterfaceObject() and d.interface.hasInterfaceObject() and
NeedsGeneratedHasInstance(d) and NeedsGeneratedHasInstance(d) and
d.interface.hasInterfacePrototypeObject()) d.interface.hasInterfacePrototypeObject())
if len(hasInstanceIncludes) > 0:
hasInstanceIncludes.add("nsContentUtils.h")
# Now find all the things we'll need as arguments because we # Now find all the things we'll need as arguments because we
# need to wrap or unwrap them. # need to wrap or unwrap them.
@ -13120,7 +13122,11 @@ class CGBindingRoot(CGThing):
# interface object might have a ChromeOnly constructor. # interface object might have a ChromeOnly constructor.
(desc.interface.hasInterfaceObject() and (desc.interface.hasInterfaceObject() and
(desc.interface.isJSImplemented() or (desc.interface.isJSImplemented() or
(ctor and isChromeOnly(ctor))))) (ctor and isChromeOnly(ctor)))) or
# JS-implemented interfaces with clearable cached
# attrs have chromeonly _clearFoo methods.
(desc.interface.isJSImplemented() and
any(clearableCachedAttrs(desc))))
bindingHeaders["nsContentUtils.h"] = any( bindingHeaders["nsContentUtils.h"] = any(
descriptorHasChromeOnly(d) for d in descriptors) descriptorHasChromeOnly(d) for d in descriptors)