mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Don't define empty FooMethods traits.
This commit is contained in:
parent
b213a80f80
commit
6eb9607bb9
2 changed files with 9 additions and 11 deletions
|
@ -4150,13 +4150,16 @@ class CGInterfaceTrait(CGThing):
|
||||||
def fmt(arguments):
|
def fmt(arguments):
|
||||||
return "".join(", %s: %s" % argument for argument in arguments)
|
return "".join(", %s: %s" % argument for argument in arguments)
|
||||||
|
|
||||||
methods = CGList([
|
methods = [
|
||||||
CGGeneric("fn %s(self%s) -> %s;\n" % (name, fmt(arguments), rettype))
|
CGGeneric("fn %s(self%s) -> %s;\n" % (name, fmt(arguments), rettype))
|
||||||
for name, arguments, rettype in members()
|
for name, arguments, rettype in members()
|
||||||
], "")
|
]
|
||||||
self.cgRoot = CGWrapper(CGIndenter(methods),
|
if methods:
|
||||||
pre="pub trait %sMethods {\n" % descriptor.interface.identifier.name,
|
self.cgRoot = CGWrapper(CGIndenter(CGList(methods, "")),
|
||||||
post="}")
|
pre="pub trait %sMethods {\n" % descriptor.interface.identifier.name,
|
||||||
|
post="}")
|
||||||
|
else:
|
||||||
|
self.cgRoot = CGGeneric("")
|
||||||
|
|
||||||
def define(self):
|
def define(self):
|
||||||
return self.cgRoot.define()
|
return self.cgRoot.define()
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use dom::bindings::codegen::Bindings::NodeIteratorBinding;
|
use dom::bindings::codegen::Bindings::NodeIteratorBinding;
|
||||||
use dom::bindings::codegen::Bindings::NodeIteratorBinding::NodeIteratorMethods;
|
|
||||||
use dom::bindings::global::GlobalRef;
|
use dom::bindings::global::GlobalRef;
|
||||||
use dom::bindings::js::{JSRef, Temporary};
|
use dom::bindings::js::Temporary;
|
||||||
use dom::bindings::utils::{Reflector, reflect_dom_object};
|
use dom::bindings::utils::{Reflector, reflect_dom_object};
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
@ -24,7 +23,3 @@ impl NodeIterator {
|
||||||
reflect_dom_object(box NodeIterator::new_inherited(), global, NodeIteratorBinding::Wrap)
|
reflect_dom_object(box NodeIterator::new_inherited(), global, NodeIteratorBinding::Wrap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> NodeIteratorMethods for JSRef<'a, NodeIterator> {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue