aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2014-09-24 03:01:03 +0530
committerManish Goregaokar <manishsmail@gmail.com>2014-09-24 05:44:49 +0530
commitcc44a3b0641d94908b2b2e01bec440f64f89f8be (patch)
treea4b70f846ee51abd5b413c6875ef1bc24449c8b9 /components/script/dom/bindings/codegen/CodegenRust.py
parent85f79290a67afb25369a9a48ee9a389ee32fd20e (diff)
downloadservo-cc44a3b0641d94908b2b2e01bec440f64f89f8be.tar.gz
servo-cc44a3b0641d94908b2b2e01bec440f64f89f8be.zip
Use JSTraceable everywhere
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index f73ccbb10fe..14acae9bfa2 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2754,7 +2754,8 @@ use js::jsapi::JSContext;
use js::jsval::JSVal;
#[repr(uint)]
-#[deriving(Encodable, PartialEq)]
+#[deriving(PartialEq)]
+#[jstraceable]
pub enum valuelist {
%s
}
@@ -4893,7 +4894,7 @@ class CGCallback(CGClass):
bases=[ClassBase(baseName)],
constructors=self.getConstructors(),
methods=realMethods+getters+setters,
- decorators="#[deriving(PartialEq,Clone,Encodable)]")
+ decorators="#[deriving(PartialEq,Clone)]#[jstraceable]")
def getConstructors(self):
return [ClassConstructor(
@@ -5438,7 +5439,6 @@ class GlobalGenRoots():
CGGeneric("use dom::bindings::js::{JS, JSRef, Temporary};\n"),
CGGeneric("use dom::bindings::trace::JSTraceable;\n"),
CGGeneric("use dom::bindings::utils::Reflectable;\n"),
- CGGeneric("use serialize::{Encodable, Encoder};\n"),
CGGeneric("use js::jsapi::JSTracer;\n\n")]
for descriptor in descriptors:
name = descriptor.name
@@ -5500,16 +5500,7 @@ class GlobalGenRoots():
'toBound': name + 'Derived'})),
CGGeneric("impl %s for %s {}\n\n" % (name + 'Cast', name))]
- trace = [CGGeneric(string.Template('''impl JSTraceable for ${name} {
- fn trace(&self, tracer: *mut JSTracer) {
- unsafe {
- self.encode(&mut *tracer).ok().expect("failed to encode");
- }
- }
-}
-''').substitute({'name': name}))]
-
- allprotos += protos + derived + cast + trace
+ allprotos += protos + derived + cast
curr = CGList(allprotos)
curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT)