Bug 874787. Add support for legacycaller on proxy bindings. r=efaust,peterv

This commit is contained in:
Boris Zbarsky 2014-03-05 22:48:03 -05:00
parent 64f553ecba
commit 847fc61450
4 changed files with 5 additions and 5 deletions

View File

@ -270,16 +270,18 @@ class CGDOMProxyJSClass(CGThing):
def declare(self):
return ""
def define(self):
callHook = LEGACYCALLER_HOOK_NAME if self.descriptor.operations["LegacyCaller"] else 'nullptr'
return """
static const DOMJSClass Class = {
PROXY_CLASS_DEF("%s",
0, /* extra slots */
JSCLASS_IS_DOMJSCLASS,
nullptr, /* call */
%s, /* call */
nullptr /* construct */),
%s
};
""" % (self.descriptor.interface.identifier.name,
callHook,
CGIndenter(CGGeneric(DOMClass(self.descriptor))).define())
def PrototypeIDAndDepth(descriptor):

View File

@ -353,10 +353,6 @@ class Descriptor(DescriptorProvider):
raise SyntaxError("%s supports named properties but does "
"not have a named getter.\n%s" %
(self.interface, self.interface.location))
if operations['LegacyCaller']:
raise SyntaxError("%s has a legacy caller but is a proxy; "
"we don't support that yet.\n%s" %
(self.interface, self.interface.location))
iface = self.interface
while iface:
iface.setUserData('hasProxyDescendant', True)

View File

@ -967,6 +967,7 @@ public:
uint32_t Item(uint32_t&);
uint32_t Item(uint32_t, bool&) MOZ_DELETE;
uint32_t Length();
void LegacyCall(JS::Handle<JS::Value>);
};
class TestNamedGetterInterface : public nsISupports,

View File

@ -876,6 +876,7 @@ dictionary DictForConstructor {
interface TestIndexedGetterInterface {
getter long item(unsigned long idx);
readonly attribute unsigned long length;
legacycaller void();
};
interface TestNamedGetterInterface {