diff options
-rw-r--r-- | src/components/script/dom/bindings/codegen/CodegenRust.py | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index 9701023b12d..459609bceec 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -5976,53 +5976,15 @@ class GlobalGenRoots(): @staticmethod def PrototypeList(config): - # Prototype ID enum. protos = [d.name for d in config.getDescriptors(hasInterfacePrototypeObject=True)] - idEnum = CGNamespacedEnum('id', 'ID', protos, [0], deriving="Eq") - idEnum = CGList([idEnum]) - idEnum.append(CGGeneric(declare="pub static MAX_PROTO_CHAIN_LENGTH: uint = " + - str(config.maxProtoChainLength) + ";\n\n")) - - # Wrap all of that in our namespaces. - #idEnum = CGNamespace.build(['mozilla', 'dom', 'prototypes'], - # CGWrapper(idEnum, pre='\n')) - #idEnum = CGWrapper(idEnum, post='\n') - - curr = CGList([idEnum]) - - # Constructor ID enum. - constructors = [d.name for d in config.getDescriptors(hasInterfaceObject=True, - hasInterfacePrototypeObject=False)] - idEnum = CGNamespacedEnum('id', 'ID', constructors, [0]) - - # Wrap all of that in our namespaces. - idEnum = CGNamespace.build(['mozilla', 'dom', 'constructors'], - CGWrapper(idEnum, pre='\n')) - idEnum = CGWrapper(idEnum, post='\n') - - #XXXjdm Not sure what to do with the constructors right now - #curr.append(idEnum) + return CGList([ + CGGeneric(AUTOGENERATED_WARNING_COMMENT), + CGGeneric("pub static MAX_PROTO_CHAIN_LENGTH: uint = %d;\n\n" % config.maxProtoChainLength), + CGNamespacedEnum('id', 'ID', protos, [0], deriving="Eq"), + ]) - #traitsDecl = CGGeneric(declare=""" -#template <prototypes::ID PrototypeID> -#struct PrototypeTraits; -# -#template <class ConcreteClass> -#struct PrototypeIDMap; -#""") - - #traitsDecl = CGNamespace.build(['mozilla', 'dom'], - # CGWrapper(traitsDecl, post='\n')) - - #curr.append(traitsDecl) - - # Add the auto-generated comment. - curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT) - - # Done. - return curr @staticmethod def RegisterBindings(config): |